model.location

class Location(**kwargs)[source]

Geographical location.

The location is given by a reference point at the earth’s surface (lat, lon, elevation) and a cartesian offset from this point (north_shift, east_shift, depth). The offset corrected lat/lon coordinates of the location can be accessed though the effective_latlon, effective_lat, and effective_lon properties.

lat

float, optional, default: 0.0

latitude of reference point [deg]

lon

float, optional, default: 0.0

longitude of reference point [deg]

north_shift

float, optional, default: 0.0

northward cartesian offset from reference point [m]

east_shift

float, optional, default: 0.0

eastward cartesian offset from reference point [m]

elevation

float, optional, default: 0.0

surface elevation, above sea level [m]

depth

float, default: 0.0

depth, below surface [m]

effective_latlon

Property holding the offset-corrected lat/lon pair of the location.

effective_lat

Property holding the offset-corrected latitude of the location.

effective_lon

Property holding the offset-corrected longitude of the location.

same_origin(other)[source]

Check whether other location object has the same reference location.

distance_to(other)[source]

Compute surface distance [m] to other location object.

Parameters:other (Location) – Other location.
Returns:Distance to another location in [m].
Return type:float
distance_3d_to(other)[source]

Compute 3D distance [m] to other location object.

All coordinates are transformed to cartesian coordinates if necessary then distance is:

\Delta = \sqrt{\Delta {\bf x}^2 + \Delta {\bf y}^2 +                       \Delta {\bf z}^2}

Parameters:other (Location) – Other location.
Returns:3D distance to another location in [m].
Return type:float
crosstrack_distance_to(path_begin, path_end)[source]

Compute distance to a great-circle arc.

Parameters:
  • path_begin (Location) – Location of the start of the arc.
  • path_end (Location) – Location of the end of the arc.
Returns:

Distance to a great circle arc in [deg].

Return type:

float

alongtrack_distance_to(path_begin, path_end, meter=False)[source]

Compute distance along a great-circle arc.

Parameters:
  • path_begin (Location) – Location of the start of the arc.
  • path_end (Location) – Location of the end of the arc.
  • meter – Return [m] instead of [deg].
Returns:

Distance from the start of the great circle arc in [deg] or [m].

Return type:

float

azibazi_to(other)[source]

Compute azimuth and backazimuth to and from other location object.

Parameters:other (Location) – Other location.
Returns:Azimuth and back-azimuth to the location in [deg].
Return type:tuple[float, float]
filter_azimuths(locations, center, azimuth, azimuth_width)[source]

Filter locations by azimuth swath from a center location.

Parameters:
  • locations:ocation]) – List of Locations.
  • center (Location) – Relative center location.
  • azimuth (float) – Azimuth in [deg]. -180 to 180 or 0 to 360.
  • azimuth_width (float) – Width of the swath.
Returns:

Filtered locations.

Return type:

list[Location]

filter_distance(locations, reference, distance_min, distance_max)[source]

Filter location by distance to a reference point.

Parameters:
  • locations (list) – Locations to filter.
  • reference (Location) – Reference location.
  • distance_min (float) – Minimum distance in [m].
  • distance_max (float) – Maximum distance in [m].
Returns:

Filtered locations.

Return type:

list[Location]

filter_crosstrack_distance(locations, start_path, end_path, distance_max)[source]

Filter location by distance to a great-circle path.

Parameters:
  • locations (list) – Locations to filter.
  • start_path (Location) – Start of the great circle path.
  • end_path (Location) – End of the great circle path.
  • distance_max (float) – Distance to the great-circle in [deg].
Returns:

Filtered locations.

Return type:

list[Location]