API Reference#
APIs for Developers#
Below is a list of APIs available in pcmdi_metrics (> v3.6.1) for developers.
Data load#
|
Open input file (netCDF, or xml generated by cdscan) |
Land-sea mask#
|
Generate a land-sea mask (1 for land, 0 for sea) for a given xarray Dataset or DataArray. |
|
Apply a land-sea mask to a given DataArray or Dataset. |
|
Apply an ocean mask to a given DataArray or Dataset. |
Grid and regrid#
|
Generate a uniform grid for given latitude/longitude ranges and resolution |
|
Regrid the dataset to a given grid. |
Custom calendars#
|
Calculates the average of a user defined season in each year. |
|
Calculate the departure from a reference seasonal climatology for each season in a given year. |
Region handling#
|
Subset a dataset or data array based on a specified region. |
Retrieve data from xarray Dataset#
|
Get grid information |
|
Retrieve coordinate key names from the dataset or data array. |
|
Retrieve data variable names from the dataset or data array. |
|
Extract latitude coordinate data. |
Extract latitude bounds data. |
|
Get the key for the latitude dimension. |
|
|
Extract longitude coordinate data. |
Extract longitude bounds data. |
|
Get the key for the longitude dimension. |
|
|
Extract time coordinate data. |
Extract time bounds data. |
|
Get the key for the time bounds. |
|
|
Get the key for the time dimension. |
|
Select a subset of the given xarray dataset based on specified latitude, longitude, and time ranges. |
Quality control (QC) and repair#
|
Check if the time axis in an xarray dataset follows a correct daily sequence, considering all CFTime calendars. |
|
Check if the time axis of a dataset follows a correct monthly sequence. |
|
Regenerate the time axis and bounds for an xarray Dataset. |
Miscellaneous tools#
|
Sort a list of strings in natural order. |
|
Fill in a template string with keyword values. |
Create a nested defaultdict with infinite depth. |