shareloc.geomodels.rpc_optim

This module contains the optimized (with cpp bindings) RPC class corresponding to the RPC models. RPC models covered are : DIMAP V1, DIMAP V2, DIMAP V3, ossim (geom file), geotiff.

Module Contents

Classes

RPCoptim

RPC optimized with cpp bindings class including direct and inverse localization instance methods

class shareloc.geomodels.rpc_optim.RPCoptim(rpc_params)[source]

Bases: bindings_cpp.RPC, shareloc.geomodels.geomodel_template.GeoModelTemplate

RPC optimized with cpp bindings class including direct and inverse localization instance methods

classmethod load(geomodel_path)[source]

Load from any RPC (auto identify driver) from filename (dimap, ossim kwl, geotiff)

TODO: topleftconvention always to True, set a standard and remove the option

topleftconvention boolean: [0,0] position

If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)

direct_loc_h(row, col, alt, fill_nan=False, using_direct_coef=False)[source]

direct localization at constant altitude

Parameters:
  • row (float or 1D numpy.ndarray dtype=float64) – line sensor position

  • col (float or 1D numpy.ndarray dtype=float64) – column sensor position

  • alt – altitude

  • fill_nan (boolean) – fill numpy.nan values with lon and lat offset if true (same as OTB/OSSIM), nan is returned otherwise

Returns:

ground position (lon,lat,h)

Return type:

numpy.ndarray 2D dimension with (N,3) shape, where N is number of input coordinates

direct_loc_dtm(row, col, dtm)[source]

direct localization on dtm only if dtm’s epsg code is 4326

Parameters:
  • row (list or np.array) – line sensor position

  • col (list or np.array) – column sensor position

  • dtm (shareloc.bindings.dtm_intersection.cpp) – dtm intersection c++ model

Returns:

ground position (lon,lat,h) in dtm coordinates system

Return type:

numpy.ndarray 2D dimension with (N,3) shape, where N is number of input coordinates

inverse_loc(lon, lat, alt)[source]

Inverse localization using c++ bindings

Parameters:
  • lon (float or 1D numpy.ndarray dtype=float64) – longitude position

  • lat (float or 1D numpy.ndarray dtype=float64) – latitude position

  • alt (float) – altitude

Returns:

sensor position (row, col, alt)

Return type:

tuple(1D np.array row position, 1D np.array col position, 1D np.array alt)

get_dtm_alt_offset(corners, dtm)[source]

returns min/max altitude offset between dtm coordinates system and RPC one

Parameters:
  • corners (np.ndarray (4x2)) – corners of the DTM’s footprint

  • dtm (bindings.DTMIntersection) – DTM to get alt offset from

Returns:

min/max altimetric difference between RPC’sepsg minus dtm alti expressed in dtm epsg

Return type:

list of float (1x2)

los_extrema(row, col, alt_min=None, alt_max=None, fill_nan=False, epsg=4326)[source]

compute los extrema

Parameters:
  • row (float) – line sensor position

  • col (float) – column sensor position

  • alt_min (float) – los alt min

  • alt_max (float) – los alt max

  • epsg (int) – epsg code of the dtm

Returns:

los extrema

Return type:

numpy.array (2x3)