Skip to content
Snippets Groups Projects
Commit a05ab1d1 authored by David McKenna's avatar David McKenna
Browse files

FIX: Pass on invalid station configurations instead of exiting.

parent 86a77e80
Branches
No related tags found
1 merge request!38FIX: Pass on invalid station configurations instead of exiting.
Pipeline #121304 passed
Pipeline: l2json

#121305

    ...@@ -103,7 +103,7 @@ def get_last_valid_device_value( ...@@ -103,7 +103,7 @@ def get_last_valid_device_value(
    value = get_value_from_metadata(metadata, antennafield, output_key, device_mapping) value = get_value_from_metadata(metadata, antennafield, output_key, device_mapping)
    if value is not None: if value is not None:
    return value return value
    raise KeyError(f"No value found for {output_key=} in provided metadata dicts.") print(f"No value found for {output_key=} in provided metadata dicts.")
    # def get_static_metadata(filtered_metadata: list[dict[str, Any]], antennafield: str, keys: set[str]) -> dict[str, str]: # def get_static_metadata(filtered_metadata: list[dict[str, Any]], antennafield: str, keys: set[str]) -> dict[str, str]:
    ......
    ...@@ -106,6 +106,9 @@ def yield_l2obs_from_params( ...@@ -106,6 +106,9 @@ def yield_l2obs_from_params(
    continue continue
    # filtered_metadata, filtered_data = metadata, data # filtered_metadata, filtered_data = metadata, data
    try:
    l2obs = parse_json.build_lofar2_observation(filtered_metadata, filtered_data) l2obs = parse_json.build_lofar2_observation(filtered_metadata, filtered_data)
    yield (station, field, datatype, obs_id), l2obs yield (station, field, datatype, obs_id), l2obs
    except Exception as e:
    print(f"Skipping {obs_id=} for {station}{field} due to {e=}")
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment