[SAC-HELP] Difference in 101.3b vs 101.4 with gcp rotation

Brian Savage savage at uri.edu
Wed Jul 6 08:08:45 PDT 2011


Andrew,

What you are seeing is correct.

In previous versions of SAC, 101.3 and earlier:
If the station name (kstnm) is not defined, it would default to "sta"
If the channel name (kcmpnm) is not defined, it would default to "Q"
The stations and channel names were only changed on read.  
It was added a long while ago to "Disallow undefined kstnm and kcmpnm".

We removed this in 101.4.  It was considered to be confusing behavior.
From the HISTORY file:
        * BUG FIX: Stations no longer named 'sta' and channels 'Q' by default

If you need this, or have scripts/programs that rely on it, you can change the header values to a something you expect.
SAC> ch kcmpnm Q
or if you know they are radial transverse, you could use
SAC> ch kcmpnm BHR 

For your processing:
On the initial read, the fields kcmpnm for both files are probably set to BHN and BHE 
The ROTATE command sets the kcmpnm fileds to undefined (-12345.0)
You write the files out. The kcmpnm is still set as "-12345.0"
You read the files back in.  On this read the kcmpnm is set to "Q" as 101.3 did not allow a undefined kcmpnm field.

If this change caused havoc, we apologize.

I hope this helps.

Brian Savage
savage at uri.edu

Example run using 101.4:

SAC> fg seismo
SAC> ch cmpinc 90
SAC> ch cmpaz 0
SAC> ch kcmpnm BHN
SAC> w tmp.n
SAC> ch cmpaz 90
SAC> ch kcmpnm BHE
SAC> w tmp.e
SAC> read tmp.n tmp.e
SAC> lh cmpaz cmpinc az baz kcmpnm columns 2
  
  
  FILE: tmp.n - 1
 -----------

     cmpaz = 0.000000e+00                   cmpinc = 9.000000e+01
        az = 8.814721e+01                      baz = 2.718528e+02
    kcmpnm = BHN
  
  FILE: tmp.e - 2
 -----------

     cmpaz = 9.000000e+01                   cmpinc = 9.000000e+01
        az = 8.814721e+01                      baz = 2.718528e+02
    kcmpnm = BHE
SAC> rotate
SAC> lh cmpaz cmpinc az baz kcmpnm columns 2
  
  
  FILE: tmp.n - 1
 -----------

     cmpaz = 9.185278e+01                   cmpinc = 9.000000e+01
        az = 8.814721e+01                      baz = 2.718528e+02
  
  FILE: tmp.e - 2
 -----------

     cmpaz = 1.818528e+02                   cmpinc = 9.000000e+01
        az = 8.814721e+01                      baz = 2.718528e+02
SAC> evaluate ( ( &1,baz + 180 ) - &1,cmpaz )
 3.6000000e+02


On Jul 6, 2011, at 10:19 AM, Andrew Schaeffer wrote:

> Hello,
> 
> I am trying to resolve a difference between the SAC versions 101.3b and 101.4.
> 
> In 101.3b:
> I am performing "rotate to gcp" on a north and east component seismogram, and writing out the radial and transverse components:
> r s1.dn s1.de
> rotate to gcp
>   ->If I list the header (lh) at this point, the KCMPNM header value is now empty (ie doesn't show up).
> write s1.dr s1.dt
> quit
> 
> If I start sac again, and read in the dr and dt components, they now have the KCMPNM header value, with "Q" for both components.
> 
> If I repeat the same procedure in 101.4, the KCMPNM header value remains empty, even after writing the seismograms and reloading them.
> Can anyone confirm whether this is the expected behaviour (ie the difference between the two versions), or what their version is doing?
> 
> many thanks,
> Andrew
> _______________________________________________
> sac-help mailing list
> sac-help at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20110706/ad26ad05/attachment.html>


More information about the sac-help mailing list