shareloc.geofunctions.dtm_intersection

This module contains the DTMIntersection class to handle DTM intersection.

Module Contents

Classes

DTMIntersection

DTMIntersection class dedicated to earth elevation handling with a DTM

class shareloc.geofunctions.dtm_intersection.DTMIntersection(dtm_image_epsg, dtm_image_alt_data, dtm_image_nb_rows, dtm_image_nb_columns, dtm_image_transform)[source]

DTMIntersection class dedicated to earth elevation handling with a DTM

we work in cell convention [0,0] is the first cell center (not [0.5,0.5])

eq_plan(i, position)[source]

return evaluation of equation on a plane on DTM cube

Parameters:
  • i (int) – face index

  • position (numpy.array (1x3)) – position

Returns:

evaluation on the plan

Return type:

float

ter_to_index(vect_ter)[source]

terrain to index conversion

Parameters:

vect_ter (array (1x2 or 1x3) if dimension is 3 , last coordinate is unchanged (alt)) – terrain coordinate (lon,lat)

Returns:

index coordinates (col,row)

Return type:

array (1x2 or 1x3)

ters_to_indexs(vect_ters)[source]

terrain to index conversion

Parameters:

vect_ters (array (nx2 or nx3) if dimension is 3 , last coordinates is unchanged (alt)) – terrain coordinates

Returns:

index coordinates

Return type:

array (nx2 or nx3)

index_to_ter(vect_dtm)[source]

index to terrain conversion

Parameters:

vect_dtm (array (1x2 or 1x3) if dimension is 3 , last coordinate is unchanged (alt)) – index coordinate (col,row)

Returns:

terrain coordinates (lon,lat)

Return type:

array (1x2 or 1x3)

get_footprint_corners()[source]

get_footprint_corners method

Returns:

footrpint corners of dtm

Return type:

np.ndarray(4x2) top_left, top_right, bottom_right, bottom_left

interpolate(pos_row, pos_col)[source]

interpolate altitude if interpolation is done outside DTM the penultimate index is used (or first if d is negative).

Parameters:
  • pos_row (float) – cell position row

  • pos_col (float) – cell position col

Returns:

interpolated altitude

Return type:

float

init_min_max()[source]

initialize min/max at each dtm cell

intersect_dtm_cube(los)[source]

DTM cube intersection

Parameters:

los (numpy.array) – line of sight

Returns:

intersection information (an intersection has been found ?, (lon,lat) of dtm position, altitude, line of sight in index frame)

Return type:

tuple (bool, numpy.array, float, numpy.array)

intersection(los_index, point_b, h_intersect)[source]

DTM intersection

Parameters:
  • los_index (numpy.array) – line of sight in index frame

  • point_b (numpy.array) – position of intersection in DTM cube in index frame

  • h_intersect (float) – altitude in DTM cube

Returns:

intersection information (True,an intersection has been found ?, position of intersection)

Return type:

tuple (bool, numpy.array)

intersection_n_los_dtm(los)[source]

Compute intersection of los on dtm

Parameters:

los (numpy.ndarray 3D dimension with (points_nb,nb_alt,3) shape) – los extrema of los to intersect with dtm

Returns:

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

Return type:

numpy.ndarray 2D dimension with (points_nb,3) shape

get_alt_min()[source]
get_alt_max()[source]
get_epsg()[source]
get_transform()[source]