jpjones76 / SeisIO.jl

Julia language support for geophysical time series data
http://seisio.readthedocs.org
Other
47 stars 21 forks source link

Sample rate in mini-SEED Blockette 100 #48

Closed anowacki closed 4 years ago

anowacki commented 4 years ago

I have come across some miniseed data where I think the sampling interval may not be read correctly.

The following reproduces the issue:

julia> import SeisIO

julia> s = SeisIO.get_data("FDSN", "II.ALE.00.BH?", s="2001-01-13T17:33:29.58", t="2001-01-13T17:34:35.58")
SeisIO.SeisData with 3 channels (2 shown)
    ID: II.ALE.00.BHE                      II.ALE.00.BHN                      …
  NAME: Alert, NU, Canada                  II.ALE.00.BHN                      …
   LOC: 82.5033 N, -62.35 E, 60.0 m        0.0 N, 0.0 E, 0.0 m                …
    FS: 20.0                               0.05                               …
  GAIN: 5.43094e8                          1.0                                …
  RESP: a0 1.0, f0 0.05, 5z, 12p           a0 1.0, f0 1.0, 0z, 0p             …
 UNITS: m/s                                                                   …
   SRC: http://service.iris.edu/fdsnws/da…                                    …
  MISC: 4 entries                          0 entries                          …
 NOTES: 4 entries                          2 entries                          …
     T: 2001-01-13T17:33:29 (0 gaps)       2001-01-13T17:33:29 (0 gaps)       …
     X: -3.000e+01                         -7.630e+02                         …
        -6.100e+01                         -7.400e+02                         …
            ...                                ...                            …
        -4.020e+02                         -8.120e+02                         …
        (nx = 1319)                        (nx = 1319)                        …
     C: 0 open, 0 total

julia> sio.fs
3-element Array{Float64,1}:
 20.0
  0.049999966621421206
  0.049999966621421206

All the channels should have the same sampling interval of 0.05 s (sampling rate 20 Hz), but for some reason the sampling interval for the BHN and BHZ components are given as 2 s (0.05 Hz). Obspy does not have the same issue as far as I can tell.

Let me know if I can help to diagnose the problem.

A zipped version of the file (directly obtained from IRIS via FDSN webservices) is attached.

mseed.zip

jpjones76 commented 4 years ago

Fix in testing. There's an odd set of issues at play here. One is an oral tradition (unwritten expectation) that Blockette 100 immediately overwrites the sampling rate. The IRIS C library (called by ObsPy) does this, so I'll change SeisIO to match its behavior.

I'm going to add this mini-SEED example to my automated tests. Should be live on master branch tonight.

jpjones76 commented 4 years ago

This should now be fixed on master. If you're using release versions, expect a new minor version release once I finish a format parser for the Harvard group, hopefully in the next few days.