pycif.plugins.datastreams.fluxes.orchidee — API reference

pycif.plugins.datastreams.fluxes.orchidee — API reference#

Configuration reference: orchidee plugin

pycif.plugins.datastreams.fluxes.orchidee.fetch.fetch(ref_dir, ref_file, input_interval, target_dir, tracer=None, component=None, **kwargs)[source]#

Fetch files and dates for ORCHIDEE.

Parameters:
  • ref_dir (str) – the path to the input files

  • ref_file (str) – format of the input files

  • input_interval (list) – simulation interval (start and end dates)

  • target_dir (str) – where to copy

  • tracer – the tracer Plugin, corresponding to the paragraph datavect/components/fluxes/parameters/my_species in the configuration yaml; can be needed to fetch extra information given by the user

  • component – the component Plugin, same as tracer; corresponds to the paragraph datavect/components/fluxes in the configuration yaml

Returns:

for each date that begins a period, an array containing

the names of the files that are available for the dates within this period

list_dates: for each date that begins a period, an array containing

the names of the dates matching the files listed in list_files

Return type:

list_files

pycif.plugins.datastreams.fluxes.orchidee.get_domain.get_domain(ref_dir, ref_file, input_interval, target_dir, tracer=None)[source]#

Read information from the reference file to define the data horizontal and, if relevant, vertical domain.

Parameters:
  • ref_dir (str) – the path to the input files

  • ref_file (str) – format of the input files

  • input_interval (list) – simulation interval (start and end dates)

  • target_dir (str) – where to copy

  • tracer – the tracer Plugin, corresponding to the paragraph datavect/components/fluxes/parameters/my_species in the configuration yaml; can be needed to fetch extra information given by the user

Returns:

a domain class object, with the definition of the center grid

cells coordinates, as well as corners

Return type:

domain (Domain)

pycif.plugins.datastreams.fluxes.orchidee.read.read(self, name, varnames, dates, files, interpol_flx=False, tracer=None, model=None, ddi=None, **kwargs)[source]#

Get fluxes from raw files and load them into a pyCIF variables.

Parameters:
  • name (str) – name of the component

  • varnames (list[str]) – original names of variables to read; use name if varnames is empty

  • dates (list) – list of the date intervals to extract

  • files (list) – list of the files matching dates

Returns:

the actual data with dimension:

time, levels, latitudes, longitudes

Return type:

xr.DataArray

pycif.plugins.datastreams.fluxes.orchidee.write.write(self, name, flx_file, flx, mode='a', **kwargs)[source]#