Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add placeholder steps in pipeline from L2 to L4 #55

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions src/halodrops/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .sonde import Sonde
import configparser
import inspect
import xarray as xr


def get_mandatory_args(function):
Expand Down Expand Up @@ -202,6 +203,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
):
Expand Down Expand Up @@ -296,4 +314,55 @@ 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.",
},
"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.",
},
}