Aim is to have a record of the entire NZGMDB process so it is clear on what exactly is being done.
CURRENTLY IN DRAFTING PHASE SO WILL BE RANDOM QUICK NOTES


Geonet Mseed Creation:

1: Downloads the recent earthquake data from geonet within the given date range
2: Only uses strong motion channel codes HN and BN for gettin the FDSN Client data
3: Loads the mw_rrup txt file and uses an interpolation function "cubic"

When fetching the event line for the source table
Gets the preferred_origin and magnitude from the event catalouge Geonet client
If the prefer_mag_type is m then gets all the event cat magnitudes and finds the max for mb ml and mlv
if there is one for mb and less than 3 station counts then find max station count for ml and mlv and compare station counts to determine the loc_mag, otherwise make it mb
If there is no mb then find max station count out of ml and mlv
If there if none of mb, ml or mlv then try m

Multiprocessing per event_id
Outputs the earthquake_source_table and station_magnitude_table

Tectonic Domain Addition:

Takes the earthquake source table as an input and a bunch of shape files with CMT and NZSMDB data
Updates each entry in the event_df if the same evid is found in the CMT data "GeoNet_CMT_solutions.csv". Updates the ["mag", "lat", "lon", "depth"], notifies in the mag-method to be CMT
Then merges the NZSMDB where the evid matches
Creates 3 region areas based on if the lat lon points are offshore to the fault, on the fault or downdip to the fault. With the Kermadec and Hikurangi and Puysegur datasets. d_s and d_d values of 10, 47, 11, 30 respectively
Regions are based on this 

df_a = df[(df.depth < d_s)]
df_b = df[(df.depth >= d_s) & (df.depth <= d_d)]
df_c = df[(df.depth > d_d)]

Then the regions are used with a horizontal and vertical threshold from each lat lon to each point on the region and depth to determine the tect class

    Region A (vertical prism offshore of seismogenic zone of fault plane):
    depth<60km: 'Outer rise'
    depth>=60km: 'Slab'

    Region B (vertical prism containing seismogenic zone of fault plane):
    depth<min(slab surface, 20km): 'Crustal'
    min(slab surface, 20km)>depth>60km: 'Interface'
    depth>60km: 'Slab'

    Region C (vertical prism downdip of the seismogenic zone of the fault plane):
    depth<30km: 'Crustal'
    30km<depth<slab surface: 'Undetermined'
    depth>slab surface: 'Slab'

    Elsewhere (Farfield):
    depth<30km: 'Crustal'
    depth>30km: 'Undetermined'

If the NZSMDB then has a tect_class defined for the given evid then it is replaced and the tect_method is set to be the NZSMDB.
Then the CMT is merged is there is data found from the CMT file on each evid
Then the domain is found based on the fact of if the lon lat is within the region from the layers in a shape, each has a number and a type associated with it. Uses the NZTM coordinate system.

Phase_arrival:

p wave picker and a gen phase arrival for creating the table needed for output csv
Need to add in the phase arrival information from geonet
Not sure about t_res - This can be just there for applicable data and removed for custom p picker
If there is a clash with the Geonet P wave and the custom picker then choose the custom picker
arid can be removed
channel needs to be more generic and just first 2 characters

  • No labels