# pssac

Plot seismograms in SAC format

## Synopsis

gmt pssac [ saclist|SACfiles ] -J parameters -R region [ -B[p|s]parameters ] [ -C[t0/t1] ] [ -D dx[/dy] ] [ -E a|b|k|d|n[n]|u[n] ] [ -F[i][q][r] ] [ -G[p|n][+g fill][+z zero][+t t0/t1] ] [ -K ] [ -M size[u][/alpha] ] [ -O ] [ -P ] [ -Q ] [ -S[i]scale ] [ -T[+r reduce_vel][+s shift][+t n] ] [ -U[stamp] ] [ -V[level] ] [ -W pen ] [ -X[a|c|f|r][xshift] ] [ -Y[a|c|f|r][yshift] ] [ -h headers ] [ -p flags ] [ -t transp ] [ --PAR=value ]

## Description

Reads SACfiles in SAC format or reads filenames and controlling parameters from saclist [or standard input] and will plot seismograms on a map.

## Required Arguments

SACfiles

  SAC files to plot on a map. Only evenly spaced SAC data is supported.

saclist

  One ASCII data table file holding a number of data columns. If saclist is not given then we read from standard input. Parameters are expected to be in the following columns:

  > filename [X Y [pen]]

  filename is the name of SAC file to plot. X and Y are the position of seismograms to plot on a map. On linear plots, the default X is the begin time of SAC file, which will be adjusted if -T option is used, the default Y is determined by -E option. On geographic plots, the default X and Y are station longitude and latitude specified in SAC header. The X and Y given here will override the position determined by command line options. pen, if given, will override the pen from -W option for current SAC file only.

-J parameters

  Specify the projection. (See full description) (See cookbook summary) (See projections table).

-R west/east/south/north[/zmin/zmax][+r][+u unit]

> Specify the region of interest.

> The region may be specified in one of several ways:

> 1. -R west/east/south/north. This is the standard way to specify geographic regions when using map projections where meridians and parallels are rectilinear. The coordinates may be specified in decimal degrees or in [±]dd:mm[:ss.xxx][W|E|S|N] format.

> 2. -R west/south/east/north+r. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and upper right corner geographic coordinates, followed by the modifier +r. This form guarantees a rectangular map even though lines of equal longitude and latitude are not straight lines.

> 3. -R g or -R d. These forms can be used to quickly specify the global domain (0/360 for -Rg and -180/+180 for -Rd in longitude, with -90/+90 in latitude).

> 4. -R code1,code2,…[+e|r|R incs]. This indirectly supplies the region by consulting the DCW (Digital Chart of the World) database and derives the bounding regions for one or more countries given by the codes. Simply append one or more comma-separated countries using either the two-character ISO 3166-1 alpha-2 convention (e.g., NO) or the full country name (e.g., Norway). To select a state within a country (if available), append .state (e.g, US.TX), or the full state name (e.g., Texas). To specify a whole continent, spell out the full continent name (e.g., -RAfrica). Finally, append any DCW collection abbreviations or full names for the extent of the collection or named region. All names are case-insensitive. The following modifiers can be appended:

>    > - +r to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no adjustment]. For example, -R FR+r1 will select the national bounding box of France rounded to nearest integer degree, where inc can be positive to expand the region or negative to shrink the region.

>    > - +R to adjust the region by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension], where inc can be positive to expand the region or negative to shrink the region.

>    > - +e to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc, while ensuring that the bounding box is adjusted by at least 0.25 times the increment [default is no adjustment], where inc can be positive to expand the region or negative to shrink the region.

> 5. -R xmin/xmax/ymin/ymax[+u unit] specifies a region in projected units (e.g., UTM meters) where xmin/xmax/ymin/ymax are Cartesian projected coordinates compatible with the chosen projection (-J) and unit is an allowable distance unit [e]; we inversely project to determine the actual rectangular geographic region. For projected regions centered on (0,0) you may use the short-hand -R halfwidth[/halfheight]+u unit, where halfheight defaults to halfwidth if not given. This short-hand requires the +u modifier.

> 6. -R justify lon0/lat0/nx/ny, where justify is a 2-character combination of L|C|R (for left, center, or right) and T|M|B (for top, middle, or bottom) (e.g., BL for lower left). The two character code justify indicates which point on a rectangular region region the lon0/lat0 coordinates refer to and the grid dimensions nx and ny are used with grid spacings given via -I to create the corresponding region. This method can be used when creating grids. For example, -RCM 25/25/50/50 specifies a 50x50 grid centered on 25,25.

> 7. -R gridfile. This will copy the domain settings found for the grid in specified file. Note that depending on the nature of the calling module, this mechanism will also set grid spacing and possibly the grid registration (see Grid registration: The -r option).

> 8. -Ra[uto] or -Re[xact]. Under modern mode, and for plotting modules only, you can automatically determine the region from the data used. You can either get the exact area using -Re [Default if no -R is given] or a slightly larger area sensibly rounded outwards to the next multiple of increments that depend on the data range using -Ra.

## Optional Arguments

-B[p|s]parameters

  Set map boundary frame and axes attributes. (See full description) (See cookbook information).

-C[t0/t1]

  Read and plot seismograms in timewindow between t0 and t1 only. t0 and t1 are relative to a reference time specified by -T. If -T option is not specified, use the reference time (kzdate and kztime) defined in SAC header instead. If only -C is used, t0/t1 is determined as xmin/xmax from -R option.

-D dx[/dy]

  Offset seismogram positions by the given mount dx/dy [Default is no offset]. If dy is not given it is set equal to dx.

-Ea|b|k|d|n[n]|u[n]

  Choose profile type (the type of Y axis).

  > a: azimuth profile.

  > b: back-azimuth profile.

  > k: epicentral distance (in km) profile.

  > d: epicentral distance (in degree) profile.

  > n: trace number profile. The Y position of first trace is numbered as n [Default n is 0].

  > u: user defined profile. The Y positions are determined by SAC header variable usern, default using user0.

-F[i][q][r]

  Data preprocess before plotting.

  > i: integral

  > q: square

  > r: remove mean value

  i|q|r can repeat multiple times. For example, -Frii will convert acceleration to displacement. The order of i|q|r controls the order of the data processing.

-G[p|n][+g fill][+z zero][+t t0/t1]

  Paint positive or negative portion of traces. If only -G is used, default to fill the positive portion black.

  > p|n controls the painting of positive portion or negative portion. Repeat -G option to specify fills for positive and negative portions, respectively.

  > +g fill: color to fill

  > +t t0/t1: paint traces between t0 and t1 only. The reference time of t0 and t1 is determined by -T option.

  > +z zero: define zero line. From zero to top is positive portion, from zero to bottom is negative portion.

-M size[u][/alpha]

  Vertical scaling.

  > size[u]: scale all traces size[u] on a map. The default unit is PROJ_LENGTH_UNIT. The scaling factor is defined as `yscale = size*(north-south)/(depmax-depmin)/map_height`.

  > size/alpha:

  > > alpha < 0, use the same scaling factor for all traces. The scaling factor will scale the first trace to size[u].

  > > alpha = 0, multiply all traces by size. No unit is allowed.

  > > alpha > 0, multiply all traces by `size*r^alpha`, r is the distance range in km.

-Q

  Plot traces vertically.

-S[i]scale

  Sets time scale in seconds per unit while plotting on geographic plots. Append c, i, or p to indicate cm, inch or points as the unit. Use PROJ_LENGTH_UNIT if unit is omitted. Use -Si scale to give the reciprocal scale, i.e. cm per second or inch per second.

-T[+r reduce_vel][+s shift][+t n]

  Time alignment and shift.

  > +r reduce_vel: reduce velocity in km/s.

  > +s shift: shift all traces by shift seconds.

  > +t tmark: align all trace along time mark. tmark are -5(b), -4(e), -3(o), -2(a), 0-9(t0-t9).

-U[label|+c][+j justify][+o dx[/dy]][+t text]

  Draw GMT time stamp logo on plot. (See full description) (See cookbook information).

-V[level]

  Select verbosity level [w]. (See full description) (See cookbook information).

-W pen

  Set pen attributes for all traces unless overruled by pen specified in saclist. [Defaults: width = 0.25p, color = black, style = solid].

-X[a|c|f|r][xshift]

  Shift plot origin. (See full description) (See cookbook information).

-Y[a|c|f|r][yshift]

  Shift plot origin. (See full description) (See cookbook information).

-h[i|o][n][+c][+d][+m segheader][+r remark][+t title] (more …)

  Skip or produce header record(s).

-p[x|y|z]azim[/elev[/zlevel]][+w lon0/lat0[/z0]][+v x0/y0] (more …)

  Select perspective view.

-t transp[/transp2] (more …)

  Set transparency level(s) in percent.

-^ or just -

  Print a short message about the syntax of the command, then exit (Note: on Windows just use -).

-+ or just +

  Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exit.

-? or no arguments

  Print a complete usage (help) message, including the explanation of all options, then exit.

--PAR=value

  Temporarily override a GMT default setting; repeatable. See gmt.conf for parameters.

## Classic Mode Arguments

These options are used to manipulate the building of layered GMT PostScript plots in classic mode. They are not available when using GMT modern mode.

-K (more …)

  Do not finalize the PostScript plot.

-O (more …)

  Append to existing PostScript plot.

-P (more …)

  Select “Portrait” plot orientation.

## Examples

To plot a single seismogram seis.SAC (generated by SAC command `funcgen seismogram`) and paint positive portion black and negative portion red:

    gmt pssac seis.SAC -JX10c/5c -R9/20/-2/2 -Baf -Fr -Gp+gblack -Gn+gred > single.ps

To plot several seismograms (generated by SAC command `datagen sub tele *.z`) on a distance profile:

    gmt pssac *.z -R200/1600/12/45 -JX15c/5c -Bx200+l'T(s)' -By5+lDegree -BWSen \
        -Ed -M1.5c -W0.5p,red > distance_profile.ps

To plot seismograms (generated by SAC command `datagen sub tele *.z`) on a geographic map:

    gmt pssac *.z -JM15c -R-120/-40/35/65 -Baf -M1i -S300c -K > map.ps
    saclst stlo stla f *.z | gmt psxy -J -R -St0.4c -Gblack -i1,2 -O >> map.ps

## References

Refer to SAC User Manual for more details on SAC format and SAC header variables.

## Authors

Dongdong Tian, School of Earth and Space Sciences, University of Science and Technology of China, Hefei, Anhui, China

## See Also

psmeca, pspolar, pscoupe, gmt, psbasemap, psxy