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 theeffective_latlon
,effective_lat
, andeffective_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.
-
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:
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: Returns: Distance to a great circle arc in [deg].
Return type:
-
♦
-
filter_azimuths
(locations: list, center: pyrocko.model.location.Location, azimuth: float, azimuth_width: float) → list[source]¶ Filter locations by azimuth swath.
- Args:
- locations (list[Location]): 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:
- list[Location]: Filtered locations.
-
filter_distance
(locations: list, reference: pyrocko.model.location.Location, distance_min: float, distance_max: float) → list[source]¶ Filter location by distance to a reference point.
- Args:
- locations (list[Location]): Locations to filter. reference (Location): Reference location. distance_min (float): Minimum distance in [m]. distance_max (float): Maximum distance in [m].
- Returns:
- list[Location]: Filtered locations.
-
filter_crosstrack_distance
(locations: list, start_path: pyrocko.model.location.Location, end_path: pyrocko.model.location.Location, distance_max: float) → list[source]¶ Filter location by distance to a great-circle path.
- Args:
- locations (list[Location]): 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:
- list[Location]: Filtered locations.