Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y2000.phs file #53

Closed
dylanmikesell opened this issue Mar 15, 2021 · 5 comments
Closed

Y2000.phs file #53

dylanmikesell opened this issue Mar 15, 2021 · 5 comments

Comments

@dylanmikesell
Copy link
Contributor

dylanmikesell commented Mar 15, 2021

Hi, I think there is a small bug in the line that writes the event information (lines 411-414 in associator.py).

Y2000_writer.write("%4d%2d%2d%2d%2d%4.2f%2.0f%1s%4.2f%3.0f%1s%4.2f%5.2f%3.2f\n"%
                   (int(yr),int(mo),int(dy), int(hr),int(mi),float(sec),float(st_lat_DMS[0]), 
                    str(st_lat_DMS[1]), float(st_lat_DMS[2]),float(st_lon_DMS[0]), str(st_lon_DMS[1]), 
                    float(st_lon_DMS[2]),float(depth), float(mag))); 

In the case where minutes is less than 10, the columns are not correct in the resulting phase file. Compare the two events below. The first event has a start time of 2021-10-01 01:33:06.05, but the 0 in front of the six is missing and thus this line has one less column than the next event, start time of 2021-10-01 01:34:43.42. This completely screws up an parser that reads by position.

202010 1 1336.0544 18.20115W14.08 5.000.00
SAC  XP  HHE     202010 1 133 0.00        7.36ES 2
SAC  XP  HHZ IP 0202010 1 133 5.74        0.00   0
BANN XP  HHE     202010 1 133 0.00        8.24ES 0
BANN XP  HHZ IP 0202010 1 133 6.08        0.00   0
FOX  XP  HHE     202010 1 133 0.00        9.07ES 0
FOX  XP  HHZ IP 0202010 1 133 6.51        0.00   0
MFRD XP  HHE     202010 1 133 0.00       11.54ES 0
MFRD XP  HHZ IP 0202010 1 133 8.01        0.00   0
SUNB XP  HHE     202010 1 133 0.00       12.89ES 1
SUNB XP  HHZ IP 2202010 1 13310.02        0.00   0
DDR  XP  HHE     202010 1 133 0.00       16.56ES 0
DDR  XP  HHZ IP 0202010 1 13310.99        0.00   0
WARM XP  HHE     202010 1 133 0.00       23.28ES 2
WARM XP  HHZ IP 0202010 1 13314.83        0.00   0
HLID US  HHE     202010 1 133 0.00       30.15ES 2
HLID US  HHZ IP 1202010 1 13319.06        0.00   0
                                                                  200014
202010 1 13443.4244 18.20115W14.08 5.000.00
EPIC XP  HHE     202010 1 134 0.00       44.92ES 0
EPIC XP  HHZ IP 0202010 1 13443.20        0.00   0
BANN XP  HHE     202010 1 134 0.00       45.66ES 0
BANN XP  HHZ IP 0202010 1 13443.52        0.00   0
MFRD XP  HHE     202010 1 134 0.00       46.15ES 0
MFRD XP  HHZ IP 0202010 1 13443.79        0.00   0
SAC  XP  HHE     202010 1 134 0.00       47.30ES 0
SAC  XP  HHZ IP 0202010 1 13445.22        0.00   0
FOX  XP  HHE     202010 1 134 0.00       48.58ES 0
FOX  XP  HHZ IP 0202010 1 13445.31        0.00   0
IRON XP  HHE     202010 1 134 0.00       48.74ES 0
IRON XP  HHZ IP 2202010 1 13445.49        0.00   0
DDR  XP  HHE     202010 1 134 0.00       52.64ES 0
DDR  XP  HHZ IP 0202010 1 13447.63        0.00   0
TCK  XP  HHE     202010 1 134 0.00       53.66ES 0
TCK  XP  HHZ IP 1202010 1 13448.22        0.00   0
WARM XP  HHE     202010 1 134 0.00       56.86ES 1
WARM XP  HHZ IP 1202010 1 13450.09        0.00   0
                                                                  200015

It would be nice to modify the code to put zeros in front of the single digit numbers that should be two characters long.

Y2000_writer.write("%4d%02d%02d%02d%02d%04.2f%2.0f%1s%4.2f%3.0f%1s%4.2f%5.2f%3.2f\n"%
                   (int(yr),int(mo),int(dy), int(hr),int(mi),float(sec),float(st_lat_DMS[0]), 
                    str(st_lat_DMS[1]), float(st_lat_DMS[2]),float(st_lon_DMS[0]), str(st_lon_DMS[1]), 
                    float(st_lon_DMS[2]),float(depth), float(mag))); 

I guess it is most important for the seconds (%04.2f).

@smousavi05
Copy link
Owner

@dylanmikesell thank you so much for the bug report. I'll fix it.

@smousavi05 smousavi05 pinned this issue Apr 14, 2022
@dylanmikesell
Copy link
Contributor Author

Did this get fixed? I do not see a commit related to this issue, but maybe it just was not tagged.

@smousavi05
Copy link
Owner

smousavi05 commented Apr 20, 2022 via email

@juracimario
Copy link

Dear Mustafa, I am also interrested in this part of the code.
Cheers,
Juraci
(juraci@unb.br)

@smousavi05
Copy link
Owner

smousavi05 commented Jan 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants