hvasbath / beat

Bayesian Earthquake Analysis Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyrocko.gf.store_ext.StoreExtError: INDEX_OUT_OF_BOUNDS

sxyzy1016 opened this issue · comments

Hi there,

I was trying to calculate the geometry Rec-source using geodetic InSAR data as a practice. I was just following the Example 3 Laquila in the document but without waveform data and just geodetic data.

What I did was:

  1. beat init some_proj
  2. modified the yaml config, and beat import some_proj, and geodetic_data.pkl was created succefully.
  3. beat build_gfs some_proj --datatypes=geodetic and beat build_gfs some_proj --force --execute, and everything seems ok.
  4. modified the yaml config, then beat some_proj --parameters="hierarchicals,hypers"

And then in the follow step beat sample turkey2023 --hypers I run into pyrocko.gf.store_ext.StoreExtError: INDEX_OUT_OF_BOUNDS. The full trace is here:

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: 1
geodetic     - INFO     Number of geodetic data points: 1273
geodetic     - INFO     Initialising corrections ...
heart        - INFO     Setting up Ramps correction for insar6_2
heart        - INFO     Not correcting insar6_2 for Euler Pole
heart        - INFO     Not correcting insar6_2 for Strain Rate
models       - INFO     ... Building Hyper model ...

geodetic     - INFO     Evaluating config for Ramps corrections for datasets...
geodetic     - INFO     Evaluating config for Euler Pole corrections for datasets...
geodetic     - INFO     No Euler Pole correction!
geodetic     - INFO     Evaluating config for Strain Rate corrections for datasets...
geodetic     - INFO     No Strain Rate correction!
geodetic     - INFO     Initialized 3 hierarchical parameters.
models       - INFO     Initialised hyperparameter h_SAR with size 1
models       - INFO     Optimization for 1 hyperparameters in total!
geodetic     - INFO     Retrieving geodetic data-covariances with structure "import" for insar6_2 ...
Traceback (most recent call last):
  File "/home/sxyzy/.conda/envs/beat/bin/beat", line 33, in <module>
    sys.exit(load_entry_point('beat==1.2.5', 'console_scripts', 'beat')())
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 2408, in main
    globals()["command_" + command](args)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 1027, in command_sample
    problem = load_model(project_dir, options.mode, options.hypers)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/models/problems.py", line 947, in load_model
    problem.built_hyper_model()
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/models/problems.py", line 295, in built_hyper_model
    composite.update_llks(point)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/models/geodetic.py", line 462, in update_llks
    results = self.assemble_results(point)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/models/geodetic.py", line 224, in assemble_results
    processed_synts = self.get_synthetics(point, outmode="stacked_arrays")
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/models/geodetic.py", line 740, in get_synthetics
    engine=self.engine, targets=self.targets, sources=self.sources, **kwargs
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/beat-1.2.5-py3.7-linux-x86_64.egg/beat/heart.py", line 4270, in geo_synthetics
    response = engine.process(sources, targets)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/pyrocko/gf/seismosizer.py", line 5470, in process
    nthreads=nthreads):
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/pyrocko/gf/seismosizer.py", line 4972, in process_static
    source, target, components, nthreads)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/pyrocko/gf/seismosizer.py", line 5315, in base_statics
    nthreads)
  File "/home/sxyzy/.conda/envs/beat/lib/python3.7/site-packages/pyrocko/gf/store.py", line 2084, in statics
    nthreads)
pyrocko.gf.store_ext.StoreExtError: INDEX_OUT_OF_BOUNDS

I thought it was a problem of my data format, so I compared my geodetic_data.pkl with the example 3 in spyder, but I got no idea.

I am newbie to this study area. Really need your help... OTL

The final config yaml used in this step was:

--- !beat.BEATconfig
name: turkey2023
date: dummy
event: !pf.Event
  time: '1970-01-01 00:00:00'
  depth: 10000.0
project_dir: /mnt/d/Proj/Coulomb/turkey2023/turkey2023
problem_config: !beat.ProblemConfig
  mode: geometry
  source_type: RectangularSource
  stf_type: HalfSinusoid
  decimation_factors:
    geodetic: 4
  n_sources: 1
  datatypes:
  - geodetic
  hyperparameters:
    h_SAR: !beat.heart.Parameter
      name: h_SAR
      form: Uniform
      lower:
      - -2.0
      upper:
      - 6.0
      testvalue:
      - 2.0
  priors:
    depth: !beat.heart.Parameter
      name: depth
      form: Uniform
      lower:
      - 0.0
      upper:
      - 10.0
      testvalue:
      - 1.0
    dip: !beat.heart.Parameter
      name: dip
      form: Uniform
      lower:
      - 45.0
      upper:
      - 90.0
      testvalue:
      - 63.0
    east_shift: !beat.heart.Parameter
      name: east_shift
      form: Uniform
      lower:
      - -10.0
      upper:
      - 10.0
      testvalue:
      - -8.0
    length: !beat.heart.Parameter
      name: length
      form: Uniform
      lower:
      - 5.0
      upper:
      - 30.0
      testvalue:
      - 11.0
    north_shift: !beat.heart.Parameter
      name: north_shift
      form: Uniform
      lower:
      - -10.0
      upper:
      - 10.0
      testvalue:
      - -8.0
    opening_fraction: !beat.heart.Parameter
      name: opening_fraction
      form: Uniform
      lower:
      - 0.0
      upper:
      - 0.0
      testvalue:
      - 0.0
    rake: !beat.heart.Parameter
      name: rake
      form: Uniform
      lower:
      - -90.0
      upper:
      - 90.0
      testvalue:
      - -72.0
    slip: !beat.heart.Parameter
      name: slip
      form: Uniform
      lower:
      - 0.1
      upper:
      - 8.0
      testvalue:
      - 1.7000000000000002
    strike: !beat.heart.Parameter
      name: strike
      form: Uniform
      lower:
      - 0.0
      upper:
      - 180.0
      testvalue:
      - 36.0
    width: !beat.heart.Parameter
      name: width
      form: Uniform
      lower:
      - 5.0
      upper:
      - 20.0
      testvalue:
      - 9.0
  hierarchicals:
    insar6_2_azimuth_ramp: !beat.heart.Parameter
      name: insar6_2_azimuth_ramp
      form: Uniform
      lower:
      - -0.005
      upper:
      - 0.005
      testvalue:
      - 0.0
    insar6_2_offset: !beat.heart.Parameter
      name: insar6_2_offset
      form: Uniform
      lower:
      - -0.05
      upper:
      - 0.05
      testvalue:
      - 0.0
    insar6_2_range_ramp: !beat.heart.Parameter
      name: insar6_2_range_ramp
      form: Uniform
      lower:
      - -0.005
      upper:
      - 0.005
      testvalue:
      - 0.0
geodetic_config: !beat.GeodeticConfig
  types:
    SAR: !beat.SARDatasetConfig
      datadir: /mnt/d/Proj/Coulomb/turkey2023/insar6/merged
      names:
      - insar6_2
  noise_estimator: !beat.GeodeticNoiseAnalyserConfig
    structure: import
    max_dist_perc: 0.2
  interpolation: multilinear
  corrections_config: !beat.GeodeticCorrectionsConfig
    euler_poles:
    - !beat.EulerPoleConfig
      enabled: false
    ramp: !beat.RampConfig
      dataset_names:
      - insar6_2
      enabled: true
    strain_rates:
    - !beat.StrainRateConfig
      enabled: false
  dataset_specific_residual_noise_estimation: false
  gf_config: !beat.GeodeticGFConfig
    store_superdir: /mnt/d/Proj/Coulomb/turkey2023/turkey2023/BEAT
    reference_model_idx: 0
    n_variations:
    - 0
    - 1
    earth_model_name: ak135-f-continental.f
    nworkers: 20
    use_crust2: false
    replace_water: false
    source_depth_min: 0.0
    source_depth_max: 10.0
    source_depth_spacing: 1.0
    source_distance_radius: 100.0
    source_distance_spacing: 1.0
    error_depth: 0.1
    error_velocities: 0.1
    depth_limit_variation: 600.0
    version: ''
    code: psgrn
    sample_rate: 1.1574074074074073e-05
    sampling_interval: 1.0
    medium_depth_spacing: 1.0
    medium_distance_spacing: 10.0
sampler_config: !beat.SamplerConfig
  name: SMC
  backend: csv
  progressbar: true
  buffer_size: 5000
  buffer_thinning: 1
  parameters: !beat.SMCConfig
    tune_interval: 50
    check_bnd: true
    rm_flag: false
    n_jobs: 10
    n_steps: 100
    n_chains: 1000
    coef_variation: 1.0
    stage: 0
    proposal_dist: MultivariateNormal
    update_covariances: false
hyper_sampler_config: !beat.SamplerConfig
  name: Metropolis
  backend: csv
  progressbar: true
  buffer_size: 5000
  buffer_thinning: 1
  parameters: !beat.MetropolisConfig
    tune_interval: 50
    proposal_dist: Normal
    check_bnd: true
    rm_flag: false
    n_jobs: 10
    n_steps: 25000
    n_chains: 20
    thin: 2
    burn: 0.5

Hi! Please see BEAT FAQ here: https://pyrocko.org/beat/docs/current/faq.html
Your issues is number 5/6, which are the same but for different data types. From what I can see in your case - it is at least the deoth grid, so please increase source_depth_max to at least 30km, better give a little buffer maybe 35km. Depending on your data and the distance of your furthest data point to the source, you may also need to increase source_distance_radius. Up and better higher than the longest distance.
Cheers! Hannes

Hi!

Thanks a lot for your advice. And sorry for my late response.

I tried lots of times these days, increasing source_depth_max and source_distance_radius, even an extremly high value like 300 and 1000, but the issue still occured. The INDEX_OUT_OF_BOUNDS poped up immediately after the log geodetic - INFO Retrieving geodetic data-covariances with structure "import" for insar6_2.

I also tried decreasing the upper value of depth in the prior, but no help.

And my InSAR deformation data is like:

image

Please see the last two sentences of my previous response.

Please re-open in case issue still exists.