coutanto / axitra

numerical modelling of seismic wave propagation in 3D with flat layer models
GNU General Public License v3.0
46 stars 16 forks source link

Incorrect SAC header #5

Open claudiodsf opened 3 years ago

claudiodsf commented 3 years ago

Hi Olivier,

this line produces an incorrect SAC file, since all the header variables are set to 0, instead of being set to their undefined value (which is correctly done here).

The result, is that you get a sac header full of zeros:

SAC> r axi001.X.sac
SAC> lh

  FILE: axi001.X.sac - 1
 ------------------

         NPTS = 1024
            B = 0.000000e+00
            E = 6.993164e+01
       IFTYPE = TIME SERIES FILE
        LEVEN = TRUE
        DELTA = 6.835938e-02
       ODELTA = 0.000000e+00
         IDEP = 27
       DEPMIN = -1.160833e+02
       DEPMAX = 1.550040e+02
       DEPMEN = -4.633208e-04
      OMARKER = 0                ()
      AMARKER = 0                ()
     T0MARKER = 0                ()
     T1MARKER = 0                ()
     T2MARKER = 0                ()
     T3MARKER = 0                ()
     T4MARKER = 0                ()
     T5MARKER = 0                ()
     T6MARKER = 0                ()
     T7MARKER = 0                ()
     T8MARKER = 0                ()
     T9MARKER = 0                ()
      FMARKER = 0                ()
       KZDATE = JAN 01 (001), 2000
       KZTIME = 10:00:00.000
       IZTYPE = BEGIN TIME
        KINST =
        RESP0 = 0.000000e+00
        RESP1 = 0.000000e+00
        RESP2 = 0.000000e+00
        RESP3 = 0.000000e+00
        RESP4 = 0.000000e+00
        RESP5 = 0.000000e+00
        RESP6 = 0.000000e+00
        RESP7 = 0.000000e+00
        RESP8 = 0.000000e+00
        RESP9 = 0.000000e+00
       KDATRD =
        KSTNM = 001
        CMPAZ = 0.000000e+00
       CMPINC = 9.000000e+01
       ISTREG = 27
         STLA = 0.000000e+00
         STLO = 0.000000e+00
         STEL = 0.000000e+00
         STDP = 0.000000e+00
        KEVNM =
       IEVREG = 27
         EVLA = 0.000000e+00
         EVLO = 0.000000e+00
         EVEL = 0.000000e+00
         EVDP = 0.000000e+00
       IEVTYP = 27
        KHOLE =
         DIST = 0.000000e+00
           AZ = 0.000000e+00
          BAZ = 0.000000e+00
        GCARC = 0.000000e+00
       LOVROK = FALSE
        IQUAL = 27
       ISYNTH = 27
        USER0 = 0.000000e+00
        USER1 = 0.000000e+00
        USER2 = 0.000000e+00
        USER3 = 0.000000e+00
        USER4 = 0.000000e+00
        USER5 = 0.000000e+00
        USER6 = 0.000000e+00
        USER7 = 0.000000e+00
        USER8 = 0.000000e+00
        USER9 = 0.000000e+00
       KUSER0 =
       KUSER1 =
       KUSER2 =
       NXSIZE = 0
     XMINIMUM = 0.000000e+00
     XMAXIMUM = 0.000000e+00
       NYSIZE = 0
     YMINIMUM = 0.000000e+00
     YMAXIMUM = 0.000000e+00
        NVHDR = 6
        SCALE = 0.000000e+00
        NORID = 0
        NEVID = 0
        NWFID = 1
        IINST = 27
       LPSPOL = FALSE
       LCALDA = TRUE
       KCMPNM = X
       KNETWK =
          MAG = 0.000000e+00
      IMAGTYP = 27
      IMAGSRC = 27
        IBODY = Earth (Sac Historical)

SAC still manages to display the file correctly, but ObsPy shows a zero trace because of SCALE = 0.000000e+00.

In my test, commenting out line 170 fixes the issue.

But maybe there is another reason for that line ?