climate_ref_esmvaltool.recipe
#
as_facets(group)
#
Convert a group from the datasets dataframe to ESMValTool facets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
DataFrame
|
A group of datasets representing a single instance_id. |
required |
Returns:
| Type | Description |
|---|---|
A :obj:`dict` containing facet-value pairs.
|
|
Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
as_isodate(timestamp)
#
Format a timestamp as an ISO 8601 datetime.
For example, '2014-12-16 12:00:00' will be formatted as '20141216T120000'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamp
|
Timestamp
|
The timestamp to format. |
required |
Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
as_timerange(group)
#
Format the timeranges from a dataframe as an ESMValTool timerange.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
DataFrame
|
The dataframe describing a single dataset. |
required |
Returns:
| Type | Description |
|---|---|
A timerange.
|
|
Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
dataframe_to_recipe(files, group_by=('instance_id',), equalize_timerange=False)
#
Convert the datasets dataframe to a recipe "variables" section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
DataFrame
|
The pandas dataframe describing the input files. |
required |
group_by
|
tuple[str, ...]
|
The columns to group the input files by. |
('instance_id',)
|
equalize_timerange
|
bool
|
If True, use the timerange that is covered by all datasets. |
False
|
Returns:
| Type | Description |
|---|---|
A "variables" section that can be used in an ESMValTool recipe.
|
|
Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
load_recipe(recipe)
#
Load a recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
str
|
The name of an ESMValTool recipe. |
required |
Returns:
| Type | Description |
|---|---|
The loaded recipe.
|
|
Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
prepare_climate_data(datasets, climate_data_dir)
#
Symlink the input files from the Pandas dataframe into a directory tree.
This ensures that ESMValTool can find the data and only uses the requested data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasets
|
DataFrame
|
The pandas dataframe describing the input datasets. |
required |
climate_data_dir
|
Path
|
The directory where ESMValTool should look for input data. |
required |