Utilities
Coordinate Utilities
A collection of utilities to manipulate and check coordinate systems dictionaries.
handshake_dim | Simple check to see if coordinate system has a dimension in a particular index |
handshake_coords | Simple check to see if the required dimensions have the same coordinate system |
handshake_size | Simple check to see if a coordinate system of a given dimension is a required size |
map_coords | A basic interpolation util to map between coordinate systems with common dimensions. |
split_coords | A utility function to split a dimension from a (x,coords) pair and convert it into a list of tensors, a CoordSystem, and the dimension that extract from coords. |
Grid Interpolation
Vertical Interpolation
hybrid_pressure | Pressure on hybrid sigma-pressure levels, `p = a + b * surface_pressure`. |
interpolate_vertical | Interpolate `x` linearly along a vertical coordinate onto `target` levels. |
Regridders
Implementations of the earth2studio.grids.Regridder protocol, which map fields
between grid definitions.
Data Source Wrappers
Compositions that stand in for a data or forecast source.
CompositeForecastSource | Forecast source assembled from components that provide disjoint variables. |
CompositeSource | Data source assembled from analysis sources that provide disjoint variables. |
RegriddedSource | Data or forecast source whose fields are regridded onto a target grid. |
Observation Utilities
Time Utilities
timearray_to_datetime | Simple converter from numpy datetime64 array into a list of datetimes. |
to_time_array | A general converter for various time iterables into a numpy datetime64 array |
Checkpoint Classes
Checkpoint Helpers
Data Utilities
datasource_to_file | Utility function that can be used for building a local data store needed for an inference request. |
fetch_data | Fetch field DataArrays with temporal statistics, optionally regridded. |
fetch_dataframe | Utility function to fetch data frames from particular sources |
fetch_dataframes | API reference page. |
prep_data_array | Prepares a data array from a data source for inference workflows by converting the data array to a torch tensor and the coordinate system to an OrderedDict. |
STAC Utilities
Shared layer for lazy, cloud-native access to STAC-cataloged rasters that
collection-specific data sources build on.
search | Search a STAC catalog and open the results as one lazy array. |
search_items | Search a STAC API and return the matching items. |
open_asset | Open one item asset as a lazy, dask-backed [`xarray.DataArray`][xarray.DataArray]. |
collections | List a catalog's collections with their asset keys and extents. |
StacProvider | A STAC API endpoint and how to turn its asset hrefs into GDAL paths. |
Model Utilities
Package | A generic file system abstraction with local caching, uses Fsspec WholeFileCacheFileSystem to manage files. |
batch_func | Batch utility decorator which can be added to prognostic and diagnostic models to help enable support for automatic batching of data. |