tiebenn.tools.nonlinloc module
- tiebenn.tools.nonlinloc.create3dgrid(ev_lon, ev_lat, velmod)[source]
This function uses NLLGrid (https://github.com/claudiodsf/nllgrid) to transform 3D velocity descriptions (e.g. the Crust1 model, which is implemented in Tiebenn) into a 3D SLOW_LEN grid for the calculation of travel times with NonLinLoc. Assumption: 1° equals 111 km.
- Parameters:
ev_lon (float) – Longitude of the located event with AD-Detektor
ev_lat (float) – Latitude of the located event with AD-Detektor
velmod (int) – The seismic velocity model to be used in NonLinLoc for hypocentre location. See current options in velmods
- Returns:
The 3D SLOW_LEN grids for P- and S-wave velocities
- Return type:
model_layer.(P/S).mod(.hdr/.buf)
- tiebenn.tools.nonlinloc.extract_3d_velmod(model_name, workdir)[source]
Creates a temporary directory with 3D velocity models copied from Tiebenn’s resources.
- Parameters:
model_name (str) – Name of velocity model (e.g.: ‘diehl’, ‘lengline’, ‘weg’)
workdir (pathlib.Path)
- Returns:
Path with the copied 3D velocity model files
- Return type:
dest (path)
- tiebenn.tools.nonlinloc.inp_files_nlloc_sb(ev_lon, ev_lat, ev_time, data, nll3d, velmod, min_detections=3, verbosity=0)[source]
Prepares the input files required by NonLinLoc for a successfully detected event with SeisBench.
- Parameters:
ev_lon (float) – Longitude of the located event with AD-Detektor
ev_lat (float) – Latitude of the located event with AD-Detektor
ev_time (str) – Origin time of the event. Format: yyyy-mm-dd hh:mm:ss.ss
data (dict) – A dictionary with information about the stations with picks
nll3d (bool) – If True, it will prepare the control files for a NonLinLoc depth estimation with a 3D velocity grid
velmod (int) – The seismic velocity model to be used in NonLinLoc for hypocentre location. See current options in velocity_models.py
min_detections (int) – It will define the minimum amount of stations on which the event was detected. If this minimum amount of detections is not achieved, the code will exit without calculating the hypocenter if the required minimum is not achieved. Value must be >= 3. Default = 3
verbosity (int) – Verbosity level of NonLinLoc. Possible options are -1 (silent), 0 (errors only), 1 (higher level warnings), >= 2 (low level warnings + information). Default is 0
- Returns:
text file with information about all the stations with seismic detections following the GTSRCE/LATLON syntax obs_ttimes.obs: text file with the detected arrival times following the LOCFILES/NLLOC_OBS syntax nlloc_control.in: text file with the parameters for execution of NonLinLoc. A full description of each parameter can be found in https://github.com/alomax/NonLinLoc/blob/master/nlloc_sample/run/nlloc_sample.in nlloc_control_s.in: text file with the parameters for execution of Grid2Time for S-waves
- Return type:
station_coordinates.txt
- tiebenn.tools.nonlinloc.pynlloc(control_file, control_file_s, data, velmod, nll3d, plots)[source]
It runs the necessary executables for hypocenter estimation using NonLinLoc: Vel2Grid, Grid2Time and NLLoc.
- Parameters:
control_file (str) – the complete path and filename for the input control file with certain required and optional statements specifying program parameters and input/output file names and locations. These parameters and files are used to execute NonLinLoc
control_file_s (str) – the portion of the control file with the required statements, parameters and file locations for the execution of Grid2Time for S-waves. In the current version of NonLinLoc, the generation of traveltimes is under a non-repeatable parameter (GTFILES). As a consecuence, Grid2Time must be executed twice for generation of P- and S-wave traveltimes. Changing GTFILES to repeatable is as of September 2024 in the to-do list of the author A. Lomax (pers. commun.)
velmod (int) – The seismic velocity model to be used in NonLinLoc for hypocentre location. See current options in velmods.py
data (dict) – Dictionary with information of seismic stations
nll3d (bool) – If True, it will skip the execution of Vel2Grid
plots (bool) – if True, it will plot the epicenter with the stations used for location, if the location was sucessful
- Returns:
here are the location and quality, statistical values in case the location was sucessful epicenter_stations.pdf: map depicting the epicenter location on the map, alongside the stations with phase picks used by NonLinLoc for depth estimation
- Return type:
event_location.NLL