8000 Y2000.phs file · Issue #53 · smousavi05/EQTransformer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Y2000.phs file #53
Closed
Closed
@dylanmikesell

Description

@dylanmikesell

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0