NoisyLeon / pyaftan

Python package of aftan(Automatic Frequency Time Analysis)
13 stars 20 forks source link

Error #3

Open zee1978 opened 2 years ago

zee1978 commented 2 years ago

Dear author I am facing the following problem. How to solve this issue.

Traceback (most recent call last): File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 128, in getattr return self.getitem(name, default) File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 74, in getitem return self.dict[name] KeyError: 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/zafar/pyaftan-master/pyaftan.py", line 848, in aftan dist = self.stats.sac.dist File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 130, in getattr raise AttributeError(e.args[0]) AttributeError: dist

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 128, in getattr return self.getitem(name, default) File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 74, in getitem return self.dict[name] KeyError: 'evla'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "test_aftan.py", line 14, in atr1.aftan(tmin=5., tmax=20., vmin=2.5, vmax=3.5, phvelname='ak135.disp') File "/home/zafar/pyaftan-master/pyaftan.py", line 850, in aftan dist, az, baz = obspy.geodetics.base.gps2dist_azimuth(self.stats.sac.evla, self.stats.sac.evlo, File "/home/zafar/anaconda3/lib/python3.7/site-packages/obspy/core/util/attribdict.py", line 130, in getattr raise AttributeError(e.args[0]) AttributeError: evla

NoisyLeon commented 2 years ago

Please make sure you have evla, evlo, stla and stlo correctly stored in your SAC header attributes.

zee1978 commented 2 years ago

Respected Professor I have correctly added the information. When I run, the problem is lag time. Can you please help me to resolve this issue.

" Run C test: pi/4= -1.0, vmin= 1.500000, vmax= 5.000000, tmin= 4.000000, tmax= 30.000000 Tresh= 20.000000, Filter factor= 1.000000, taperl= 1.000000, SNR= 0.200000, Match = 1.000000 Data file name=ctest/COR_N.MSMH_N.TYNH.SAC Phase velocity prediction file name= ctest/COR_N.MSMH_N.TYNH.SAC_PHP Wrong SAC header n=71999 lag=-435163329

filters= 64, Perc= 50.00 %, npoints= 5, t0= 435163329.35

FTAN - the first ineration Segmentation fault (core dumped) Run gfortran test: pi/4= -1.0 vmin= 1.50 vmax= 5.00 tmin= 4.00 tmax= 30.00 tresh= 20.00 filter factor= 1.00 taperl= 1.00 snr= 0.20 match = 1.00 Data file name= ftest/COR_N.MSMH_N.TYNH.SAC Phase velocity prediction file name= ftest/COR_N.MSMH_N.TYNH.SAC_PHP Wrong SAC header n=71999 lag=3599 t0 = -3599.8999023437500

filters= 64 Perc= 50.00 npoints= 5

FTAN - the first ineration\n Starting period= Infinity , Phase velocity= Infinity Starting period= Infinity , Phase velocity= Infinity REESULT: O.K."

Waiting here for your kind advice. Regards

On Tue, Sep 21, 2021 at 4:19 AM Lili Feng (冯力理) @.***> wrote:

Please make sure you have evla, evlo, stla and stlo correctly stored in your SAC header attributes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NoisyLeon/pyaftan/issues/3#issuecomment-923209593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVUNK6M2CGI5WSD7TUNC5NDUC6CMDANCNFSM5EDVZOAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

NoisyLeon commented 2 years ago

Seems to me you are trying the pure fortran version. If you encounter any problem, you should contact the original author (Misha Barmin). Also, after adding the header attributes, have you tried my python version?