pelagos_py.steps.input_output.load_data#
- class pelagos_py.steps.input_output.load_data.LoadOG1(name, parameters=None, diagnostics=False, context=None)[source]#
Bases:
pelagos_py.steps.base_step.BaseStepLoads NetCDF files from
file_path.If
filter_bad_timeis set, measurements outsidedata_starttodata_endare removed before further processing.Time values are expected under the “TIME” variable (OG1 format). Missing times (NaT) raise an error; a “TIME” that is not monotonically increasing only logs a warning. See Position and Time Processing.
- Parameters:
filter_bad_time (bool, optional) – If True (default), removes all timestamps outside the expected time window.
data_start (str or np.datetime64, optional) – The minimum valid timestamp for the data. If not provided, the filter defaults to the DEPLOYMENT_TIME found in the dataset, or 1990-01-01T00:00:00 if no deployment time is found.
data_end (str or np.datetime64, optional) – The maximum valid timestamp for the data. If not provided, it defaults to the current system time when the pipeline is run.
Examples
Example usage in a pipeline configuration:
steps: - name: Load OG1 parameters: file_path: "/path/to/your/dataset.nc" filter_bad_time: false data_start: "2023-05-01T00:00:00" data_end: "2024-05-01T00:00:00"
- normalise_qc_flags()[source]#
Coerce QC flag variables to integers, mapping NaN to 0 (no QC).
Raw OG1 files store QC flags as float with NaN. Downstream steps use flags as integer array indices / dict keys, so normalise them once at load rather than having each step guard against float NaN flags. NaN means no QC has been applied yet, which is flag 0 (not 9/missing).