API reference
Here we will add the documentation for selected modules.
Grid
A structured grid on a map projection. |
Grid attributes
|
|
number of grid points in the x direction. |
|
number of grid points in the y direction. |
|
x grid spacing (always positive). |
|
y grid spacing (positive if ll_corner, negative if ul_corner). |
|
X reference point in projection coordinates. |
|
Y reference point in projection coordinates. |
|
|
|
if coordinates are at the |
|
x coordinates of the grid points (1D, no mesh) |
|
y coordinates of the grid points (1D, no mesh) |
|
Tuple of x, y coordinates of the grid points. |
|
Tuple of longitudes, latitudes of the grid points. |
|
Tuple of x, y coordinates of the X staggered grid. |
|
Tuple of x, y coordinates of the Y staggered grid. |
|
Tuple of longitudes, latitudes of the X staggered grid. |
|
Tuple of longitudes, latitudes of the Y staggered grid. |
|
|
|
|
|
[left, right, bottom, top] boundaries of the grid in the grid's projection. |
Grid methods
Get the extent of the grid in a desired crs. |
|
Converts local i, j to cartesian coordinates in a specified crs |
|
A less strict comparison between grids. |
|
Computes a region of interest (ROI). |
|
Make a copy of the grid with an updated spatial resolution. |
|
Converts any coordinates into the local grid. |
|
Reprojects any structured data onto the local grid. |
|
Performs forward transformation of any other grid into self. |
|
Performs the forward transformation of gridded data into self. |
|
Serialize this grid to a dictionary. |
|
Create a Grid from a dictionary |
|
Serialize this grid to a json file. |
|
Create a Grid from a json file |
|
Creates an empty dataset based on the Grid's geolocalisation. |
|
Makes a geometrical representation of the grid (e.g. for drawing). |
Georeferencing utils
Checks if the crs represents a valid grid, projection or ESPG string. |
|
Checks is two pyproj projections are equal. |
|
Converts a pyproj.Proj to a cartopy.crs.Projection |
|
Wrapper around the pyproj.transform function. |
|
Reprojects a shapely geometry. |
|
Reprojects a geopandas dataframe. |
|
Local (transverse) mercator map centered on a specified point. |
|
Find out if the dataset contains enough info for Salem to understand. |
|
Reduces an array's size by a given factor. |
Graphics
Assigns the right color to your data. |
|
Plotting georeferenced data. |
|
Get a colormap from mpl, and also those defined by Salem. |
Map & DataLevels methods
Appends a colorbar to existing axes |
|
Returns a ColorbarBase to add to the cax axis. |
|
Set a colormap. |
|
Any kind of data array (also masked). |
|
Shortcut to all parameters related to the plot. |
|
Colorbar extensions: 'neither' | 'both' | 'min' | 'max' |
|
Levels you define. |
|
Automatic N levels. |
|
Maximum level value. |
|
Mininum level value. |
|
Quick plot, useful for debugging. |
|
Add a kind of plot of the data to an axis. |
Map methods
Adds data to the plot. |
|
Adds data to contour on the map. |
|
Adds data to contourfill on the map. |
|
Adds any Shapely geometry to the map. |
|
Add longitude and latitude contours to the map. |
|
Shortcut for set_geometry() accepting coordinates as input. |
|
Manually force to a rgb img |
|
Add a shapefile to the plot. |
|
Add a text to the map. |
|
Add topographical shading to the map. |
|
Add a legend bar showing the scale to the plot. |
|
Get a matplotlib transform object for a given reference system |
|
Quick plot, useful for debugging. |
|
Add the map plot to an axis. |
Input/output
Returns the path to the desired demo file. |
|
Reads a shapefile using geopandas. |
|
Same as read_shapefile but directly transformed to a grid. |
xarray
Thin wrapper around xarray's open_dataset. |
|
Wrapper to Met Office Unified Model files (experimental) |
|
Wrapper around xarray's open_dataset to make WRF files a bit better. |
|
Open multiple WRF files as a single WRF dataset. |
xarray accessors
Salem adds accessors to xarray objects. They can be accessed via the
.salem
attribute and add the following methods:
DataArray
Get a subset of the dataset. |
|
Make a region of interest (ROI) for the dataset. |
|
Reprojects an other Dataset or DataArray onto self. |
|
Reprojects an other Dataset or DataArray onto self using the forward tranform lookup. |
|
Get a cartopy.crs.Projection for this dataset. |
|
Make a salem.Map out of the dataset. |
|
Make a plot of the DataArray. |
|
Interpolates the array along the vertical dimension |
|
De-accumulates the variable (i.e. compute the variable's rate). |
Dataset
Get a subset of the dataset. |
|
Make a region of interest (ROI) for the dataset. |
|
Reprojects an other Dataset or DataArray onto self. |
|
Reprojects an other Dataset or DataArray onto self using the forward tranform lookup. |
|
Reprojects an other Dataset and adds it's content to the current one. |
|
Get a cartopy.crs.Projection for this dataset. |
|
Make a salem.Map out of the dataset. |
|
Make a plot of a variable of the DataSet. |
|
Interpolates to a specified height above sea level. |
|
Interpolates to a specified pressure level (hPa). |
Old-style datasets
Old-style Datasets (prior to xarray), kept for backwards compatibility reasons and because they are quite lightweight. They might be replaced by xarray’s datasets one day.
Interface for georeferenced datasets. |
|
Geolocalised tiff images (needs rasterio). |
|
NetCDF files with geolocalisation info. |
|
WRF proof-of-concept template. |
|
Google static map centered on a point. |
|
Google static map automatically sized and zoomed to a selected region. |
Other
Emulates geogrid.exe, which is useful when defining new WRF domains. |