pyatoa.utils.srcrcv
Functions used in determining information related to sources and receivers, or their corresponding representations in ObsPy
Module Contents
Functions
|
Convert latitude and longitude coordinates to UTM projection using PyProj |
|
Calculate the UTM zone longitude value using quick maffs. |
|
Calculate great circle distance and backazimuth values for a given |
|
Adding inventories together duplicates network and station codes, which is |
|
Dynamically determine the length of the seismogram based on source-receiver |
|
Its illustrative to show misfit information for an event, sorted by |
|
Sort through an obspy catalog by interevent distance. If we have a lot of |
- pyatoa.utils.srcrcv.lonlat_utm(lon_or_x, lat_or_y, utm_zone=None, inverse=False)[source]
Convert latitude and longitude coordinates to UTM projection using PyProj
- Parameters:
- Return type:
- Returns:
(x in UTM or longitude in WGS84, y in UTM or latitude in WGS84)
- pyatoa.utils.srcrcv.utm_zone_from_lat_lon(lat, lon)[source]
Calculate the UTM zone longitude value using quick maffs. Get the sign of the UTM zone based on the latitude value.
- pyatoa.utils.srcrcv.gcd_and_baz(event, sta)[source]
Calculate great circle distance and backazimuth values for a given station and event configuration
- pyatoa.utils.srcrcv.merge_inventories(inv_a, inv_b)[source]
Adding inventories together duplicates network and station codes, which is kind of annoying for looping. This function will add two inventories together while minimizing the amount of redundant networks, stations, channels inside the merged inventory.
- Parameters:
inv_a (obspy.core.inventory.Inventory) – inventory to merge into, will be returned
inv_b (obspy.core.inventory.Inventory) – inventory to merge into inv_a
- Return type:
obspy.core.inventory.Inventory
- Returns:
merged inventories
- pyatoa.utils.srcrcv.seismogram_length(distance_km, slow_wavespeed_km_s=2, binsize=50, minimum_length=100)[source]
Dynamically determine the length of the seismogram based on source-receiver distance. Bin into lengths to keep some uniformity in window lengths
- Parameters:
- Return type:
- Returns:
expected seismogram length
- pyatoa.utils.srcrcv.sort_by_backazimuth(ds, clockwise=True)[source]
Its illustrative to show misfit information for an event, sorted by backazimuth. Stations with misfit information are generally sorted alphabetically, so this function just calcualtes backazimuth and returns a sorted list of station names. Can go clockwise or counter clockwise, starting from 0 degrees.
- pyatoa.utils.srcrcv.event_by_distance(cat, filter_type=False, filter_bounds=None, random=False)[source]
Sort through an obspy catalog by interevent distance. If we have a lot of events in a catalog, it’s best to spatially vary them such that we don’t redundantly oversample a spatial region. Returns an index list for events that are most distant from one another, without repeating any used events.
Catalog filter parameters can be found here: https://docs.obspy.org/packages/autogen/obspy.core.event.Catalog.filter.html
- Parameters:
- Return type:
obspy.event.Catalog
- Returns:
filtered catalog object