CrocoDash.raw_data_access package#
Subpackages#
- CrocoDash.raw_data_access.datasets package
- Submodules
- CrocoDash.raw_data_access.datasets.cesm_ocean_output module
CESM_MOM_OUTPUTCESM_MOM_OUTPUT.boundary_fill_methodCESM_MOM_OUTPUT.calendarCESM_MOM_OUTPUT.cesm_calendarCESM_MOM_OUTPUT.cf_calendarCESM_MOM_OUTPUT.depth_coordCESM_MOM_OUTPUT.descriptionCESM_MOM_OUTPUT.eta_var_nameCESM_MOM_OUTPUT.get_mom6_output_data()CESM_MOM_OUTPUT.get_mom6_single_variable_data()CESM_MOM_OUTPUT.linkCESM_MOM_OUTPUT.loggerCESM_MOM_OUTPUT.mom6_calendarCESM_MOM_OUTPUT.product_nameCESM_MOM_OUTPUT.time_unitsCESM_MOM_OUTPUT.time_var_nameCESM_MOM_OUTPUT.tracer_lat_coordCESM_MOM_OUTPUT.tracer_lon_coordCESM_MOM_OUTPUT.tracer_var_namesCESM_MOM_OUTPUT.tracer_x_coordCESM_MOM_OUTPUT.tracer_y_coordCESM_MOM_OUTPUT.u_lat_coordCESM_MOM_OUTPUT.u_lon_coordCESM_MOM_OUTPUT.u_var_nameCESM_MOM_OUTPUT.u_x_coordCESM_MOM_OUTPUT.u_y_coordCESM_MOM_OUTPUT.v_lat_coordCESM_MOM_OUTPUT.v_lon_coordCESM_MOM_OUTPUT.v_var_nameCESM_MOM_OUTPUT.v_x_coordCESM_MOM_OUTPUT.v_y_coord
CESM_POP_OUTPUTCESM_POP_OUTPUT.boundary_fill_methodCESM_POP_OUTPUT.calendarCESM_POP_OUTPUT.cesm_calendarCESM_POP_OUTPUT.cf_calendarCESM_POP_OUTPUT.delimiterCESM_POP_OUTPUT.depth_coordCESM_POP_OUTPUT.descriptionCESM_POP_OUTPUT.eta_var_nameCESM_POP_OUTPUT.get_cesm_single_variable_data()CESM_POP_OUTPUT.linkCESM_POP_OUTPUT.loggerCESM_POP_OUTPUT.marbl_var_namesCESM_POP_OUTPUT.mom6_calendarCESM_POP_OUTPUT.product_nameCESM_POP_OUTPUT.time_unitsCESM_POP_OUTPUT.time_var_nameCESM_POP_OUTPUT.tracer_lat_coordCESM_POP_OUTPUT.tracer_lon_coordCESM_POP_OUTPUT.tracer_var_namesCESM_POP_OUTPUT.tracer_x_coordCESM_POP_OUTPUT.tracer_y_coordCESM_POP_OUTPUT.u_lat_coordCESM_POP_OUTPUT.u_lon_coordCESM_POP_OUTPUT.u_var_nameCESM_POP_OUTPUT.u_x_coordCESM_POP_OUTPUT.u_y_coordCESM_POP_OUTPUT.v_lat_coordCESM_POP_OUTPUT.v_lon_coordCESM_POP_OUTPUT.v_var_nameCESM_POP_OUTPUT.v_x_coordCESM_POP_OUTPUT.v_y_coordCESM_POP_OUTPUT.z_unit_conversion
bbox_mask()convert_cftime_to_numeric()drop_extra_cftime_vars()first_value()get_date_range_from_filename()parse_dataset()read_single_variable_tseries_data()subset_dataset()subtract_month()validate_dataset_path()
- CrocoDash.raw_data_access.datasets.empty_products module
- CrocoDash.raw_data_access.datasets.gebco module
- CrocoDash.raw_data_access.datasets.glofas module
- CrocoDash.raw_data_access.datasets.glorys module
GLORYSGLORYS.boundary_fill_methodGLORYS.calendarGLORYS.cesm_calendarGLORYS.cf_calendarGLORYS.depth_coordGLORYS.descriptionGLORYS.eta_var_nameGLORYS.get_glorys_data_from_cds_api()GLORYS.get_glorys_data_from_rda()GLORYS.get_glorys_data_script_for_cli()GLORYS.linkGLORYS.loggerGLORYS.mom6_calendarGLORYS.product_nameGLORYS.time_unitsGLORYS.time_var_nameGLORYS.tracer_lat_coordGLORYS.tracer_lon_coordGLORYS.tracer_var_namesGLORYS.tracer_x_coordGLORYS.tracer_y_coordGLORYS.u_lat_coordGLORYS.u_lon_coordGLORYS.u_var_nameGLORYS.u_x_coordGLORYS.u_y_coordGLORYS.v_lat_coordGLORYS.v_lon_coordGLORYS.v_var_nameGLORYS.v_x_coordGLORYS.v_y_coord
- CrocoDash.raw_data_access.datasets.reference module
REFERENCE_OCEANREFERENCE_OCEAN.boundary_fill_methodREFERENCE_OCEAN.calendarREFERENCE_OCEAN.cesm_calendarREFERENCE_OCEAN.cf_calendarREFERENCE_OCEAN.depth_coordREFERENCE_OCEAN.descriptionREFERENCE_OCEAN.eta_var_nameREFERENCE_OCEAN.get_reference_ocean_data()REFERENCE_OCEAN.linkREFERENCE_OCEAN.loggerREFERENCE_OCEAN.marbl_var_namesREFERENCE_OCEAN.mom6_calendarREFERENCE_OCEAN.product_nameREFERENCE_OCEAN.time_unitsREFERENCE_OCEAN.time_var_nameREFERENCE_OCEAN.tracer_lat_coordREFERENCE_OCEAN.tracer_lon_coordREFERENCE_OCEAN.tracer_var_namesREFERENCE_OCEAN.tracer_x_coordREFERENCE_OCEAN.tracer_y_coordREFERENCE_OCEAN.u_lat_coordREFERENCE_OCEAN.u_lon_coordREFERENCE_OCEAN.u_var_nameREFERENCE_OCEAN.u_x_coordREFERENCE_OCEAN.u_y_coordREFERENCE_OCEAN.v_lat_coordREFERENCE_OCEAN.v_lon_coordREFERENCE_OCEAN.v_var_nameREFERENCE_OCEAN.v_x_coordREFERENCE_OCEAN.v_y_coord
- CrocoDash.raw_data_access.datasets.seawifs module
- CrocoDash.raw_data_access.datasets.srtm module
- CrocoDash.raw_data_access.datasets.utils module
- Module contents
Submodules#
CrocoDash.raw_data_access.base module#
Raw Data Access Module Requirements: 1. Must enforce a certain amount of metadata for each product (things like z coordinate name, u velocity name, etc) (from the parent class) 2. Must enforce specific keyword args in each access function (from the parent class) 3. There must be some sort of registry that can list/query all products & access methods 4. As minimal overhead as possible (for me, that meant no initialization!) 5. Should be easy to validate the function (easy to test if they work and the metadata) 6. Should be easy to validate the metadata 7. Need to be able to print out the available products, functions, and their respective descriptions.
How it was solved: 1. There is a set of “abstract” classes that specify an array of “required_metadata”. There is no type enforcement currently. This is checked in the _init_subclass hook. 2. There is a set of “abstract” classes that specify an array of “required_args”. There is no type enforcement. This is checked in the _init_subclass hook. 3. There is a class called ProductRegistry in the registry.py file that does this 4. The classes are all static. 5. There is a validate method in the BaseProduct class that takes in additional default args from child classes, and the _init_subclass hook validates the args. 6. The metadata is validated in the _init_subclass hook 7. The ProductRegistry holds all of that.
- class CrocoDash.raw_data_access.base.BaseProduct#
Bases:
objectBase class for all raw data products. It enforces the metadata on the product as well as the function args.
- required_args = ['output_folder', 'output_filename']#
- required_metadata = ['product_name', 'description', 'link']#
- classmethod validate_call(method_name, **kwargs)#
Validate that a call to an access method has correct arguments.
- classmethod validate_method(method_name, **kwargs)#
Default validation just makes a toy call with a temporary directory.
- classmethod write_metadata(file_path: str = None) dict#
Return a dict of the class metadata fields and their values, writes a file if a filepath is specified.
- class CrocoDash.raw_data_access.base.Calendar(cf: str, cesm: str, mom6: str)#
Bases:
objectPairs the calendar name each downstream consumer expects, so a product can’t declare one without the others.
cf is for xarray’s own time decode/encode while reading raw data (its CF convention name, e.g. “standard” for the real-world calendar). cesm is the CIME CALENDAR xml value. mom6 is the literal string the regridding step must stamp on output forcing files’ time:calendar attribute, since MOM6’s get_cal_time() accepts neither cf’s “standard” nor cesm’s upper-cased “GREGORIAN”/”NO_LEAP” – only e.g. “gregorian”/”noleap”.
- cesm: str#
- cf: str#
- mom6: str#
- class CrocoDash.raw_data_access.base.DatedBaseProduct#
Bases:
BaseProductSpecific enforcement needs for Dated Products
- required_args = ['output_folder', 'output_filename', 'dates']#
- classmethod validate_method(method_name, **kwargs)#
Default validation just makes a toy call with a temporary directory.
- class CrocoDash.raw_data_access.base.ForcingProduct#
Bases:
DatedBaseProductGeneric enforcement for any gridded, bounding-box-downloadable forcing product. Holds the metadata every such product needs regardless of target model: a lat/lon/variables/dates download contract, sane toy-call defaults for that contract’s lat/lon args, and its own time-axis naming (
time_var_name/time_units/cf_calendar/cesm_calendar/mom6_calendar) – every dated forcing product has some time coordinate to name, even one (like a static restart snapshot) that leaves these unused. Velocity/ tracer grid-point metadata is NOT here – seeVelocityTracerForcingProduct/MOM6ForcingProduct.- required_args = ['output_folder', 'output_filename', 'dates', 'variables', 'lon_max', 'lat_max', 'lon_min', 'lat_min', 'name']#
- required_metadata = ['product_name', 'description', 'link', 'time_var_name', 'time_units', 'cf_calendar', 'cesm_calendar', 'mom6_calendar']#
- classmethod validate_method(method_name, **kwargs)#
Default validation just makes a toy call with a temporary directory.
- class CrocoDash.raw_data_access.base.MOM6ForcingProduct#
Bases:
VelocityTracerForcingProductMOM6/regional_mom6-specific regridding metadata on top of
VelocityTracerForcingProduct– SSH and the OBC fill method, neither of which generalize to other models. Products that feed CrocoDash’s MOM6 OBC/IC pipeline (GLORYS,MOM6_OUTPUT) extend this.- required_metadata = ['product_name', 'description', 'link', 'time_var_name', 'time_units', 'cf_calendar', 'cesm_calendar', 'mom6_calendar', 'u_x_coord', 'u_y_coord', 'v_x_coord', 'v_y_coord', 'tracer_x_coord', 'tracer_y_coord', 'u_var_name', 'v_var_name', 'tracer_var_names', 'depth_coord', 'eta_var_name', 'boundary_fill_method']#
- classmethod write_metadata(file_path: str | None = None, include_marbl_tracers=False) dict#
Return a dict of the class metadata fields and their values, writes a file if a filepath is specified.
- class CrocoDash.raw_data_access.base.VelocityTracerForcingProduct#
Bases:
ForcingProductCoordinate/variable-name metadata for a product’s u/v velocity and tracer grid points – the var-map contract consumed by
regional_mom6’sSegment.regrid_velocity_tracers, not by the generic GET layer. Shared byMOM6ForcingProductand any future model whose velocity/tracer state lives on a plain (nj, ni) index space.- required_metadata = ['product_name', 'description', 'link', 'time_var_name', 'time_units', 'cf_calendar', 'cesm_calendar', 'mom6_calendar', 'u_x_coord', 'u_y_coord', 'v_x_coord', 'v_y_coord', 'tracer_x_coord', 'tracer_y_coord', 'u_var_name', 'v_var_name', 'tracer_var_names', 'depth_coord']#
- CrocoDash.raw_data_access.base.accessmethod(func=None, *, description=None, type=None, how_to_use=None)#
CrocoDash.raw_data_access.registry module#
- class CrocoDash.raw_data_access.registry.ProductRegistry#
Bases:
objectStatic registry that tracks all products and provides driver-like introspection.
- classmethod call(product_name, method_name, **kwargs)#
- classmethod get_access_function(product_name, method_name)#
Return the raw function (unbound), even if staticmethod.
- classmethod get_function_default_args(product_name, function_name)#
Return a dict of {param: default} for all non-required parameters of an access method.
- classmethod get_product(name)#
- classmethod list_access_methods(name)#
- classmethod list_products()#
- classmethod load()#
- loaded = False#
- classmethod product_exists(name)#
- classmethod product_is_of_type(name, the_class)#
- products = {}#
- classmethod register(product_cls)#
Register a product class.
- classmethod validate_function(product_name, method_name)#