BAD_REQUEST, beat sample --hypers
rzinke opened this issue · comments
Hello,
I have successfully installed BEAT on another machine, and Examples 3 and 4 turned out beautifully. I am now trying to perform a RectangularSource inversion for my own data.
I have processed two InSAR scenes (one ascending, one descending) for a medium-sized earthquake in central Tibet. Because of the remote location of the earthquake, I am trying to do the inversion using only geodetic (InSAR) data.
I prepared the scenes using Kite and its quadtree approach. I initialized the project with:
beat init Xizang 2020-07-22 --datatypes=geodetic --n_sources=1 --source_type=RectangularSource --min_mag=6.2
This gave me a large EQ in Alaska, and the central Tibet event that I am interested in. In the config_geometry.yaml file I replaced the pre-loaded Alaska event with the Xizang, Tibet info. I then set the data directory and Green's Function directory and did:
beat update Xizang
It gave me the message that the covariances had not been calculated, then calculated them. Next I gave:
beat build_gfs Xizang --datatypes=geodetic
beat build_gfs Xizang --force --execute
It successfully build the Green's Functions, and displayed: "beat - INFO geodetic GF calculations successful!"
I did:
beat update Xizang --parameters='hierarchicals,hypers'
It gave the OK for the parameters (1 hyperparameter, 0 hierarchicals). So next I did:
beat sample Xizang --hypers
and it gave the following error:
(pyrocko) rzinke@mpzinke-ubuntu:~/Titan/Projects/Xizang/BeatTest1$ beat sample Xizang --hypers
config - INFO All hierarchicals ok!
config - INFO All hyperparameters ok!
config - INFO All priors ok!
models - INFO ... Initialising Geometry Optimizer ...
models - INFO Analysing problem ...
models - INFO ---------------------
geodetic - INFO Number of geodetic datasets: 2
geodetic - INFO Number of geodetic data points: 233
geodetic - WARNING Covariance estimation not implemented (yet)! Using imported covariances!
models - INFO ... Building Hyper model ...
geodetic - INFO Initialized 0 hierarchical parameters (ramps).
models - INFO Optimization for 1 hyperparameters in total!
Traceback (most recent call last):
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/bin/beat", line 33, in <module>
sys.exit(load_entry_point('beat==1.0', 'console_scripts', 'beat')())
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/apps/beat.py", line 1686, in main
globals()['command_' + command](args)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/apps/beat.py", line 768, in command_sample
project_dir, options.mode, options.hypers)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/models/problems.py", line 842, in load_model
problem.built_hyper_model()
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/models/problems.py", line 280, in built_hyper_model
composite.update_llks(point)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/models/geodetic.py", line 322, in update_llks
results = self.assemble_results(point)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/models/geodetic.py", line 190, in assemble_results
processed_synts = self.get_synthetics(point, outmode='stacked_arrays')
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/models/geodetic.py", line 479, in get_synthetics
**kwargs)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/beat-1.0-py3.6-linux-x86_64.egg/beat/heart.py", line 2873, in geo_synthetics
response = engine.process(sources, targets)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/pyrocko/gf/seismosizer.py", line 3577, in process
nthreads=nthreads):
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/pyrocko/gf/seismosizer.py", line 3086, in process_static
source, target, components, nthreads)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/pyrocko/gf/seismosizer.py", line 3423, in base_statics
nthreads)
File "/home/rzinke/Miniconda/miniconda3/envs/pyrocko/lib/python3.6/site-packages/pyrocko/gf/store.py", line 1888, in statics
nthreads)
pyrocko.gf.store_ext.StoreExtError: BAD_REQUEST
I reran the build_gfs commands and checked that the stores are empty. I searched the issues page and did not find an answer to this issue. I'm happy to provide any information if you can help me solve it!
Thanks!
This very likely due to the calculated gf_store not having source depths or distances calculated which you try to request with your source.
For example your store is calculated for sources locations down to 20km but your source sample is at 10km depth with a source width of 25km and a dip of 90°. Also possible is that the source length is longer than the distances you calculated.
So please check consistency of your maximum source parameters with the gf store config.
First I am glad that you finally managed to get everything running! @braunfuss told already what the issue is.
I just wanted to make you also aware of the FAQ you should always check when issues occur:
https://hvasbath.github.io/beat/faq.html
Here your issue is under 5.
Hi @braunfuss and @hvasbath. Thank you for the tips! But I am still getting the same error...
In the config_geometry.yaml file, I set my priors:
depth: 0 - 10 (testvalue: 5) km
width: 5 - 20 (testvalue: 9) km
length: 5 - 25 (testvalue: 12) km
Under gf_config, I have:
reference_model_idx: 0
n_variations:
- 0
- 1
earth_model_name: ak135-f-continental.m
nworkers: 1
use_crust2: false
replace_water: false
source_depth_min: 0.0
source_depth_max: 45.0
source_depth_spacing: 1.0
source_distance_radius: 120.0
source_distance_spacing: 1.0
error_depth: 0.1
error_velocities: 0.1
depth_limit_variation: 600.0
code: psgrn
sample_rate: 1.1574074074074073e-05
sampling_interval: 1.0
medium_depth_spacing: 1.0
medium_distance_spacing: 1.0
So the maximum depth should be: 10 + 20 = 30 km
Considering my east and north shift of +- 10 km, the maximum distance should be: 25 + root2 (10) = 40 km
My source_depth_max and source_distance_radius should cover those ranges.
After adjusting my parameters, I ran:
beat build_gfs Xizang --datatypes=geodetic --force --execute
This produces more blocks than before (now 46 blocks). The GF calculation finishes successfully, so I run:
beat update Xizang --parameters='hierarchicals,hypers'
beat sample Xizang --hypers
And still the same error appears.
I am attaching my config_geometry.yaml ( > .txt) since it sounds like the problem still lies there.
Whats the maximum distance of your InSAR pixel (likely in a corner) to your furthest part of the source- likely in the other corner.
With current Sentinel1 data which has a subswathwidth of what? 100km with over lap and all swaths together 250km- so thats the distances you need to extent your GF store to ... maybe less maybe more depending on your data- source configuration.
That was it. The InSAR data extend for > 150 km in some corners. I set the source_distance_radius to 200 km and it ran perfectly. Thanks for the help!
I am glad it works now!