error import geometry to ffi v1.1_dev_rc
ranneylxr opened this issue · comments
Hi @hvasbath
Sorry for disturbing you again......
The beat work well for the uniform inversion and I got a very good results.
But when I want to try the distributed slip inversion, I got an error like following (I updated the beat software before I used it in case there are new changes):
[lxrtest@dqcentos7insar BEAT]$ beat import BalochistanEQ7 --results=BalochistanEQ7 --mode='geometry' --datatypes=geodetic
beat - INFO Attempting to load results with mode ffi to config_geometry.yaml from directory: BalochistanEQ7
config - INFO All hierarchicals ok!
config - INFO All hyperparameters ok!
config - INFO All priors ok!
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 Using "none" regularization ...
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 499, in command_import
load='trace', chains=[-1])
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/base.py", line 387, in load_results
stage_number = self.handler.highest_sampled_stage()
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/backend.py", line 906, in highest_sampled_stage
return max(self.stage_number(s) for s in glob(self.stage_path('*')))
ValueError: max() arg is an empty sequence
Before running this command, I ran:
beat init BalochistanEQ7 --mode='ffi' --datatypes=geodetic
Could you please give me some suggestion?
Thank you very much!
Best regards
The import functionality changed and the tutorial needs updating. Which is work in progress.
The mode argument was changed there and it is now consistently referring again to the mode of the current project.
There is an additional argument --import_from_mode that you need to specify now.
Likely for your current setup this could work:
beat import BalochistanEQ7 --results=BalochistanEQ7 --mode=ffi --datatypes=geodetic --import_from_mode=geometry
Saying you want to import from the geometry of BalochistanEQ7, to: ffi of BalochistanEQ7.
I also recommend to use the absolut path to the results argument instead of a relative path. This could also cause troubles- not sure about it.
Hi @hvasbath
The import command works well. Thank you!
However, unfortunately, I meet a new error when I ran the command "beat sample BalochistanEQ7 --hypers --mode=ffi"...
The error message is:
beat sample BalochistanEQ7 --hypers --mode=ffi
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 Using "none" regularization ...
models - INFO ... Building Hyper model ...
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.
Traceback (most recent call last):
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/heart.py", line 628, in random
dimension) + self.lower
ValueError: operands could not be broadcast together with shapes (7,) (420,)
During handling of the above exception, another exception occurred:
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 902, in command_sample
project_dir, options.mode, options.hypers)
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/problems.py", line 885, in load_model
problem.built_hyper_model()
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/problems.py", line 277, in built_hyper_model
point = self.get_random_point(include=['hierarchicals', 'priors'])
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/problems.py", line 317, in get_random_point
point[param.name] = param.random(dimension=dimension)
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/heart.py", line 633, in random
self.name, self.lower.size))
ValueError: Either use number of patches input vector size for variable uparr or only [1]]! Now the size is 7!
I used 7 sub-faults and the hypers part in config_ffi.yaml file is:
problem_config: !beat.ProblemConfig
mode: ffi
mode_config: !beat.FFIConfig
regularization: none
initialization: random
npatches: 420
source_type: RectangularSource
stf_type: HalfSinusoid
decimation_factors:
geodetic: 4
n_sources: 7
datatypes:
- geodetic
hyperparameters:
h_SAR: !beat.heart.Parameter
name: h_SAR
form: Uniform
lower:
- -5.0
upper:
- 8.0
testvalue:
- 1.5
priors:
uparr: !beat.heart.Parameter
name: uparr
form: Uniform
lower:
- -0.05
- -0.05
- -0.05
- -0.05
- -0.05
- -0.05
- -0.05
upper:
- 6.0
- 6.0
- 6.0
- 6.0
- 6.0
- 6.0
- 6.0
testvalue:
- 1.15
- 1.15
- 1.15
- 1.15
- 1.15
- 1.15
- 1.15
uperp: !beat.heart.Parameter
name: uperp
form: Uniform
lower:
- -0.3
- -0.3
- -0.3
- -0.3
- -0.3
- -0.3
- -0.3
upper:
- 4.0
- 4.0
- 4.0
- 4.0
- 4.0
- 4.0
- 4.0
testvalue:
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
hierarchicals:
Sen201410_201712ascMeter_sub_azimuth_ramp: !beat.heart.Parameter
Thank you very much!
Please read the error. Is that unclear? If so we need to work on the text ...
But we might want to offer that as an option for the user to allow for subfault specific priors ...
Going to open another issue ... #70
Hi @hvasbath
I know what the error message mean now.
Could the error message tell the users something like that the beat uses a single value for all subfault ? So that it would be much clearer.
Because, as a user, I firstly thought that the settings of slip prior for subfault would be same as the settings of geometry parameters in config_geometry.yaml, which means that there are 7 pairs of settings for slip prior. And I may doubt whether it is correct to only use a value of slip prior for all subfaults.
These are my experience about it and if they are wrong please don't mind!
Thank you very much for your patient help!
You are totally right! As the new issue is for resolving that! Thanks for reporting!
Requested feature is now implemented in: #82