hvasbath / beat

Bayesian Earthquake Analysis Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when running beat sample Laquila

ranneylxr opened this issue · comments

Hi,
I meet this error when I running the Scnario 3: Rectangular source.
Before I ran beat sample Laquila, I ran: beat update Laquila --parameters="hierarchicals" , beat update Laquila --parameters="hypers" and beat sample Laquila --hypers. And then I changed n_jobs in sampler_config to 50.
The error message is:
backend - INFO Loading multitrace from /data/lxrtest/insarlab/BEAT/Laquila/geometry/trans_stage_5
smc - INFO Beta: 0.015582 Stage: 6
backend - INFO Loading multitrace from /data/lxrtest/insarlab/BEAT/Laquila/geometry/stage_6
Traceback (most recent call last):
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/bin/beat", line 11, in
load_entry_point('beat==1.0', 'console_scripts', 'beat')()
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.0-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 1688, in main
globals()'command_' + command
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.0-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 777, in command_sample
sample(step, problem)
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.0-py3.7-linux-x86_64.egg/beat/models/base.py", line 176, in sample
rm_flag=pa.rm_flag)
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.0-py3.7-linux-x86_64.egg/beat/sampler/smc.py", line 460, in smc_sample
step.select_end_points(mtrace)
File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.0-py3.7-linux-x86_64.egg/beat/sampler/smc.py", line 210, in select_end_points
array_population[:, slc] = slc_population0/1 [00:00<?, ?it/s]
ValueError: could not broadcast input array from shape (902,1) into shape (1000,1)

And my config_geometry.yaml file is:
name: /data/lxrtest/insarlab/BEAT/Laquila
date: '2009-04-06'
event: !pf.Event
lat: 42.29
lon: 13.35
time: 2009-04-06 01:32:49.190000
depth: 12000.0
name: '200904060132A'
magnitude: 6.343080192483292
region: 'CENTRAL ITALY'
catalog: 'gCMT'
moment_tensor: !pf.MomentTensor
mnn: 1.43e+18
mee: 1.87e+18
mdd: -3.3e+18
mne: 1.77e+18
mnd: -1.43e+18
med: 2.6900000000000003e+17
strike1: 120.23408298515041
dip1: 54.240869089580485
rake1: -112.81739742081386
strike2: 335.98575923255856
dip2: 41.58440373860804
rake2: -61.69749587601104
moment: 3.6696131948749036e+18
magnitude: 6.343080192483292
duration: 7.0
project_dir: /data/lxrtest/insarlab/BEAT/Laquila
problem_config: !beat.ProblemConfig
mode: geometry
source_type: RectangularSource
stf_type: HalfSinusoid
decimation_factors:
geodetic: 4
seismic: 1
n_sources: 1
datatypes:

  • geodetic
    hyperparameters:
    h_SAR: !beat.heart.Parameter
    name: h_SAR
    form: Uniform
    lower:
    • 0.0
      upper:
    • 5.0
      testvalue:
    • 2.5
      priors:
      depth: !beat.heart.Parameter
      name: depth
      form: Uniform
      lower:
    • 0.0
      upper:
    • 5.0
      testvalue:
    • 2.95
      dip: !beat.heart.Parameter
      name: dip
      form: Uniform
      lower:
    • 35.0
      upper:
    • 65.0
      testvalue:
    • 59.46
      east_shift: !beat.heart.Parameter
      name: east_shift
      form: Uniform
      lower:
    • -5.0
      upper:
    • 20.0
      testvalue:
    • 10.64
      length: !beat.heart.Parameter
      name: length
      form: Uniform
      lower:
    • 5.0
      upper:
    • 25.0
      testvalue:
    • 12.4
      north_shift: !beat.heart.Parameter
      name: north_shift
      form: Uniform
      lower:
    • -15.0
      upper:
    • 10.0
      testvalue:
    • 5.624
      nucleation_x: !beat.heart.Parameter
      name: nucleation_x
      form: Uniform
      lower:
    • -1.0
      upper:
    • 1.0
      testvalue:
    • -0.94
      nucleation_y: !beat.heart.Parameter
      name: nucleation_y
      form: Uniform
      lower:
    • -1.0
      upper:
    • 1.0
      testvalue:
    • -0.09508065
      rake: !beat.heart.Parameter
      name: rake
      form: Uniform
      lower:
    • -180.0
      upper:
    • 0.0
      testvalue:
    • -125.0
      slip: !beat.heart.Parameter
      name: slip
      form: Uniform
      lower:
    • 0.1
      upper:
    • 1.0
      testvalue:
    • 0.634
      strike: !beat.heart.Parameter
      name: strike
      form: Uniform
      lower:
    • 60.0
      upper:
    • 180.0
      testvalue:
    • 143.0
      time: !beat.heart.Parameter
      name: time
      form: Uniform
      lower:
    • -20.0
      upper:
    • 10.0
      testvalue:
    • -10.0
      width: !beat.heart.Parameter
      name: width
      form: Uniform
      lower:
    • 5.0
      upper:
    • 20.0
      testvalue:
    • 10.0
      hierarchicals:
      Laquila_ascxn_offset: !beat.heart.Parameter
      name: Laquila_ascxn_offset
      form: Uniform
      lower:
    • -0.05
      upper:
    • 0.05
      testvalue:
    • 0.0
      Laquila_ascxn_ramp: !beat.heart.Parameter
      name: Laquila_ascxn_ramp
      form: Uniform
      lower:
    • -0.005
    • -0.005
      upper:
    • 0.005
    • 0.005
      testvalue:
    • 0.0
    • 0.0
      Laquila_dscxn_offset: !beat.heart.Parameter
      name: Laquila_dscxn_offset
      form: Uniform
      lower:
    • -0.05
      upper:
    • 0.05
      testvalue:
    • 0.0
      Laquila_dscxn_ramp: !beat.heart.Parameter
      name: Laquila_dscxn_ramp
      form: Uniform
      lower:
    • -0.005
    • -0.005
      upper:
    • 0.005
    • 0.005
      testvalue:
    • 0.0
    • 0.0
      geodetic_config: !beat.GeodeticConfig
      datadir: /home/vasyurhm/BEATS/RectangularStatic/insar
      names:
  • Laquila_dscxn
  • Laquila_ascxn
    types:
  • SAR
    calc_data_cov: true
    interpolation: multilinear
    fit_plane: true
    dataset_specific_residual_noise_estimation: true
    gf_config: !beat.GeodeticGFConfig
    store_superdir: /data/lxrtest/insarlab/GF/Laquila
    reference_model_idx: 0
    n_variations:
    • 0
    • 1
      earth_model_name: ak135-f-continental.m
      nworkers: 60
      use_crust2: false
      replace_water: false
      source_depth_min: 0.0
      source_depth_max: 35.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
      code: psgrn
      sample_rate: 1.1574074074074073e-05
      sampling_interval: 1.0
      medium_depth_spacing: 1.0
      medium_distance_spacing: 1.0
      sampler_config: !beat.SamplerConfig
      name: SMC
      backend: csv
      progressbar: true
      buffer_size: 5000
      buffer_thinning: 1
      parameters: !beat.SMCConfig
      tune_interval: 10
      check_bnd: true
      rm_flag: false
      n_jobs: 50
      n_steps: 100
      n_chains: 1000
      coef_variation: 1.0
      stage: 0
      proposal_dist: MultivariateCauchy
      update_covariances: true
      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: 4
      n_steps: 25000
      n_chains: 12
      thin: 5
      burn: 0.5

Could you please give me some suggestions?
Thank you !

Hello! Thanks for giving BEAT a try!
It does not make sence to select the update_covariances flag with your current settings. Please set it to false.
For rerunning you can set the "stage" flag to 6 and restart the sampling. During restart it should resolve and detect unfinished sampled chains.

Please see also:
https://hvasbath.github.io/beat/examples/Rectangular.html#restarting-sampling

In case the error persist, please let me know!
Cheers!

I can run it successfully based on your suggestion. Thank you!