2.5.3.2.1. vacumm.data.model.cfsr – CFSR atmospheric model

Classes:
Inheritance diagram:
 

CFSR atmospheric model output manipulation

class CFSR(dataset=None, time=None, lon=None, lat=None, level=None, ncobj_specs=None, nopat=False, patfreq=None, patfmtfunc=None, sort=True, check=True, **kwargs)[source]

Bases: vacumm.data.misc.dataset.AtmosDataset

Dataset class to read the CFSR atmospheric model outputs

Read the Dataset for more information

apply_config(config, **kwargs)

Apply passed configuration (usually internal call from load_config)

Call apply_config() and load datasets (if config has a Catalog section)

classmethod apply_default_config(config=None, encoding=None)

This will turn on debug mode of various features (config, objects stats) if the loglevel of nested Logger configuration is debug.

Set the default log level for the newly created objects based on nested Logger configuration.

Subclasses may override this to apply/update according to the new config

Params:

Note

  • overriding this method will obviously shunt its default beahvior, you’ll then have to call original method if needed
arakawa_grid_type = None
auto_generic_var_names = ['oro', 'wdir', 'wspd', 'uair', 'vair', 'wair', 'tair', 'pa', 'tkea']
close()
config

Current configuration

critical = <bound class method CFSR.wrapper>
debug = <bound class method CFSR.wrapper>
default_altitude_search_mode = None
classmethod describe(obj, **kwargs)
description = 'The CFSR atmospheric model'
domain = 'atmos'
error = <bound class method CFSR.wrapper>
exception = <bound class method CFSR.wrapper>
classmethod exception_trace()

Return a huge detailed exception traceback

finalize_object(var, squeeze=False, order=None, asvar=None, torect=True, depthup=None, **kwargs)

Finalize a variable

Params:
  • squeeze, optional: If not False, squeeze singletons axes using squeeze_variable().
  • order, optional: If not None, change the axes order of the variable. It must contains letters like ‘txyz-‘.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar_<param>: Param passed to grow_variables().
  • torect, optinal: Try to convert curvilinear grid to rectangular grid using curv2rect().
  • depthup, optional: If not False, try the make depth positive up using makedepthup().
classmethod from_config(config, *args, **kwargs)

Create a cls instance using args and kwargs and load config.

The nested named argument (in kwargs) is extracted before creating the instance and then passed to load_config.

Params:
  • config: A configuration file (str) or object (ConfigObj).
  • args and kwargs: Passed to the object constructor, without parmeters described above.
Return:
  • The created object of class cls
classmethod func_name(iframe=0)
get(varname, **kwargs)

Generic way to get a variable

It first tries to find a get_* method, then call get_variable() if no method is found.

get_altitude(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the altitude [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).

  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).

  • mode, optional: Computing mode

    • None: Try all modes, in the following order.
    • "var": Read it from a variable.
    • "sigma": Estimate from sigma coordinates.

    #not yet- "dz": Estimate from layer thinknesses (see get_dz()) #not yet- "axis": Read it from an axis (if not sigma coordinates)

    #You can specifiy a list of them: ['dz', 'sigma'] #You can also negate the search with #a ‘-‘ sigme before: "-dz".

  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().

  • asvar, optional: Reshape as this variable.

  • at, optional: Interpolate to this grid location using Datatset.toloc().

  • format, optional: Format the variable and its axes using format_var().

  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().

  • order, optional: Change order of axes (like 'xty').

  • Other keywords are passed to ncread_files().

get_altitude_t(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the altitude at T location [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).

  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).

  • mode, optional: Computing mode

    • None: Try all modes, in the following order.
    • "var": Read it from a variable.
    • "sigma": Estimate from sigma coordinates.

    #not yet- "dz": Estimate from layer thinknesses (see get_dz()) #not yet- "axis": Read it from an axis (if not sigma coordinates)

    #You can specifiy a list of them: ['dz', 'sigma'] #You can also negate the search with #a ‘-‘ sigme before: "-dz".

  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().

  • asvar, optional: Reshape as this variable.

  • at, optional: Interpolate to this grid location using Datatset.toloc().

  • format, optional: Format the variable and its axes using format_var().

  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().

  • order, optional: Change order of axes (like 'xty').

  • Other keywords are passed to ncread_files().

get_altitude_w(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the altitude at W location [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).

  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).

  • mode, optional: Computing mode

    • None: Try all modes, in the following order.
    • "var": Read it from a variable.
    • "sigma": Estimate from sigma coordinates.

    #not yet- "dz": Estimate from layer thinknesses (see get_dz()) #not yet- "axis": Read it from an axis (if not sigma coordinates)

    #You can specifiy a list of them: ['dz', 'sigma'] #You can also negate the search with #a ‘-‘ sigme before: "-dz".

  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().

  • asvar, optional: Reshape as this variable.

  • at, optional: Interpolate to this grid location using Datatset.toloc().

  • format, optional: Format the variable and its axes using format_var().

  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().

  • order, optional: Change order of axes (like 'xty').

  • Other keywords are passed to ncread_files().

get_axis(name, select=None, select2=None, dataset=None, warn=True, getid=False, searchmode=None, format=True)

Retreive a 1D or 2D axis.

Params:
  • name: Generic axis name.
  • select optional: Selection along this axis. Only slices are accepted for 2D axes.
  • select2 optional: Selection on the other dimension for 2D axes.
  • dataset optional: find axis based on this dataset.
  • getid, optional: If True, only return the id (netcdf name) or None.
  • warn, optional: Display a warning in case of problem.
  • searchmode, optional: Search order (see ncfind_obj()).
  • format, optional: Format the axis using format_axis()?
Return:
  • cdms2 axis or None if not found, or id
get_cda(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the averaged drag momentum coefficient [W s-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_cea(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the averaged latent heat flux coefficient [W s-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_cha(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the averaged drag thermal coefficient [W s-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
classmethod get_class_logger()

Return the Logger instance bound to this class.

get_config(copy=True)

Get the instance’s config

classmethod get_config_manager(reload=False, encoding=None)

Get the configuration manager for this class (cls). This manager and its underlying configuration specification must not be dynamically changed as it is fixed at design time.

Note

this method is also the config manager lazy loader

classmethod get_config_section_name()

Return (and define) the class specification section name

classmethod get_config_spec()

Load the config specs as ConfigObj object

It merges the specs of the current class and those of parents classes

classmethod get_config_spec_file()

Return (and define) the class specification file path

get_config_str()

Get the instance’s config as a string

get_corio(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the coriolis parameter [s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_corio_f(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the coriolis parameter at F location [s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_corio_t(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the coriolis parameter at T location [s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_corio_u(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the coriolis parameter at U location [s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_corio_v(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the coriolis parameter at V location [s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_ctime(*args, **kwargs)

Get time axis as a list of cdtime.comptime

It is a simple shortcut to:

>>> ds.get_time().asComponentTime()
Params:All arguments are passed to get_time()
classmethod get_default_config(encoding=None)

Get the default configuration (copy)

classmethod get_default_config_str(encoding=None)

Get the default configuration as a string

get_dx(**kwargs)

Get the grid resolution along X

It can be stored as an variable or computed from coordinates.

get_dx_u(**kwargs)

Get the grid resolution along X at U location

get_dx_v(**kwargs)

Get the grid resolution along X at V location

get_dy(**kwargs)

Get the grid resolution along Y

It can be stored as an variable or computed from coordinates.

get_dy_u(**kwargs)

Get the grid resolution along Y at U location

get_dy_v(**kwargs)

Get the grid resolution along Y at V location

get_evap(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the evaporation (positive when directed downward) [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_grid(**kwargs)
get_grid_f(**kwargs)
get_grid_f_old(lon=None, lat=None, format=True, warn=True)

Get grid at F location

get_grid_t(**kwargs)
get_grid_t_old(lon=None, lat=None, format=True, warn=True)

Get grid at T location

get_grid_u(**kwargs)
get_grid_u_old(lon=None, lat=None, format=True, warn=True)

Get grid at U location

get_grid_v(**kwargs)
get_grid_v_old(lon=None, lat=None, format=True, warn=True)

Get grid at V location

get_hflat(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the latent heat flux (positive when directed upward) [W.m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_hfsen(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the sensible heat flux (positive when directed upward) [W m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_hsection(varname, depth, time=None, lat=None, lon=None, timeavg=False, warn=True, **kwargs)

Get a horizontal section of a variable for a specified depth

Params:
  • varname: Generic var name.
  • depth: Target depth.
  • timeavg, optional: Time average of results.
  • depth_<param>, optional: Param is passed to get_depth().
  • interp_<param>, optional: Param is passed to interp1d().
get_hu2m(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 2 m specific humidity [kg kg-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_lat(lat=None, lon=None, **kwargs)

Get latitude axis

get_lat_f(lat=None, lon=None, **kwargs)

Get latitude axis at F location

get_lat_t(lat=None, lon=None, **kwargs)

Get latitude axis at T location

get_lat_u(lat=None, lon=None, **kwargs)

Get latitude axis at U location

get_lat_v(lat=None, lon=None, **kwargs)

Get latitude axis at V location

get_lathf(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the latent heat flux (positive when directed downward) [W.m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_latitude(lat=None, lon=None, **kwargs)

Get latitude axis

get_level(level=None, **kwargs)

Get level axis, based on get_axis()

get_logger = <bound class method CFSR.get_logger>
get_loglevel = <bound class method CFSR.wrapper>
get_lon(lon=None, lat=None, **kwargs)

Get longitude axis

get_lon_f(lon=None, lat=None, **kwargs)

Get longitude axis at F location

get_lon_t(lon=None, lat=None, **kwargs)

Get longitude axis at T location

get_lon_u(lon=None, lat=None, **kwargs)

Get longitude axis at U location

get_lon_v(lon=None, lat=None, **kwargs)

Get longitude axis at V location

get_longitude(lon=None, lat=None, **kwargs)

Get longitude axis

get_lwhf(**kwargs)
get_nethf(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the net radiation [W m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_options()

Get options

get_oro(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the orography for SLEVE vertical coordinates [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_pa(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the absolute pressure [Pa]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
classmethod get_parent_config_spec()

Get the merged config specifications of all parents

get_rain(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the precipitation [Downward (positive when it is raining)] [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_resol(degrees=False, at='t', mode=None, warn=True, **kwargs)

Get the horizontal grid resolutions

Params:
  • degrees, optional: In degrees or meters?
  • local, optional: Get resolution at each point?
Return:

dx,dy

See also:

get_dx() get_dy() get_grid() resol()

get_selector(level=None, **kwargs)

Get a cdms2.selectors.Selector from specified time/lat/lon/level selection

Params:
  • time/lon/lat/level, optional: Refine or set the selector with these components.
  • only, optional: Work only on one component, like “time” or “t”.
  • merge, optional: Merge with selector created at initialization time (stored in attribute selector.)
  • split, optional: return a splitted selector (see split_selector())
get_seltimes(time=None)

Get a zero to two elements time selector specifications

It is the addition of non global and local time selection specs

get_senhf(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the sensible heat flux (positive when directed downward) [W m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_shape(dims='tzyx', warn=True)

Get the dataset shape from known generic dims

Params:
  • dims, optional: Letters that select the generic dimensions to consider.
Return:

A tuple of the size of dimensions. If a requested dim is not found, None is returned for its size.

get_swhf(**kwargs)
get_t2m(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 2 m temperature [K]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_tair(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the temperature [degrees_kelvin]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_taux(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the surface wind stress along X [N m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_taux_u(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the surface wind stress along X at U location [N m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_tauy(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the surface wind stress along Y [N m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_tauy_v(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the surface wind stress along Y at V location [N m-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_time(time=None, var=None, ids=None, warn=True, **kwargs)

Load time axis in a best time serie fashion.

Params:
  • time: time selector
get_time_res()

Get the estimated time resolution, based on the two first time coordinates

Return:
  • resolution as datetime.timedelta
get_timeid(warn=False)

Get the time id

get_tkea(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the turbulent Kinetic Energy [m2 s-2]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_transect(varname, lons, lats, times=None, method='bilinear', subsamp=3, getcoords=False, timeavg=False, outaxis=None, time=None, lon=None, lat=None, level=None, warn=True, **kwargs)

Get a transect between two points

It uses transect().

Params:
  • varname: Generic var name.

  • lons/lats: Specification of transect, either

    • Coordinates of first and last point in degrees as tuples in the form (lon0,lon1) and (lat0,lat1). The array of coordinates is generated using transect_specs().
    • Or explicit array of coordinates (as scalars, lists or arrays).
  • times, optional: For time transect too.

  • subsamp, optional: Subsampling with respect to grid cell.

  • method, optional: Interpolation method (see grid2xy()).

  • getcoords, optional: Also get computed coordinates.

  • outaxis, optional: Output axis.

    • A cdms2 axis.
    • None or 'auto': Longitudes or latitudes depending on the range.
    • 'lon' or 'x': Longitudes.
    • 'lat' or 'y': Latitudes.
    • 'dist' or 'd': Distance in km.
  • timeavg, optional: Time average of results.

Return:

tvar or tvar,tlons,tlats

get_u10m(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m zonal wind speed (westerly) [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_u10m_t(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m zonal wind speed (westerly) at T location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_u10m_u(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m zonal wind speed (westerly) at U location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_u10m_v(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m zonal wind speed (westerly) at V location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_uair(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the zonal wind speed (westerly) [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_v10m(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m meridional wind speed (northerly) [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_v10m_t(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m meridional wind speed (northerly) at T location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_v10m_u(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m meridional wind speed (northerly) at U location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_v10m_v(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the 10-m meridional wind speed (northerly) at V location [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_vair(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the meridional wind speed (northerly) [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_variable(varname, level=None, squeeze=False, **kwargs)

Load a variable in a best time serie fashion.

Params:
  • varname: Either a generic variable name listed in CF_VAR_SPECS, a netcdf name with a ‘+’ a prefix, a tuple of netcdf variable names or dictionnary of specification names with a search argument of ncfind_var() (tuple of netcdf names or dictionary).
  • time/lon/lat/level: Selector components.
  • squeeze: If true, call squeeze_variable() on the returned variable.
  • order: If not None, specify the output variable axes order.
  • depthup: Make depths up.
  • torect: Make grid rectangular if possible.
  • at/toloc: Interpolate the variable to another location on the grid using toloc(). Note that the arakawa_grid_type must be defined.
  • format: Format the variable and its axes using format_var()?
  • warn: Display a warning message if the variable can”t be retreived.
  • Other kwargs are passed to ncread_files().
Return:

cdms2 variable or None if not found

Example:
>>> get_variable('ssh', lon=(-10,0))
>>> get_variable('+xe')
>>> get_variable(dict(search={'standard_name':'sea_surface_height_above_sea_level'}))
get_variable_names()

Get the list of netcdf variable names of the first file

get_wair(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the upward wind speed [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_wdir(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the wind direction [degrees]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_wspd(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the wind speed [m s-1]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
get_z0a(time=None, level=None, lat=None, lon=None, squeeze=False, order=None, asvar=None, at=None, format=None, torect=True, verbose=None, warn=None, mode=None, **kwargs)

Read the air roughness length [m]

Params:
  • time/level/lat/lon, optional: For selection (tuples or slices).
  • squeeze, optional: Squeeze singleton dimensions (see squeeze_variable(), like True, z or ['x','y']).
  • mode, optional: Retreiving mode
    • "var": Get from netcdf variable only.
    • "stag": Get it from another grid location.
  • asvar, optional: Grow variable to match the asvar variable, using grow_variables().
  • asvar, optional: Reshape as this variable.
  • at, optional: Interpolate to this grid location using Datatset.toloc().
  • format, optional: Format the variable and its axes using format_var().
  • torect, optional: If possible, convert a curvilinear grid to a rectilinar grid using curv2rect().
  • order, optional: Change order of axes (like 'xty').
  • Other keywords are passed to ncread_files().
info = <bound class method CFSR.wrapper>
classmethod init_class(name, bases, dct)

Redefine this method if you need class initialization

is_debug = <bound class method CFSR.wrapper>
is_verbose = <bound class method CFSR.wrapper>
classmethod kwfilter(kwargs, filters=None, *args, **kwa)

Shortcut to vacumm.misc.misc.kwfilter() with a filters argument which defaults to this class lowercase name.

load_config(config=None, nested=None, apply=True, cfgpatch=None, encoding=None, **kwargs)

Load / update the instance configuration

Params:
  • config: A configuration file (str) or object (ConfigObj) or None to load defaults, or an ArgumentParser object.
  • nested: Load from a nested config section instead of the whole config.
    If True, use the section name returned by get_config_section_name() Else if a string, use the section name defined by the nested string
  • cfgpatch: A manual patch to apply to the config once loaded.
  • Other options are passed to arg_parse().
Return:

A ConfigObj object or ConfigObj,options tuple if an ArgumentParser object has been passed

load_dataset(dataset, time=None, **kwargs)

Load dataset files.

Params:
  • dataset: can be either:
    • an instance or list of strings (filepath/filepattern/url) that will be passed to list_forecast_files().
    • an instance of Catalog
  • time: used with Catalog.find_datasets() when dataset is a string (or list of strings).
  • Extra keywords are passed to list_forecast_files() (via Catalog.find_datasets()).
Keyword parameters:
 
  • append: keep previously loaded datasets if True
Return:

The list of (newly) loaded datasets

Example:
>>> d.load_dataset('../../data/model/mars/champs_%Y%m_BOBI.nc', ('2004-01-01', '2004-04-01'), patfreq=(2,'month'), verbose=True)
[2013-01-14 09:42:43 CET Catalog INFO] Searching datasets using pattern: ['../../data/model/mars/champs_%Y%m_BOBI.nc'], time: ('2004-01-01', '2004-04-01')
Guessing file list using:
   filepattern: ../../data/model/mars/champs_%Y%m_BOBI.nc
   time selector: ('2004-01-01', '2004-03-31')
Found 2 files
[2013-01-14 09:42:43 CET Catalog INFO] Found 2 datasets
[2013-01-14 09:42:43 CET Dataset INFO] Loading datasets:
[2013-01-14 09:42:43 CET Dataset INFO] - ../../data/model/mars/champs_200401_BOBI.nc
[2013-01-14 09:42:43 CET Dataset INFO] - ../../data/model/mars/champs_200403_BOBI.nc
classmethod load_default_config(config=None, nested=None, apply=True, encoding=None)

Load / update the class (unique) default configuration

logger

A Logger instance. You can use this object for all logging operations related to this class

name = 'cfsr'
ncobj_specs = {'u10m': {'search': {'standard_names': ['U-component_of_wind'], 'id': ['10u', 'u10']}, 'squeeze': 'z'}, 'v10m': {'search': {'standard_names': ['V-component_of_wind'], 'id': ['10v', 'v10']}, 'squeeze': 'z'}}
notice = <bound class method CFSR.wrapper>
notset = <bound class method CFSR.wrapper>
options

Options loaded from the commandline parser or None

classmethod pformat(obj, indent=2, width=80, depth=None)

Pretty print an object

plot_hsection(varname, depth, time=None, lat=None, lon=None, timeavg=False, title='%(long_name)s at %(depth)im', mask_land=False, **kwargs)

Plot a horizontal section of a variable for a specified depth

Section is computed with get_hsection().

Params:
  • varname: Generic var name.
  • depth: Target depth.
  • timeavg, optional: Time average of results.
  • depth_<param>, optional: Param is passed to get_depth().
  • interp_<param>, optional: Param is passed to interp1d().
  • Other arguments are passed to map2().
plot_transect(varname, lons, lats, times=None, method='bilinear', timeavg=False, subsamp=3, outaxis=None, time=None, lon=None, lat=None, level=None, title='%(long_name)s along transect', minimap=None, **kwargs)

Plot a transect between two points

Params:
  • varname: Generic var name.
  • lons/lats/times: Specification of transect (see get_transect()).
  • title, optional: Title of the figure.
  • minimap, optional: If True, add a minimap showing the transect on a map; if False, display nothing; if None, display if no minimap already displayed.
  • minimap_<param>, optional: Passed to add_map_lines().
  • Some params are passed to get_transect().
  • Other params are passed to the plot function curve2() for 1D plots and, hov2() or section2() for 2D plots.
save_config(outfile=None, nested=None)
classmethod set_class_logger(logger)

Set the Logger instance bound to this class.

set_logger = <bound class method CFSR.set_logger>
set_loglevel = <bound class method CFSR.wrapper>
shape

Generic shape of the dataset

classmethod squeeze_variable(var, spec=True)

Squeeze a variable, preserving remaining axis

See also:vacumm.misc.misc.squeeze_variable()
static stack_trace(iframe=0)
toloc(var, loc, fromloc=None, copy=False, **kwargs)

Interpolate a variable to another location

It has no effect if the current Dataset instance has no valid arakawa_grid_type defined (None).

Params:
torect(var, curvsel=None)

Place a variable on rectangular grid if possible using curv2rect()

Params:
  • var: CDAT variable or grid.
classmethod trace(iframe=0, iftty=True)

Start pdb debugger

Params:
  • iframe: frame index entry point of the debugger, relative to the caller
  • iftty: if True, disable this call in a non interactive execution

Note

  • For debugging purpose only: do not let trace calls in a production environment, even if an interactive test is done !
verbose = <bound class method CFSR.wrapper>
warning = <bound class method CFSR.wrapper>