Skip to content

Commit 2ca134a

Browse files
committed
Fix filepath bug
1 parent f9a8207 commit 2ca134a

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

cloudnetpy/cli.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,10 @@ def _process_instrument_product(
196196
input_files = input_folder
197197
case ("mwr-l1c", _id):
198198
fun = instruments.hatpro2l1c
199-
coefficients = _fetch_coefficient_files(calibration, tmpdir)
200199
site_meta = {**site_meta, **calibration}
201-
site_meta["coefficientLinks"] = coefficients
200+
coefficients, links = _fetch_coefficient_files(calibration, tmpdir)
201+
site_meta["coefficientFiles"] = coefficients
202+
site_meta["coefficientLinks"] = links
202203
input_files = input_folder
203204
case ("mrr", _id):
204205
fun = instruments.mrr2nc
@@ -221,7 +222,9 @@ def _concatenate_(input_files: list[Path], tmpdir: str) -> Path:
221222
return input_files[0]
222223

223224

224-
def _fetch_coefficient_files(calibration: dict, tmpdir: str) -> list[str]:
225+
def _fetch_coefficient_files(
226+
calibration: dict, tmpdir: str
227+
) -> tuple[list[str], list[str]]:
225228
msg = "No calibration coefficients found"
226229
if not (coeffs := calibration.get("retrieval_coefficients")):
227230
raise ValueError(msg)
@@ -234,7 +237,7 @@ def _fetch_coefficient_files(calibration: dict, tmpdir: str) -> list[str]:
234237
filepath = Path(tmpdir) / Path(filename).name
235238
filepath.write_bytes(res.content)
236239
coefficient_paths.append(str(filepath))
237-
return coefficient_paths
240+
return coefficient_paths, links
238241

239242

240243
def _get_calibration(

cloudnetpy/instruments/hatpro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def hatpro2l1c(
6464
date = datetime.date.fromisoformat(date)
6565
uuid = utils.get_uuid(uuid)
6666

67-
coeff_files = site_meta.get("coefficientLinks")
67+
coeff_files = site_meta.get("coefficientFiles")
6868
time_offset = site_meta.get("time_offset")
6969

7070
try:

0 commit comments

Comments
 (0)