regrid_from_geotiff¶
- pycraf.pathprof.regrid_from_geotiff(geotiff, lons, lats, band=1)[source] [edit on github]¶
Retrieve interpolated GeoTiff raster values for given WGS84 coordinates (longitude, latitude).
Most GeoTiff raster maps will be based on reference frames other than geographic (WGS84), such that it is often necessary to reproject a map, e.g. to get the data values for the positions present in an terrain height map such as SRTM, which is the basis for path propagation loss calculations. By means of nearest neighbour interpolation one can quickly reproject (or regrid) a GeoTiff raster map to the required positions.
- Parameters
- Returns
- geo_data_regridded
ndarray
Regridded values of the input raster map on the given longitude and latitude positions. If the input GeoTiff has more than one band and you need to regrid several of the bands, please run the function repeatedly, specifying the band parameter.
- geo_data_regridded
Notes
If requested geo positions are all to close to the edge of the geotiff file, the interpolation can fail (
interpolate
will raise a ValueError in such cases).