ut-beg-texnet / NonLinLoc

Probabilistic, Non-Linear, Global-Search Earthquake Location in 3D Media
http://www.alomax.net/nlloc/docs
GNU General Public License v3.0
90 stars 32 forks source link

LOCTOPO_SURFACE has no effect #40

Open lvanderlaat opened 9 months ago

lvanderlaat commented 9 months ago

I'm trying to mask my grid using the topography.

In my input file:

LOCTOPO_SURFACE top.xyz 0

And in top.xyz I have latitude, longitude and elevation, for example:

10.19582275 -84.21855231    2470
10.19591327 -84.21853137    2470
10.19612425 -84.21833775    2470

This has no effect, am I missing something?

alomax commented 9 months ago

The format for a topo grid is pretty complicated because it is a GMT format which is pretty complicated and also because GMT is a moving target with each version! https://www.generic-mapping-tools.org/

Some doc:

# LOCTOPO_SURFACE - Topographic mask for location search region
# optional, non-repeatable
# Syntax 1: LOCTOPO_SURFACE gmtGrdFile flagDumpDecimation
# Uses a topographic surface file in GMT grid2xyz ascii or binary format to mask prior search volume to the half-space below the topography.
#
#    gmtGrdFile (string) path and file name of a GMT grid2xyz ascii (*.asc) or binary (*.bin and *.bin.hdr) file(s) defining the topographic surface in coordinates lat(deg)/long(deg)/elev(m)
#    flagDumpDecimation (integer) if flagDumpDecimation > 0 write surface data to x-y-z-elev file using decimation factor flagDumpDecimation . Output file is in NLL Scatter file format; this format can be plotted in SeismicityViewer.
#
# Note: To convert topo.grd to GMT ascii grid format, use:
#        grdinfo topo.grd > topo.grd.asc
#        grd2xyz topo.grd -Z >> topo.grd.asc
# Note: To convert topo.grd to GMT binary grid format, use:
#        grdinfo topo.grd > topo.grd.bin.hdr
#        grd2xyz topo.grd -ZTLd > topo.grd.bin

and an example that works for me with:

LOCTOPO_SURFACE ./topo/Texas_800mGrid.grd.asc  0
Texas_800mGrid.grd: Title: Produced by grdcut
Texas_800mGrid.grd: Command: grdcut -V -R-110/-90/20/40 North_farWest.grd -GTexas_800mGrid.grd
Texas_800mGrid.grd: Remark: 
Texas_800mGrid.grd: Pixel node registration used [Cartesian grid]
Texas_800mGrid.grd: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
Texas_800mGrid.grd: x_min: -110 x_max: -90 x_inc: 0.00833333333333 name: user_x_unit nx: 2400
Texas_800mGrid.grd: y_min: 20 y_max: 40 y_inc: 0.00833333333333 name: user_y_unit ny: 2400
Texas_800mGrid.grd: z_min: -4496.05566406 z_max: 4328 name: user_z_unit
Texas_800mGrid.grd: scale_factor: 1 add_offset: 0
Texas_800mGrid.grd: format: netCDF-4 chunk_size: 134,134 shuffle: on deflation_level: 3
1630
1619
1618
1613
1607
1603
...