satpy.coords module
Utility functions for coordinates.
- satpy.coords.add_crs_xy_coords(data_arr, area)[source]
Add
pyproj.crs.CRSand x/y or lons/lats to coordinates.For SwathDefinition or GridDefinition areas this will add a crs coordinate and coordinates for the 2D arrays of lons and lats.
For AreaDefinition areas this will add a crs coordinate and the 1-dimensional x and y coordinate variables.
- Parameters:
data_arr (xarray.DataArray) – DataArray to add the ‘crs’ coordinate.
area (pyresample.geometry.AreaDefinition) – Area to get CRS information from.
- satpy.coords.add_xy_coords(data_arr, area, crs=None)[source]
Assign x/y coordinates to DataArray from provided area.
If ‘x’ and ‘y’ coordinates already exist then they will not be added.
- Parameters:
data_arr (xarray.DataArray) – data object to add x/y coordinates to
area (pyresample.geometry.AreaDefinition) – area providing the coordinate data.
crs (pyproj.crs.CRS or None) – CRS providing additional information about the area’s coordinate reference system if available. Requires pyproj 2.0+.
Returns (xarray.DataArray): Updated DataArray object