Try the CrocoDash Data Access Module

Try the CrocoDash Data Access Module#

This module can be used with case.configure_forcings to find different ways to access raw data from data sources. Just supply data product name and function name in the following manner:

case.configure_forcing(…other_arguments…, product_name = “product_name”, function_name = “function_name”)

Available products and functions can be found within the documentation and in raw_ata_access helper functions seen below and more. Please see the docs for all data_access functions.

from CrocoDash.raw_data_access import driver
from CrocoDash.raw_data_access import config as tb
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/profiles.py:303: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if positive is 'down':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:1406: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:1516: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Z'] is not None and var_dict['Ztype'] is 'Fixed' and self.interfaces is None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:1539: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Z'] is not None and var_dict['Ztype'] is 'Fixed' and self.interfaces is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:1545: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Z'] is not None and var_dict['Ztype'] is 'Generalized' and self.interfaces is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:1780: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.var_dict[field]['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2034: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2091: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2147: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2205: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Ztype'] is 'Fixed' and var_dict['Z'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2253: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed' and self.var_dict[field]['Z'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2319: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2363: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Z'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2385: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2399: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if var_dict['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2409: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2417: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2504: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2555: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed' and var_dict['z_interfaces'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2581: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed' and var_dict['z_interfaces'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2586: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed' and var_dict['z_interfaces'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2592: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if var_dict['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2596: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2679: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.var_dict[field]['Ztype'] is 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:2813: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.var_dict[temp_name]['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:3254: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.var_dict[field_x]['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:3259: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.var_dict[field]['Ztype'] is not 'Fixed':
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:4481: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if  self.var_dict[field]['stagger'] is '00' and self.var_dict[field]['Z'] is not None:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:4529: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if write_interfaces and self.var_dict[field]['Ztype'] is 'Fixed' and p == 0:
/home/runner/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/visualCaseGen/external/mom6_bathy/midas/rectgrid.py:4531: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  elif write_interfaces and self.var_dict[field]['Ztype'] is not 'Fixed':
pfr_obj = driver.ProductFunctionRegistry()
pfr_obj.load_functions()
pfr_obj.functions
{'GLORYS': {'get_glorys_data_from_cds_api': <function CrocoDash.raw_data_access.datasets.glorys.get_glorys_data_from_cds_api(dates, lat_min, lat_max, lon_min, lon_max, output_dir=None, output_file=None, dataset_varnames=['zos', 'uo', 'vo', 'so', 'thetao'])>,
  'get_glorys_data_from_rda': <function CrocoDash.raw_data_access.datasets.glorys.get_glorys_data_from_rda(dates: list, lat_min, lat_max, lon_min, lon_max, output_dir=PosixPath('.'), output_file='raw_glorys.nc', dataset_varnames=['time', 'latitude', 'longitude', 'depth', 'zos', 'uo', 'vo', 'so', 'thetao']) -> xarray.core.dataset.Dataset>,
  'get_glorys_data_script_for_cli': <function CrocoDash.raw_data_access.datasets.glorys.get_glorys_data_script_for_cli(dates: tuple, lat_min, lat_max, lon_min, lon_max, output_dir, output_file) -> None>},
 'SEAWIFS': {'get_global_seawifs_script_for_cli': <function CrocoDash.raw_data_access.datasets.seawifs.get_global_seawifs_script_for_cli(dates='UNUSED', lat_min='UNUSED', lat_max='UNUSED', lon_min='UNUSED', lon_max='UNUSED', output_dir=None, output_file='UNUSED', username='')>},
 'GEBCO': {'get_gebco_data_with_python': <function CrocoDash.raw_data_access.datasets.gebco.get_gebco_data_with_python(dates='UNUSED', lat_min='UNUSED', lat_max='UNUSED', lon_min='UNUSED', lon_max='UNUSED', output_dir=None, output_file=None)>,
  'get_gebco_data_script': <function CrocoDash.raw_data_access.datasets.gebco.get_gebco_data_script(dates='UNUSED', lat_min='UNUSED', lat_max='UNUSED', lon_min='UNUSED', lon_max='UNUSED', output_dir=None, output_file=None)>}}
tb.list_products()
['GLORYS',
 'GEBCO',
 'TPXO',
 'GLOFAS',
 'CESM Inputdata Repo (Bathymetry)',
 'CESM Inputdata Repo (Grids)',
 'SEAWIFS']
tb.list_functions("GLORYS")
['get_glorys_data_from_cds_api',
 'get_glorys_data_from_rda',
 'get_glorys_data_script_for_cli']
tb.type_of_function("GLORYS","get_glorys_data_from_cds_api")
'PYTHON'
case.configure_forcing(date_range = ["2020-01-01 00:00:00", "2020-01-09 00:00:00"], 
                       product_name = "product_name", 
                       function_name = "function_name")
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [6], in <cell line: 0>()
----> 1 case.configure_forcing(date_range = ["2020-01-01 00:00:00", "2020-01-09 00:00:00"], 
      2                        product_name = "product_name", 
      3                        function_name = "function_name")

NameError: name 'case' is not defined