jpjones76 / SeisIO.jl

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

`scan_seed` produces erroneous results unless `read_data` is first called on same file #73

Closed jpjones76 closed 3 years ago

jpjones76 commented 3 years ago

Trying out scan_seed, came across odd problem where scan_seed gets the number of gaps wrong for any file before read_data is called but correct for any file after read_data is called:

julia> using SeisIO, SeisIO.SEED

julia> file = "/home/ubuntu/data/continuous_waveforms/2008/2008_001/CIADO__HHZ___2008001.ms"
"/home/ubuntu/data/continuous_waveforms/2008/2008_001/CIADO__HHZ___2008001.ms"

julia> scan_seed(file,quiet=true)[1]
"CI.ADO..HHZ, nx = 1079497, ngaps = 4752, nfs = 1"

julia> S = read_data("mseed",file)
SeisData with 1 channels (1 shown)
    ID: CI.ADO..HHZ                        
  NAME: CI.ADO..HHZ                        
   LOC: 0.0 N, 0.0 E, 0.0 m                
    FS: 100.0                              
  GAIN: 1.0                                
  RESP: a0 1.0, f0 1.0, 0z, 0p             
 UNITS:                                    
   SRC: /home/ubuntu/data/continuous_wave… 
  MISC: 0 entries                          
 NOTES: 1 entries                          
     T: 2008-01-01T00:00:00 (4 gaps)       
     X: +4.160e+02                         
        +4.130e+02                         
            ...                            
        +2.770e+02                         
        (nx = 8639564)                     
     C: 0 open, 0 total

julia> scan_seed(file,quiet=true)[1]
"CI.ADO..HHZ, nx = 8639564, ngaps = 4, nfs = 1"

I can confirm that scan_seed works on other files after read_data is called. I'm guessing this has something to do with SeisIO.BUF but haven't investigated any further.

Originally posted by @tclements in https://github.com/jpjones76/SeisIO.jl/issues/62#issuecomment-722725561