saeedsltm / PyVelest

A python code for running VELEST (1D velocity calculation using travel time inversion)
63 stars 21 forks source link

Output plot errors #9

Closed jeospring closed 3 years ago

jeospring commented 4 years ago

Hi, I tried PyVelest and obtained good results but sometimes I get the error below. How can I handle with this error? Thank you.

+++ Read VELEST input parameters ... +++ Write VELEST control file ... +++ Plotting data statistics ... +++ Make synthetic velocity models ... +++ Run VELEST ... --- 10 synthetic model(s) found ... --- Run for synthetic model: 1 --- Run for synthetic model: 2 --- Run for synthetic model: 3 --- Run for synthetic model: 4 --- Run for synthetic model: 5 --- Run for synthetic model: 6 --- Run for synthetic model: 7 --- Run for synthetic model: 8 --- Run for synthetic model: 9 --- Run for synthetic model: 10 +++ Analyse VELEST outputs ... Traceback (most recent call last): File "PyVelest.py", line 3136, in start.analyse_velest_res() File "PyVelest.py", line 811, in analyse_velest_res ax1.plot(x, [self.avg_absadj[nm][][0] for _ in range(len(self.avg_abs_adj[nm]))], marker='o', ms=3, lw=.75,color='grey') File "/usr/lib64/python2.7/site-packages/matplotlib/init.py", line 1867, in inner return func(ax, *args, *kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_axes.py", line 1528, in plot for line in self._get_lines(args, **kwargs): File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_base.py", line 406, in _grab_next_args for seg in self._plot_args(this, kwargs): File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_base.py", line 383, in _plot_args x, y = self._xy_from_xy(x, y) File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_base.py", line 242, in _xy_from_xy "have shapes {} and {}".format(x.shape, y.shape)) ValueError: x and y must have same first dimension, but have shapes (3,) and (4,)

saeedsltm commented 4 years ago

Hi, Please check and be sure that the VELEST inversion outputs are well done, without any errors. Regarding your case i think one run must includes error and so the input for plotting results is not completed.

AntoineHa commented 4 years ago

Hi,

Thanks a lot for the very nice and needed code. I also have the problem mentioned above quite often unfortunately.

I have cross-checked my input files many times but I can't find where the error is coming from... Thanks for your help !

jeospring commented 4 years ago

Hi, Actually I handled with the problem. Please make sure that your input parameters is completed. My mistake was the wrong input about the number of earthquakes in par.dat file in par directory.

I am also very thankful for the code.

AntoineHa commented 4 years ago

Hi, Thanks for your quick reply. Unfortunately it does not seems to be the problem for me... I am checking all the parameters one by one but can't seem to find where the error comes from.

AntoineHa commented 4 years ago

Here is my par.dat file:

VELEST input parameters file.

Please set appropriate values for VELEST input parameters.

See VELEST manuall for more information.

Rows which their comments start with *, will be edited-

automatically. Those starts with @, should be edited here.

# ################### olat : 32.656 #@Latitude of the center of cartesian coordinate system. olon : -35.355 #@Longitude of the center of cartesian coordinate system (W-positive). icoordsystem : 0 # Distance conversion to cartesian coordinate. zshift : 0.0 # Systematically shift all hypocenters in depth relative to depth in summary cards. itrial : 0 # Controling the trial hypocenter in the single_event_mode. ztrial : 0.0 # Controling the trial hypocenter in the single_event_mode. ised : 0 # Controling the input format of the earthquake data. neqs : 350 #@Number of earthquakes. nshot : 0 # Number of shots or blasts. rotate : 0.0 # Denotes the angle of clockwise rotated y-axis from North. isingle : 0 # Switch controling mode of VELEST: 0=simultaneous mode, 1=single_event_mode iresolcalc : 0 # Resolution matrix calculation in single_event_mode. dmax : 80.0 #@Maximal epicentral distance for use of phase. itopo : 0 # Useful for precise location of shallow earthquakes in areas of very rough topography. zmin : 0.2 # Minimal depth for hypocenters. Used to avoid 'air quakes'. veladj : 0.80 #@Maximal adjustement of layer velocity in each iteration step. zadj : 5.00 #@Maximal adjustement of hypocentral depth in each iteration step. lowveloclay : 1 # 0=no low-velocity layers will result from velocity-inversion, 1=may result nsp : 1 #@1=P phases only, 2=P and S phases, 3=P-S relative travel time.
swtfac : 1.00 # General weighting factor for S wave data relative to P.
vpvs : 1.75 #@VpVs ratio. nmod : 1 # Number of velocity models. othet : 0.01 # Damping of origin-time. xythet : 0.01 # Damping of horizontal hypocentral coordinates. zthet : 0.01 # Damping of hypocentral depth. vthet : 1.00 # Damping of velocity-model. stathet : 0.01 # Damping of station-corrections nsinv : 1 # (0=DO NOT) invert for station corrections
nshcor : 0 # 0 = no shot correction applied. nshfix : 0 # See VELEST manual. iuseelev : 1 # Station-elevations are used. iusestacorr : 0 # 0 = station-corrections from input-file are ignored. iturbo : 1 # see manual icnvout : 1 # Option to create .CNV file with final hypocenters.. istaout : 1 # Option to create out.STA file for station list with final station corrections. ismpout : 0 # Option to create *.SMP file with summary cards of final hypocenters. irayout : 0 # If set to 1 the corresponding output file are written. idrvout : 0 # If set to 1 the corresponding output file are written. ialeout : 0 # If set to 1 the corresponding output file are written. idspout : 0 # If set to 1 the corresponding output file are written. irflout : 0 # If set to 1 the corresponding output file are written. irfrout : 0 # If set to 1 the corresponding output file are written. iresout : 0 # If set to 1 the corresponding output file are written. delmin : 0.010 # Criterion to stop iteration in single-event-mode. ittmax : 6 # N iterations with each consisting of a forward and a full inverse solution are performed. invertratio : 1 # In simultaneous mode VELEST may either invert type A type B. See VELEST manuall. Modelfile : ./velinp/test_Gitterman_1.mod # Velocity model file in VELEST format. Stationfile : ./velinp/station.sta # Station list file in VELEST format. [./velinp/station.sta, ./figs/c6/sta_cor.out] Seismofile : None # File.
RegionNamesfile : None # File. Region_coorfile : None # File. Topo_data_1file : None # File. Topo_data_2file : None # File. EQ_datafile : ./velinp/data.cnv # Data input in VELEST format. [./velinp/data.cnv, ./figs/c6/fin_hyp.cnv] Shot_datafile : None # File. Main_printoutfile : ./velout/velest.out # result file in VELEST format. Single_ev_locfile : None # File. Final_hypfile : ./velout/final_loc.cnv # Final location in CNV format. Station_corrfile : ./velout/stations_corr.sta # Station correction file. Summary_cardsfile : None # File. Raypointsfile : None # File. Derivativesfile : None # File. ALEsfile : None # File. Dirichlet_sprfile : None # File. Reflection_pntfile : None # File. Refraction_pntfile : None # File. Residualsfile : None # File.

saeedsltm commented 4 years ago

Here is my par.dat file:

VELEST input parameters file.

Please set appropriate values for VELEST input parameters.

See VELEST manuall for more information.

Rows which their comments start with *, will be edited-

automatically. Those starts with @, should be edited here.

################### olat : 32.656 #@latitude of the center of cartesian coordinate system. olon : -35.355 #@longitude of the center of cartesian coordinate system (W-positive). icoordsystem : 0 # Distance conversion to cartesian coordinate. zshift : 0.0 # Systematically shift all hypocenters in depth relative to depth in summary cards. itrial : 0 # Controling the trial hypocenter in the single_event_mode. ztrial : 0.0 # Controling the trial hypocenter in the single_event_mode. ised : 0 # Controling the input format of the earthquake data. neqs : 350 #@Number of earthquakes. nshot : 0 # Number of shots or blasts. rotate : 0.0 # Denotes the angle of clockwise rotated y-axis from North. isingle : 0 # Switch controling mode of VELEST: 0=simultaneous mode, 1=single_event_mode iresolcalc : 0 # Resolution matrix calculation in single_event_mode. dmax : 80.0 #@maximal epicentral distance for use of phase. itopo : 0 # Useful for precise location of shallow earthquakes in areas of very rough topography. zmin : 0.2 # Minimal depth for hypocenters. Used to avoid 'air quakes'. veladj : 0.80 #@maximal adjustement of layer velocity in each iteration step. zadj : 5.00 #@maximal adjustement of hypocentral depth in each iteration step. lowveloclay : 1 # 0=no low-velocity layers will result from velocity-inversion, 1=may result nsp : 1 #@1=P phases only, 2=P and S phases, 3=P-S relative travel time. swtfac : 1.00 # General weighting factor for S wave data relative to P. vpvs : 1.75 #@vpvs ratio. nmod : 1 # Number of velocity models. othet : 0.01 # Damping of origin-time. xythet : 0.01 # Damping of horizontal hypocentral coordinates. zthet : 0.01 # Damping of hypocentral depth. vthet : 1.00 # Damping of velocity-model. stathet : 0.01 # Damping of station-corrections nsinv : 1 # (0=DO NOT) invert for station corrections nshcor : 0 # 0 = no shot correction applied. nshfix : 0 # See VELEST manual. iuseelev : 1 # Station-elevations are used. iusestacorr : 0 # 0 = station-corrections from input-file are ignored. iturbo : 1 # see manual icnvout : 1 # Option to create .CNV file with final hypocenters.. istaout : 1 # Option to create out.STA file for station list with final station corrections. ismpout : 0 # Option to create *.SMP file with summary cards of final hypocenters. irayout : 0 # If set to 1 the corresponding output file are written. idrvout : 0 # If set to 1 the corresponding output file are written. ialeout : 0 # If set to 1 the corresponding output file are written. idspout : 0 # If set to 1 the corresponding output file are written. irflout : 0 # If set to 1 the corresponding output file are written. irfrout : 0 # If set to 1 the corresponding output file are written. iresout : 0 # If set to 1 the corresponding output file are written. delmin : 0.010 # Criterion to stop iteration in single-event-mode. ittmax : 6 # N iterations with each consisting of a forward and a full inverse solution are performed. invertratio : 1 # In simultaneous mode VELEST may either invert type A type B. See VELEST manuall. Modelfile : ./velinp/test_Gitterman_1.mod # Velocity model file in VELEST format. Stationfile : ./velinp/station.sta # Station list file in VELEST format. [./velinp/station.sta, ./figs/c6/sta_cor.out] Seismofile : None # File. RegionNamesfile : None # File. Region_coorfile : None # File. Topo_data_1file : None # File. Topo_data_2file : None # File. EQ_datafile : ./velinp/data.cnv # Data input in VELEST format. [./velinp/data.cnv, ./figs/c6/fin_hyp.cnv] Shot_datafile : None # File. Main_printoutfile : ./velout/velest.out # result file in VELEST format. Single_ev_locfile : None # File. Final_hypfile : ./velout/final_loc.cnv # Final location in CNV format. Station_corrfile : ./velout/stations_corr.sta # Station correction file. Summary_cardsfile : None # File. Raypointsfile : None # File. Derivativesfile : None # File. ALEsfile : None # File. Dirichlet_sprfile : None # File. Reflection_pntfile : None # File. Refraction_pntfile : None # File. Residualsfile : None # File.

Please send me a slight copy of your working directory.

McBaboulek commented 2 years ago

Hi, l also handled with the problem. did someone solved it? Traceback (most recent call last): File "PyVelest.py", line 3161, in start.analyse_velest_res() File "PyVelest.py", line 834, in analyse_velest_res ax1.plot(x, [self.avg_absadj[nm][][0] for _ in range(len(self.avg_abs_adj[nm]))], marker='o', ms=3, lw=.75,color='grey') File "/Users/marc/.local/lib/python2.7/site-packages/matplotlib/init.py", line 1870, in inner return func(ax, *args, *kwargs) File "/Users/marc/.local/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 1528, in plot for line in self._get_lines(args, **kwargs): File "/Users/marc/.local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 406, in _grab_next_args for seg in self._plot_args(this, kwargs): File "/Users/marc/.local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 383, in _plot_args x, y = self._xy_from_xy(x, y) File "/Users/marc/.local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 242, in _xy_from_xy "have shapes {} and {}".format(x.shape, y.shape)) ValueError: x and y must have same first dimension, but have shapes (3,) and (4,)