From 515037efeccd0dac5a2bba60f186ec18ec2d64e6 Mon Sep 17 00:00:00 2001 From: Geet George Date: Mon, 13 Nov 2023 17:18:39 +0100 Subject: [PATCH 1/3] add L2 placeholder steps --- src/halodrops/pipeline.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/halodrops/pipeline.py b/src/halodrops/pipeline.py index a233eaa..bc9e5a1 100644 --- a/src/halodrops/pipeline.py +++ b/src/halodrops/pipeline.py @@ -296,4 +296,18 @@ def run_pipeline(pipeline: dict, config: configparser.ConfigParser): ], "output": "sondes", }, + "create_L2": { + "intake": "sondes", + "apply": iterate_Sonde_method_over_dict_of_Sondes_objects, + "functions": [], + "output": "sondes", + "comment": "This steps creates the L2 files after the QC (user says how QC flags are used to go from L1 to L2) and then saves these as L2 NC datasets.", + }, + "read_and_process_L2": { + "intake": "sondes", + "apply": iterate_Sonde_method_over_dict_of_Sondes_objects, + "functions": [], + "output": "sondes", + "comment": "This step reads from the saved L2 files and prepares individual sonde datasets before they can be concatenated to create L3.", + }, } From a52991ee459180deabef57fd994601b9faf550b6 Mon Sep 17 00:00:00 2001 From: Geet George Date: Tue, 14 Nov 2023 17:26:18 +0100 Subject: [PATCH 2/3] add placeholder fns and pipeline steps from L2 to L4 --- src/halodrops/pipeline.py | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/halodrops/pipeline.py b/src/halodrops/pipeline.py index bc9e5a1..708a830 100644 --- a/src/halodrops/pipeline.py +++ b/src/halodrops/pipeline.py @@ -202,6 +202,23 @@ def iterate_Sonde_method_over_dict_of_Sondes_objects( return my_dict +def sondes_to_gridded(sondes: dict) -> xr.Dataset: + pass + + +def iterate_method_over_dataset(dataset: xr.Dataset, functions: list) -> xr.Dataset: + pass + + +def gridded_to_pattern( + gridded: xr.Dataset, config: configparser.ConfigParser +) -> xr.Dataset: + """ + The flight-phase segmentation file must be provided via the config file. + """ + pass + + def run_substep( previous_substep_output, substep: dict, config: configparser.ConfigParser ): @@ -310,4 +327,41 @@ def run_pipeline(pipeline: dict, config: configparser.ConfigParser): "output": "sondes", "comment": "This step reads from the saved L2 files and prepares individual sonde datasets before they can be concatenated to create L3.", }, + "concatenate_L2": { + "intake": "sondes", + "apply": sondes_to_gridded, + "output": "gridded", + "comment": "This step concatenates the individual sonde datasets to create the L3 dataset and saves it as an NC file.", + }, + "create_L3": { + "intake": "gridded", + "apply": iterate_method_over_dataset, + "functions": [], + "output": "gridded", + "comment": "This step creates the L3 dataset after adding additional products.", + }, + "create_patterns": { + "intake": "gridded", + "apply": gridded_to_pattern, + "output": "pattern", + "comment": "This step creates a dataset with the pattern-wide variables by creating the pattern with the flight-phase segmentation file.", + }, + "create_L4": { + "intake": "pattern", + "apply": iterate_method_over_dataset, + "functions": [], + "output": "pattern", + "comment": "This step creates the L4 dataset after adding additional products and saves the L4 dataset.", + }, + "quicklooks": { + "intake": ["sondes", "gridded", "pattern"], + "apply": [ + iterate_Sonde_method_over_dict_of_Sondes_objects, + iterate_method_over_dataset, + iterate_method_over_dataset, + ], + "functions": [[], [], []], + "output": "plots", + "comment": "This step creates quicklooks from the L3 & L4 dataset.", + }, } From 1a5e2f4d2a32327d8d3492e8272508549903dad2 Mon Sep 17 00:00:00 2001 From: Geet George Date: Tue, 14 Nov 2023 17:33:24 +0100 Subject: [PATCH 3/3] import xarray --- src/halodrops/pipeline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/halodrops/pipeline.py b/src/halodrops/pipeline.py index 708a830..97f5975 100644 --- a/src/halodrops/pipeline.py +++ b/src/halodrops/pipeline.py @@ -2,6 +2,7 @@ from .sonde import Sonde import configparser import inspect +import xarray as xr def get_mandatory_args(function):