SAC Command Reference Manual

CUTIM

SUMMARY

Cuts files in memory. Can cut multiple segments from each file currently in memory

SYNTAX

CUTIM pdw [pwd ... ]

INPUT

pdw:Partial Data Window. It consists of a starting and a stopping value of the independent variable (usually time), which defines which segment of a file (or files) one wishes to read. The most general form of a pde is :ref offset ref offset:, where
ref:A reference value that is one of the following: B|E|O|A|F|Tn, where n=0,1...9. These reference values are defined in SAC data file format and reviewed below.
offset:A positive or negative number which is added to the reference value (optional).

DEFAULT VALUES

Start and stop reference values are required. See examples below for an exception. If the start or stop offset is omitted, it is assumed to be zero.

DESCRIPTION

While the CUT command simply sets cut points and does not change the file in memory, CUTIM carries out the cut(s) when the command is given. The user can READ a file aand type CUTIM with the desired cutpoints, and SAC will cut the file to those specified cutpoints. CUTIM allows multiple pairs of cutpoints, with an output file for each pair. If there are more than one file in memory, CUTIM produces the cuts on all the files For example, the user can READ three files into SAC, and use CUTIM with four sets of cutpoints; the result will be 12 files in memory.

The start and stop values are given in terms of the independent variable in the data file, normally time. (See the SAC data file format for a discussion of dependent and independent variables.) Unlike CUT, the N option (point number in file) is not available for CUTIM. The following header variables are used to represent certain values of the independent variable:

B:Disk file beginning value;
E:Disk file ending value;
O:Event origin time;
A:First arrival time;
F:Signal end time;
Tn:User defined time picks, n = 0,1...9

B and E are required for each data file in memory. O, A, F, and Tn can be defined for a data file in memory using the CHNHDR command. If one want to select the same time window from a group of data files that have different reference times, one must use the SYNCHRONIZE command before executing the CUTIM command. SYNCHRONIZE modifies the headers so that each file has the same reference time. It also adjusts all of the relative times, including B and E. Then when the files are cut, they will have the same time reference values.

EXAMPLES

The macro below demonstrates several possible uses of CUT. The macro cutim_runs.m, is in the SAC macros directory: ${SACHOME}/macros/. It, along with the results from entering m ${SACHOME}/macros/cutim_runs.m after starting SAC. It is suggested that one runs this macro and compares the results with those from the macro in the help file for CUT:

** ${SACHOME}/macros/cutim_runs.m

echo on

* no cutting
cut off
fg seismo
lh b e a kztime

fg seismo
* begin to end---same as no cutting.
cutim B E
lh b e a kztime

fg seismo
* First 3 secs of the file.
cutim B 0 3
lh b e a kztime

fg seismo
* From 0.5 secs before to 3 secs after first arrival
cutim A -0.5 3
lh b e a kztime

fg seismo
* From 10 to 15 secs relative to zero
cutim 10 15
lh b e a kztime

fg seismo
* From 0.5 to 5 secs relative to disk file start.
cutim b 0.5 5
lh b e a kztime

fg seismo
* First 3 secs of the file and next 3 sec
cutim b 0 3 b 3 6
lh b e a kztime
title "cutim b 0 3 b 3 6"
p1
save cutim_run.pdf
\rm tmp.*

Because CUTIM changes the file(s) in memory, the fg seismo is rquired betweem cals to CUTIM. The lh (LISTHDR) command for seismo with no calls to CUTIM is:

b = 9.459999e+00                        e = 1.945000e+01
a = 1.046400e+01                   kztime = 10:38:14.000

Note that B is nonzero. The numbers are relative to B on input, but relative to zero on output. (If there is no stop reference value, it is assumed to be the same as the start reverence value, in this case B.)

ERROR MESSAGES

  • 1322: Undefined starting cut for file
    • undefined reference value in the header record.
    • this error can be controlled by use of CUTERR command.
    • when this error is off, the disk begin value is used.
  • 1323: Undefined stop cut for file
    • undefined reference value in the header record.
    • this error can be controlled by use of CUTERR command.
    • when this error is off, the disk end value is used.
  • 1324: Start cut less than file begin for file
    • bad CUT parameters.
    • this error can be controlled by use of CUTERR command.
    • when this error is off, the disk begin value is used or zeros are inserted at the beginning of the data.
  • 1325: Stop cut greater than file end for file
    • bad CUT parameters.
    • this error can be controlled by use of CUTERR command.
    • when this error is off, the disk end value is used or zeros are inserted at the end of the data.
  • 1326: Start cut greater than file end for file
    • bad CUT parameters.
    • this error cannot be turned off.
SPECIAL NOTE
Also, some of the above errors can be converted to warnings by the use of the CUTERR command.

LIMITATIONS

There is currently no provision for cutting unevenly-spaced files or spectral files.

SEE COMMANDS

CUT, READ, APK, PLOTPK, SYNCHRONIZE, CUTERR

LATEST REVISION

Version 102.0
Fixes behavior of CUTIM so it matches CUT