hvasbath / beat

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

plotting issue(moment_rate) #128

Open mohammadrezarezazadeh opened 3 weeks ago

mohammadrezarezazadeh commented 3 weeks ago

hi. after summarizing tried to plot the moment_rate but an error came up which implied that the plot is existed, but it is not. i checked the figures directory it's not there. i used -- force but the error still exists. appreciate any help. that's the log: 2024-04-27 19:33:57,018 - seismic - INFO - Fault(s) discretized to 2.0 [km] patches. 2024-04-27 19:33:57,018 - config - INFO - not solving for utens, got fixed at 0.0 2024-04-27 19:33:57,018 - models - INFO - Using "none" regularization ... 2024-04-27 19:33:57,019 - backend - INFO - Loading multitrace from /home/x301025/project/HojedkEQ/ffi/stage-1 2024-04-27 19:33:57,711 - plotting.ffi - INFO - Drawing ensemble of 0 moment rate functions ... 2024-04-27 19:33:57,711 - plotting.ffi - INFO - Drawing total rates ... 2024-04-27 19:33:57,712 - plotting.ffi - INFO - Fault 1 / 1 2024-04-27 19:33:57,823 - beat - WARNING - Could not plot moment_rate got Error: plot_exists() missing 1 required positional argument: 'force' Traceback (most recent call last): File "/home/x_301025/src/miniconda/envs/beatenv/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/beatenv/lib/python3.11/site-packages/beat/plotting/ffi.py", line 148, in draw_moment_rate if plot_exists(outpath, po.force): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: plot_exists() missing 1 required positional argument: 'force'

hvasbath commented 3 weeks ago

Thanks for reporting! There is a bug in the code I/someone/you will need to fix. There is a missing input argument to the plot_exists function, the outputformat is missing.

mohammadrezarezazadeh commented 3 weeks ago

thanks, i'll try to fix it

hvasbath commented 2 weeks 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 2 weeks ago

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

mohammadrezarezazadeh commented 1 week ago

hello. previous error does not exist. but there is a new error due to fixed nucleation dip. here is the log: (beatenv3.11) [x_301025@localhost project]$ beat plot HojedkEQ/ moment_rate --mode=ffi 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 Drawing ensemble of 0 moment rate functions ... plotting.ffi - INFO Drawing total rates ... plotting.ffi - INFO Fault 1 / 1 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 141, in draw_moment_rate ref_mrf_rates, ref_mrf_times = fault.get_moment_rate_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/ffi/fault.py", line 454, in get_moment_rate_function rates, times = self.get_subfault_moment_rate_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x_301025/src/miniconda/envs/beatenv3.11/lib/python3.11/site-packages/beat/ffi/fault.py", line 413, in get_subfault_moment_rate_function starttimes = self.point2starttimes(point, index=index).ravel() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 week ago

Same here, will be able to replicate once you provided the setup from the other issue.

mohammadrezarezazadeh commented 1 week ago

data.zip provided