hvasbath / beat

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

plotting issue(slip_distribution) #127

Open mohammadrezarezazadeh opened 1 month ago

mohammadrezarezazadeh commented 1 month ago

hi. i intended to plot slip distribution but the keyError: 'nucleation_dip' came up. appreciate any hint. that's the log: (beat) [x_301025@localhost project]$ beat plot HojedkEQ/ slip_distribution --mode=ffi --nensemble=100 To enable 'bem' mode packages 'pygmsh' and 'cutde' need to be installed. 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 ---------------------

seismic - INFO Loading seismic data for event 0 from: /home/x_301025/project/HojedkEQ/seismic_data.pkl seismic - INFO Initialising seismic wavemap for "any_P" ... heart - INFO Consistent number of datasets and targets in any_P_0 wavemap! heart - INFO Number of seismic datasets for wavemap: any_P_0: 39

seismic - INFO Fault(s) discretized to 2.0 [km] patches. config - INFO not solving for nucleation_dip, got fixed at 7.4 config - INFO not solving for time, got fixed at -2.9389 config - INFO not solving for utens, got fixed at 0.0 models - INFO Using "none" regularization ... backend - INFO Loading multitrace from /home/x301025/project/HojedkEQ/ffi/stage-1 plotting.ffi - INFO Rendering rupture fronts ... 0%| | 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/x_301025/src/miniconda/envs/beat/bin/beat", line 8, in sys.exit(main()) File "/home/x301025/src/miniconda/envs/beat/lib/python3.10/site-packages/beat/apps/beat.py", line 2442, in main globals()["command" + command](args) File "/home/x_301025/src/miniconda/envs/beat/lib/python3.10/site-packages/beat/apps/beat.py", line 1958, in command_plot plotting.plots_catalog[plot](problem, po) File "/home/x_301025/src/miniconda/envs/beat/lib/python3.10/site-packages/beat/plotting/ffi.py", line 803, in draw_slip_dist figs, axs = fault_slip_distribution( File "/home/x_301025/src/miniconda/envs/beat/lib/python3.10/site-packages/beat/plotting/ffi.py", line 604, in fault_slip_distribution sts = fault.point2starttimes(point, index=ns) File "/home/x_301025/src/miniconda/envs/beat/lib/python3.10/site-packages/beat/ffi/fault.py", line 619, in point2starttimes nuc_dip = point["nucleation_dip"][index] KeyError: 'nucleation_dip'

mohammadrezarezazadeh commented 1 month ago

is it possible that the error is due to fixed time in the priors? i'll sample the space soultion with an unfixed time prior.

hvasbath commented 1 month ago

It is due to fixed nucleation dip, but thats sth I need to fix in the code. I am sorry for that! However, I wont be able to do that until 20.5. i am in the mountains.

mohammadrezarezazadeh commented 1 month ago

It is due to fixed nucleation dip, but thats sth I need to fix in the code. I am sorry for that! However, I wont be able to do that until 20.5. i am in the mountains.

thanks

hvasbath commented 1 month ago

Thanks for reporting! I fixed it on the current master branch. Please update your local installation with the master branch and report back if it works for you now. If not please again report the error- locally it is working here.

mohammadrezarezazadeh commented 1 month ago

thanks. i'll test it today and notify you whether it works correctly or not.

mohammadrezarezazadeh commented 1 month ago

hello again. unfortunatelly the error still exists. here is the log: (beatenv3.11) [x_301025@localhost project]$ beat plot HojedkEQ/ slip_distribution --mode=ffi --nensemble=100 To enable 'bem' mode packages 'pygmsh' and 'cutde' need to be installed. 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 ---------------------

seismic - INFO Loading seismic data for event 0 from: /home/x_301025/project/HojedkEQ/seismic_data.pkl seismic - INFO Initialising seismic wavemap for "any_P" ... heart - INFO Consistent number of datasets and targets in any_P_0 wavemap! heart - INFO Number of seismic datasets for wavemap: any_P_0: 39

seismic - INFO Fault(s) discretized to 2.0 [km] patches. config - INFO not solving for nucleation_dip, got fixed at 7.4 config - INFO not solving for time, got fixed at -2.9389 config - INFO not solving for utens, got fixed at 0.0 models - INFO Using "none" regularization ... backend - INFO Loading multitrace from /home/x301025/project/HojedkEQ/ffi/stage-1 plotting.ffi - INFO Rendering rupture fronts ... 0%| | 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/x_301025/src/miniconda/envs/beatenv3.11/bin/beat", line 8, in sys.exit(main()) ^^^^^^ File "/home/x301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/apps/beat.py", line 2442, in main globals()["command" + command](args) File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/apps/beat.py", line 1958, in command_plot plotting.plots_catalog[plot](problem, po) File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/plotting/ffi.py", line 803, in draw_slip_dist figs, axs = fault_slip_distribution( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/plotting/ffi.py", line 604, in fault_slip_distribution sts = fault.point2starttimes(point, index=ns) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/ffi/fault.py", line 619, in point2starttimes nuc_dip = point["nucleation_dip"][index]


KeyError: 'nucleation_dip
hvasbath commented 1 month ago

I need your setup to replicate. Please provide the config_ffi. Thanks!

mohammadrezarezazadeh commented 1 month ago

data.zip provided. sorry about the delay