API#
Core#
These functions make up the core of the TAMS algorithm
and are available at the top level (tams):
|
Identify clouds in 2-D (lat/lon) or 3-D (lat/lon + time) cloud-top temperature data ctt. |
|
Assign group IDs to the CEs identified at each time, returning a single CE frame. |
|
Classify the CE groups into MCS classes (categorical column |
The helper function tams.run() combines the above plus additional processing,
including computing stats on gridded data within the identified cloud element regions.
|
Run all TAMS steps, including precip assignment. |
Lower level functions used in the above include:
|
Contour x at value, producing a dataframe of contour lines. |
|
Compute statistics on data within the shapes of contours. |
|
Compute the (first) eccentricity of the least-squares best-fit ellipse to the coordinates of the polygon's exterior. |
|
For each contour in a, determine those in b that overlap and by how much. |
|
Project the coordinates by u * dt meters in the x direction. |
Ellipse fitting#
Used by tams.eccentricity().
|
Fit ellipse to the exterior coordinates of the polygon. |
|
Ellipse fit parameters, e.g. returned by |
Ellipse fit parameters:
Center |
|
Diameter in the x-direction before rotation. |
|
Diameter in the y-direction before rotation. |
|
Rotation angle (degrees) from x-axis to the width axis. |
Ellipse properties/methods:
Semi-major axis length. |
|
Semi-minor axis length. |
|
The linear eccentricity (distance from center to focus). |
|
Alias for |
|
The (first) eccentricity. |
|
Convert to |
Deprecated#
Calculate the (first) eccentricity of the least-squares best-fit ellipse to the coordinates of the polygon's exterior. |
Data#
Loaders for various data sets.
|
Retrieve an example data file using pooch and gdown. |
|
Open an example dataset with xarray. |
|
Load an example dataset into memory with xarray. |
|
Compute brightness temperature from IR satellite radiances (r) in channel ch of the EUMETSAT MSG SEVIRI instrument. |
|
Stream GPM MERGIR brightness temperature from NASA Earthdata. |
|
Stream GPM IMERG L3 precipitation from NASA Earthdata. |
Example datasets#
These can be accessed with tams.data.open_example() or
tams.data.load_example().
Key |
Description |
Relevant example notebooks |
|---|---|---|
|
Satellite infrared radiance data. This comes from the EUMETSAT MSG SEVIRI instrument, specifically the 10.8 μm channel (ch9). This dataset contains 6 time steps of 2-hourly data (every 2 hours): 2006-09-01 00–10 |
|
|
As in |
|
|
GPM IMERG precipitation data. This is left-labeled half-hourly precipitation rate (mm/hr)
fetched using |
|
|
MPAS-A model output (regridded). This is a spatial and variable subset of native MPAS output, Furthermore, it has been regridded to a regular lat/lon grid (0.25°) from the original 15-km mesh. After regridding, it was spatially subsetted so that lat ranges from -5 to 40°N and lon from 85 to 170°E. This domain relates to the PRECIP field campaign. It has
\[E = \sigma T^4
\implies T = (E / \sigma)^{1/4}\]
where \(E\) is the OLR (outgoing longwave radiation, This dataset contains 127 time steps of hourly data: 2006-09-08 12 – 2006-09-13 18. |
|
|
MPAS-A native (unstructured grid) model output. This is a spatial and variable subset of native 15-km global mesh MPAS output. It has been spatially subsetted so that
lat ranges from -5 to 20°N
and lon from 85 to 170°E,
similar to the example regridded MPAS dataset ( Like the regridded MPAS dataset, it has hourly
Like the regridded MPAS dataset (
\[E = \sigma T^4
\implies T = (E / \sigma)^{1/4}\]
where \(E\) is the OLR (outgoing longwave radiation, |
|
|
Small idealized/test datasets from the MOSA paper [U2]. |
External data sources#
Function |
Description |
Relevant example notebooks |
|---|---|---|
GPM MERGIR brightness temperature from NASA. |
||
GPM IMERG precipitation data from NASA. |
Idealized#
Create and evolve systems of ellipsoidal blobs for demonstrating and testing TAMS.
See the example notebook for some demonstrations.
|
An elliptical blob that can be used to represent a cloud element (or part of one, if blobs are overlapping). |
|
A field of blobs. |
|
Simulate a field of blobs. |
Blob properties:
The ellipse perimeter as a |
|
The ellipse as a |
Transform blobs:
|
Set in place the tendency of one or more of the ellipse parameters in per hour units. |
|
Get the current tendency of one or all (default) of the ellipse parameters. |
|
Evolve the blob in place by the given number of hours. |
|
Merge with another blob, creating a new blob with area-weighted-average characteristics. |
|
Split the blob into n smaller blobs that line up along the minor axis. |
Return a copy of the blob. |
|
|
Convert the blob to a GeoPandas GeoSeries, using the polygon. |
|
Convert the blob to a Matplotlib Ellipse patch. |
Compute the blob’s impact on the field:
|
Parabolic well function. |
Transform a collection of blobs:
|
Evolve the field in place by the given number of hours. |
|
Convert the field to an xarray DataArray. |
|
Convert the field to a GeoPandas GeoDataFrame. |
Return a copy of the field. |
Simulate a collection of blobs:
|
Advance the simulation by the given number of time steps. |
|
Convert the history and current field to an xarray DataArray. |
Utilities#
Currently this is available at the top level (tams),
but it may be separate in the future.
|
Plot CEs at a range of times (colors) with CE group ID (MCS ID) identified. |
Options#
Like the core routines,
options management is available at the top level (tams).
|
Globally or temporarily (context manager) set options. |
Get current options (a copy, edits have no effect). |