hvasbath / beat

Bayesian Earthquake Analysis Tool
GNU General Public License v3.0
128 stars 42 forks source link

Error: running QSSP with CRUST2 #22

Closed hvasbath closed 5 years ago

hvasbath commented 5 years ago

Transferred from personal mail from @fangjinSGG When I calculate seismic GF functions replacing the crust from the ak135 earth model with crust from the crust2 model based on QSSP backend, an error called "STOP Error: earth radius smaller than pre-defined! statement executed" is thrown out. I have no idea why it happened. The page (https://github.com/hvasbath/beat/commit/e359b98af45f338a04f6683b4cd13de10ade1880#diff-0a7529cc0f3035dcda0414a3cb4d0b06R1569) says that you have changed the qssp version to '2010beta' from '2010'. But I can't find the qssp2010beta version.

hvasbath commented 5 years ago

Thank you for reporting the issue! Please copy and paste a full error traceback otherwise it will be hard to help you. The QSSP commit is very old and has been reversed later. Please use the QSSP package here: https://github.com/pyrocko/fomosto-qssp

How did you enable the CRUST2.0 model? Setting the flag or did you modify it by hand? Did you try to run the tutorial or is it you own setup? You may also attach or copy paste your config file part under seismic_config so that I can inspect it.

fangjinSGG commented 5 years ago

Thanks a lot for your reply! I am exactly using the qssp2010 version now. I just try to run the tutorial and set the variable 'use_crust2' to true. The config file part under seismic_config is as follows: seismic_config: !beat.SeismicConfig datadir: /data3/jfang/My_beat/Laquila noise_estimator: !beat.SeismicNoiseAnalyserConfig structure: non-toeplitz pre_arrival_time: 10.0 pre_stack_cut: true station_corrections: true waveforms:

The error tracebacks are as follows now: config - INFO All parameter-priors ok! config - INFO All hyper-parameters ok! config - INFO All hierarchical-parameters ok! beat - INFO Creating Green's Function stores individually for each station! heart - INFO Using crust2 profile heart - INFO Station TSUM heart - INFO --------------------- heart - INFO Creating Store at /data3/jfang/BEATS/GF/TSUM_ak135_0.500Hz_0 heart - INFO Using crust2 profile heart - INFO Filling store ... pyrocko.gf.store - INFO making travel time table for phasegroup "any_P" pyrocko.spit - INFO at level 0: 100.0% covered, 1 cell pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 1 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 2 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 3 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 4 / 8 pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined! pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined! pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 2 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 4 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 1 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 3 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 5 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 6 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 7 / 8 pyrocko.fomosto.qssp - INFO Starting step 1 / 2, block 8 / 8 pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 7 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 6 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 5 / 8, wallclock time: 0 s pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - INFO Done with step 1 / 2, block 8 / 8, wallclock time: 1 s pyrocko.fomosto.qssp - INFO Starting step 2 / 2, block 1 / 8 pyrocko.fomosto.qssp - INFO Starting step 2 / 2, block 2 / 8 pyrocko.fomosto.qssp - INFO Starting step 2 / 2, block 3 / 8 pyrocko.fomosto.qssp - INFO Starting step 2 / 2, block 4 / 8 pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

pyrocko.fomosto.qssp - WARNING qssp emitted something via stderr:

STOP Error: earth radius smaller than pre-defined!

Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/parimap.py", line 26, in worker res = function(*args, kwargs) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/parimap.py", line 26, in worker res = function(*args, *kwargs) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/gf/builder.py", line 85, in __work_block builder.work_block(iblock) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 718, in work_block rawtraces = runner.get_traces() File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 542, in get_traces data = num.loadtxt(fn, skiprows=1, dtype=num.float) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/gf/builder.py", line 85, in __work_block builder.work_block(iblock) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 926, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 718, in work_block rawtraces = runner.get_traces() File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 262, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 542, in get_traces data = num.loadtxt(fn, skiprows=1, dtype=num.float) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 618, in open raise IOError("%s not found." % path) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 926, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 262, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/parimap.py", line 26, in worker res = function(args, kwargs) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 618, in open raise IOError("%s not found." % path) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/parimap.py", line 26, in worker res = function(*args, **kwargs) OSError: /tmp/qssprun-bkv0w6rj/receivers.ae not found. File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/gf/builder.py", line 85, in work_block builder.work_block(iblock) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/gf/builder.py", line 85, in work_block builder.work_block(iblock) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 718, in work_block rawtraces = runner.get_traces() File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 718, in work_block rawtraces = runner.get_traces() OSError: /tmp/qssprun-xyaja8d6/receivers.ae not found. File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 542, in get_traces data = num.loadtxt(fn, skiprows=1, dtype=num.float) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 542, in get_traces data = num.loadtxt(fn, skiprows=1, dtype=num.float) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 926, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 926, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 262, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 262, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 618, in open raise IOError("%s not found." % path) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 618, in open raise IOError("%s not found." % path) OSError: /tmp/qssprun-859timg8/receivers.ae not found. OSError: /tmp/qssprun-hl5q_ndz/receivers.ae not found. Traceback (most recent call last): File "/data3/jfang/.anaconda3/bin/beat", line 11, in load_entry_point('beat==1.0rc1', 'console_scripts', 'beat')() File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/beat-1.0rc1-py3.7-linux-x8664.egg/beat/apps/beat.py", line 1588, in main globals()['command' + command](args) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/beat-1.0rc1-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 993, in command_build_gfs force=options.force) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/beat-1.0rc1-py3.7-linux-x86_64.egg/beat/heart.py", line 1664, in seis_construct_gf store_dir, nworkers=sf.nworkers, force=force) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/fomosto/qssp.py", line 890, in build step=step, iblock=iblock) File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/gf/builder.py", line 166, in build Interrupted, store.StoreError)): File "/data3/jfang/.anaconda3/lib/python3.7/site-packages/pyrocko/parimap.py", line 136, in parimap raise exc OSError: /tmp/qssprun-xyaja8d6/receivers.ae not found.

It seems that the config file under $GF_path isn't the same as the input file in qssp2010 example. The former velocity model is only to a depth of 2892 km, but the latter one is up to the depth of 6371 km. I wonder whether this is the fatal problem. Thank you!

hvasbath commented 5 years ago

This was indeed a problem in the code. If QSSP is being used always the full velocity model needs to be specified from surface to centre of the earth. THis is fixed now in this commit: https://github.com/hvasbath/beat/commit/9b54b738d4152c4b103ea9e0dd1b9908d2a93df3. Please update to the latest master I tested it locally and it should also be working on your computer. Let me know in case you have problems! Good luck!

fangjinSGG commented 5 years ago

Thank you! It does work now.