hvasbath / beat

Bayesian Earthquake Analysis Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error in beat summarize

ranneylxr opened this issue · comments

Hi again.
I am trying to summarize the finial results after the sampling successfully finished. When I ran the command "beat summarize BalochistanEQ7 --stage_number=-1 --mode=ffi", I meet an error: "KeyError: 'uparr' at uparr = self.vector2subfault(index, point['uparr'])". I tried to debug it and found that this line worked well for index=0 and reported error when index=1. I have 7 subfaults.
When index=0, the keys in point dict are:
{uparr, uperp, h_SAR, h_laplacian, Sen201410_201712ascMeter_sub_azimuth_ramp, Sen201410_201712ascMeter_sub_range_ramp, Sen201410_201712ascMeter_sub_offset, Sen201410_201712desMeter_sub_azimuth_ramp, Sen201410_201712desMeter_sub_range_ramp, Sen201410_201712desMeter_sub_offset, geo_like, laplacian_like, like}
When index=1, the point dict is:
{'slip': 0.8816954847133593, 'rake': 12.847378570297858}

The error message is:

beat summarize BalochistanEQ7 --stage_number=-1 --mode=ffi
beat         - INFO     Loading problem ...
config       - INFO     All hierarchicals ok!
config       - INFO     All hyperparameters ok!
config       - INFO     All priors ok!
models       - INFO     ... Initialising Distribution Optimizer ... 

models       - INFO     Analysing problem ...
models       - INFO     ---------------------

geodetic     - INFO     Number of geodetic datasets: 2 
geodetic     - INFO     Number of geodetic data points: 1190 
geodetic     - WARNING  Covariance estimation not implemented (yet)! Using imported covariances!
geodetic     - INFO     Initialising corrections ...
heart        - INFO     Not correcting Sen201410_201712ascMeter_sub for Euler Pole
heart        - INFO     Setting up Ramps correction for Sen201410_201712ascMeter_sub
heart        - INFO     Not correcting Sen201410_201712desMeter_sub for Euler Pole
heart        - INFO     Setting up Ramps correction for Sen201410_201712desMeter_sub
models       - INFO     ... Building model ...

models       - INFO     Initialised hyperparameter h_SAR with size 1 
models       - INFO     Initialised hyperparameter h_laplacian with size 1 
models       - INFO     Optimization for 2 hyperparameters in total!
geodetic     - INFO     Loading geodetic Green's Functions
ffi          - INFO     Setting geodetic_uparr_static_0 GF Library to optimization mode.
ffi          - INFO     Setting geodetic_uperp_static_0 GF Library to optimization mode.
geodetic     - INFO     Evaluating config for Euler Pole corrections for datasets...
geodetic     - INFO     No Euler Pole correction!
geodetic     - INFO     Evaluating config for Ramps corrections for datasets...
geodetic     - INFO     Initialized 6 hierarchical parameters.
ffi.laplacian - INFO     Initialising Laplacian smoothing operator ...
models       - INFO     Model building was successful! 

beat         - INFO     Summarizing stage(s): -1
beat         - INFO     Summarizing stage under: /data/lxrtest/insarlab/BEAT/BalochistanEQ7/ffi/stage_-1
backend      - INFO     Loading multitrace from /data/lxrtest/insarlab/BEAT/BalochistanEQ7/ffi/stage_-1
backend      - INFO     Adding derived variables magnitude to trace.
  0%|                                                                                                                            | 0/1200 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/bin/beat", line 11, in <module>
    load_entry_point('beat==1.1', 'console_scripts', 'beat')()
  File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.1-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 2041, in main
    globals()['command_' + command](args)
  File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.1-py3.7-linux-x86_64.egg/beat/apps/beat.py", line 1053, in command_summarize
    composite.point2sources(point)
  File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.1-py3.7-linux-x86_64.egg/beat/models/geodetic.py", line 821, in point2sources
    return self.fault.point2sources(tpoint, events=events)
  File "/home/lxrtest/wclsolid/pyenv/versions/miniconda3-4.7.12/lib/python3.7/site-packages/beat-1.1-py3.7-linux-x86_64.egg/beat/ffi/fault.py", line 591, in point2sources
    uparr = self.vector2subfault(index, point['uparr'])
KeyError: 'uparr'

Did I mess something or forget to set something? I have no idea what to do...
Thank you!

thanks for reporting, had that fixed already in a new feature branch ...
you are too fast ;)
should be fixed now also here, please update

Hi @hvasbath
It works well and I get a great result!
Thank you so much!

Thanks for giving it a try and for your patience with all these issues! I am glad it worked finally for your case!