s1etad.geometry module
Tools for geometry management and coordinate conversion.
- class s1etad.geometry.GridGeocoding(grid_latitude, grid_longitude, grid_height=0, xaxis=None, yaxis=None, ellipsoid_name='WGS84', interpolation_kind='cubic')[source]
Bases:
object
Class to perform backward and forward geocoding using grid data.
This class implements a simple geocoding method that exploits pre-computed grids of latitude, longitude and height values.
The method is not as accurate as solving the range-Doppler equations.
- Parameters:
grid_latitude (ndarray) – regular grid of latitudes (in degrees) of shape [Ny, Nx] (y:azimuth and x:range)
grid_longitude (ndarray) –
- regular grid of longitudes (in degrees) of shape [Ny, Nx]
(y:azimuth and x:range)
grid_height (ndarray) – regular grid of heights of shape [Ny, Nx] (y:azimuth and x:range)
xaxis (ndarray) – axis in the x dimension (range) for the grids. It could be the range time. If not provided then default is np.arange(Nx)
yaxis (ndarray) – axis in the y dimension (azimuth) for the grids. It could be the azimuth time (elapsed seconds since a reference). If not provided then default is np.arange(Ny)
ellipsoid_name (str) – the identifier of the standard ellipsoid to be used for coordinate conversion. Default: “WGS84”
interpolation_kind (str) – Default: “cubic”
- backward_geocode(lats, lons, heights=0, deg=True)[source]
Perform the back geocoding: (lat, lon, h) -> (x, y).
Important
The current implementation always returns the solution of the backward geocoding at the height corresponding to the reference surface included in the ETAD product (provides latitude longitude and h grids), which is computed using the Copernicus DEM 90m.
- Parameters:
lats (list or ndarray) – array [N] of latitude for which the back geocoding is requested
lons (list or ndarray) – array [N] of longitude for which the back geocoding is requested
heights (float, list or ndarray) –
height for which the back geocoding is requested.
Warning
this parameter is not used in the current implementation.
deg (bool) – True if input geodetic coordinates are expressed in degrees, False otherwise
- Returns:
- x0:
array [N] of x coordinates (or range time) for each input in lats, lons, heights
- y0:
array [N] of y coordinates (or azimuth time) for each input in lats, lons, heights
- Return type:
ndarray, ndarray
- forward_geocode(x, y, deg=True)[source]
Perform forward geocoding (x, y) -> (lat, lon, h).
This is simply obtained by re-interpolating the latitude, longitude and height grids at the desired coordinates.
- Parameters:
- Returns:
- latitude:
array [N] of latitudes for each input coordinate
- longitude:
array [N] of longitudes for each input coordinate
- height:
array [N] of heights for each input coordinate
- Return type:
ndarray, ndarray, ndarray
- height(x, y)[source]
Interpolate the height grid at the (x, y) coordinates.
- Parameters:
x (ndarray) – array [N] of x coordinates (or range time) for each input in the latitude_grid. x shall be the same quantity as used for initialization (coordinates or time).
y (ndarray) – array [N] of y coordinates (or azimuth time) for each input in the latitude_grid. y shall be the same quantity as used for initialization (coordinates or time).
- Returns:
interpolated height
- Return type:
ndarray
- latitude(x, y)[source]
Interpolate the latitude grid at the (x, y) coordinates.
- Parameters:
x (ndarray) – array [N] of x coordinates (or range time) for each input in the latitude_grid. x shall be the same quantity as used for initialization (coordinates or time).
y (ndarray) – array [N] of y coordinates (or azimuth time) for each input in the latitude_grid. y shall be the same quantity as used for initialization (coordinates or time).
- Returns:
interpolated latitude ([deg])
- Return type:
ndarray
- longitude(x, y)[source]
Interpolate the longitude grid at the (x, y) coordinates.
- Parameters:
x (ndarray) – array [N] of x coordinates (or range time) for each input in the latitude_grid. x shall be the same quantity as used for initialization (coordinates or time).
y (ndarray) – array [N] of y coordinates (or azimuth time) for each input in the latitude_grid. y shall be the same quantity as used for initialization (coordinates or time).
- Returns:
interpolated longitude ([deg])
- Return type:
ndarray