Main Page Class Hierarchy Compound List File List Compound Members File Members

# sacputaway.h File Reference

`#include <earthworm.h>`
`#include <sachead.h>`

Go to the source code of this file.

## Compounds
struct | _SAC_AmpPickStruct
struct | _SAC_ArrivalStruct
struct | _SAC_ExtChanStruct
struct | _SAC_OriginStruct
struct | _SAC_PZNum
struct | _SAC_ResponseStruct
struct | _SAC_StationStruct
struct | _SACFileList
## Defines
#define | SACPAB_ALREADY_INIT -4
#define | SACPAB_DIRECTORY_TOO_LONG -5
#define | SACPAB_NULL_POINTERS -6
#define | SACPAB_SCN_ALREADY_OPEN -7
#define | SACPAB_SCN_NOT_OPEN -8
#define | SACPAB_NOT_INIT -9
#define | SACPAB_FOPEN_FAILED -11
#define | SACPAB_OUTPUT_FORMAT_TOO_LONG -12
#define | MAXTXT 150
#define | MIN_OUTBUFFER_LEN 32000
#define | SAC_MAX_POLES_OR_ZEROES 100
#define | PWAVE 123
#define | SWAVE 456
## Typedefs
typedef _SAC_PZNum | SAC_PZNum
typedef _SAC_ResponseStruct | SAC_ResponseStruct
typedef _SACFileList | SACFileListStruct
typedef _SAC_OriginStruct | SAC_OriginStruct
typedef _SAC_ArrivalStruct | SAC_ArrivalStruct
typedef _SAC_AmpPickStruct | SAC_AmpPickStruct
typedef _SAC_StationStruct | SAC_StationStruct
typedef _SAC_ExtChanStruct | SAC_ExtChanStruct
## Functions
int | SACPABase_Debug (int)
int | SACPABase_SetOutputFormat (char *)
int | SACPABase_init (int, char *, int, char *)
int | SACPABase_next_ev (char *, double, SAC_OriginStruct *)
int | SACPABase_next_ev_review (char *, int, SAC_OriginStruct *)
int | SACPABase_next_scn (char *, char *, char *)
int | SACPABase_write_trace (TRACE_REQ *, double)
int | SACPABase_write_parametric (SAC_ArrivalStruct *, int)
int | SACPABase_write_amppicks (SAC_AmpPickStruct *)
int | SACPABase_write_stainfo (SAC_StationStruct *)
int | SACPABase_write_extinfo (SAC_ExtChanStruct *)
int | SACPABase_end_scn (void)
int | SACPABase_end_ev (void)
int | SACPABase_close (void)

## Define Documentation

#define MAXTXT 150

| Definition at line 54 of file sacputaway.h.

#define MIN_OUTBUFFER_LEN 32000

| Definition at line 55 of file sacputaway.h. Referenced by SACPABase_init().

#define PWAVE 123

| Definition at line 60 of file sacputaway.h. Referenced by SACPABase_write_parametric().

#define SAC_MAX_POLES_OR_ZEROES 100

| Definition at line 57 of file sacputaway.h.

#define SACPAB_ALREADY_INIT -4

| Definition at line 43 of file sacputaway.h.

#define SACPAB_DIRECTORY_TOO_LONG -5

| Definition at line 44 of file sacputaway.h.

#define SACPAB_FOPEN_FAILED -11

| Definition at line 49 of file sacputaway.h.

#define SACPAB_NOT_INIT -9

| Definition at line 48 of file sacputaway.h.

#define SACPAB_NULL_POINTERS -6

| Definition at line 45 of file sacputaway.h.

#define SACPAB_OUTPUT_FORMAT_TOO_LONG -12

| Definition at line 50 of file sacputaway.h.

#define SACPAB_SCN_ALREADY_OPEN -7

| Definition at line 46 of file sacputaway.h.

#define SACPAB_SCN_NOT_OPEN -8

| Definition at line 47 of file sacputaway.h.

#define SWAVE 456

| Definition at line 61 of file sacputaway.h. Referenced by SACPABase_write_parametric().

## Typedef Documentation

typedef struct _SAC_AmpPickStruct SAC_AmpPickStruct

typedef struct _SAC_ArrivalStruct SAC_ArrivalStruct

typedef struct _SAC_ExtChanStruct SAC_ExtChanStruct

typedef struct _SAC_OriginStruct SAC_OriginStruct

typedef struct _SAC_PZNum SAC_PZNum

typedef struct _SAC_ResponseStruct SAC_ResponseStruct

typedef struct _SAC_StationStruct SAC_StationStruct

typedef struct _SACFileList SACFileListStruct

| SACFilelist is used to create an ordered list of files. The filelist is used by several SAC macros *

## Function Documentation

int SACPABase_close | ( | void |  | ) |

| Definition at line 1317 of file sacputaway.c. References bSACPABase_init, EW_SUCCESS, FALSE, and logit(). Referenced by SACPA_close(), and WriteSAC_shutdown().

int SACPABase_Debug | ( | int |  | ) |

| FUNCTION PROTOTYPES * Definition at line 450 of file sacputaway.c. References SACPAB_Debug. Referenced by SACPA_close(), SACPA_end_ev(), SACPA_init(), SACPA_next(), SACPA_next_ev(), and WriteSAC_init().

int SACPABase_end_ev | ( | void |  | ) |

| Definition at line 1285 of file sacputaway.c. References CreateSACSupportFiles(), EW_FAILURE, EW_SUCCESS, logit(), and SACPAB_Debug. Referenced by SACPA_end_ev(), and WriteSAC_EndEvent().

int SACPABase_end_scn | ( | void |  | ) |

| Definition at line 1157 of file sacputaway.c. References bSACPABase_scn_open, DB_MAX_PHS_PER_EQ, EW_FAILURE, FALSE, FileIndex, FileList, logit(), MAXTXT, SAChead::npts, SAC_starttime, SacBuffer, SACHEADERSIZE, sacheadp, SwapFloat(), and swapsac(). Referenced by SACPA_next(), and WriteSAC_NextStationForEvent().

int SACPABase_init | ( | int | ,
|  | char * | ,
|  | int | ,
|  | char * |
| ) |

| Definition at line 504 of file sacputaway.c. References SAChead::b, bSACPABase_init, BufferLen, CreateDir(), default_sacheadp, EW_FAILURE, EW_SUCCESS, SAChead::idep, SAChead::iftype, SAChead::iztype, SAChead::ko, SAChead::leven, logit(), MIN_OUTBUFFER_LEN, SAC_IBEGINTIME, SAC_ITIME, SAC_IUNKN, SacBuffer, sacinit(), and TRUE. Referenced by SACPA_init(), and WriteSAC_init().

int SACPABase_next_ev | ( | char * | ,
|  | double | ,
|  | SAC_OriginStruct * |
| ) |

| Definition at line 587 of file sacputaway.c. References CreateDir(), default_sacheadp, _SAC_OriginStruct::dElev, _SAC_OriginStruct::dLat, _SAC_OriginStruct::dLon, SAChead::evdp, SAChead::evel, EVENTID_SIZE, SAChead::evla, SAChead::evlo, EW_FAILURE, EW_SUCCESS, FileIndex, gmtime_ew(), logit(), SAC_Origin, szCurEventID, and _SAC_OriginStruct::tOrigin. Referenced by SACPA_next_ev(), and WriteSAC_StartEvent().

int SACPABase_next_ev_review | ( | char * | ,
|  | int | ,
|  | SAC_OriginStruct * |
| ) |

| Definition at line 662 of file sacputaway.c. References default_sacheadp, _SAC_OriginStruct::dElev, _SAC_OriginStruct::dLat, _SAC_OriginStruct::dLon, SAChead::evdp, SAChead::evel, EVENTID_SIZE, SAChead::evla, SAChead::evlo, EW_FAILURE, EW_SUCCESS, logit(), and szCurEventID.

int SACPABase_next_scn | ( | char * | ,
|  | char * | ,
|  | char * |
| ) |

| Definition at line 700 of file sacputaway.c. References bSACPABase_scn_open, SAChead::cmpaz, SAChead::cmpinc, K_LEN, SAChead::kcmpnm, SAChead::knetwk, SAChead::kstnm, logit(), SAC_szChan, SAC_szSta, sacheadp, SACUNDEF, and TRUE. Referenced by ProduceSAC_NextStationForEvent(), and SACPA_next().

int SACPABase_SetOutputFormat | ( | char * |  | ) |

| Definition at line 471 of file sacputaway.c. References logit().

int SACPABase_write_amppicks | ( | SAC_AmpPickStruct * |  | ) |

| Definition at line 1016 of file sacputaway.c. References EW_FAILURE, EW_SUCCESS, SAChead::kinst, SAChead::kt0, SAChead::kt1, SAChead::kt2, SAChead::kuser0, SAChead::kuser1, logit(), _SAC_AmpPickStruct::PickType, _SAC_AmpPickStruct::PP_amp, _SAC_AmpPickStruct::PPmax_time, _SAC_AmpPickStruct::PPmin_time, SAC_starttime, sacheadp, SAChead::t0, SAChead::t1, SAChead::t2, SAChead::user0, SAChead::user1, _SAC_AmpPickStruct::ZP_amp, and _SAC_AmpPickStruct::ZP_time.

int SACPABase_write_extinfo | ( | SAC_ExtChanStruct * |  | ) |

| Definition at line 1648 of file sacputaway.c. References SAChead::cmpaz, SAChead::cmpinc, _SAC_ExtChanStruct::dAzm, _SAC_ExtChanStruct::dDamping, _SAC_ExtChanStruct::dDip, _SAC_ExtChanStruct::dFullscale, _SAC_ExtChanStruct::dNaturalFrequency, _SAC_ExtChanStruct::dSensitivity, _SAC_ExtChanStruct::iGain, _SAC_ExtChanStruct::iSensorType, logit(), sacheadp, SAChead::user0, SAChead::user1, SAChead::user2, SAChead::user3, SAChead::user4, and SAChead::user5.

int SACPABase_write_parametric | ( | SAC_ArrivalStruct * | ,
|  | int |
| ) |

| Definition at line 968 of file sacputaway.c. References SAChead::a, SAChead::az, _SAC_ArrivalStruct::cFMotion, _SAC_ArrivalStruct::cOnset, _SAC_ArrivalStruct::dAzm, _SAC_ArrivalStruct::dCodaLen, _SAC_ArrivalStruct::dDist, SAChead::dist, EW_FAILURE, SAChead::f, _SAC_ArrivalStruct::iPhaseWt, K_LEN, SAChead::ka, SAChead::kt0, logit(), PWAVE, SAC_starttime, sacheadp, SWAVE, SAChead::t0, and _SAC_ArrivalStruct::tPhase. Referenced by ProduceSAC_NextStationForEvent().

int SACPABase_write_stainfo | ( | SAC_StationStruct * |  | ) |

| Definition at line 1063 of file sacputaway.c. References SAChead::az, _SAC_StationStruct::bResponseIsValid, _SAC_StationStruct::dElev, _SAC_ResponseStruct::dGain, _SAC_PZNum::dImag, SAChead::dist, dist, _SAC_StationStruct::dLat, _SAC_StationStruct::dLon, _SAC_PZNum::dReal, SAChead::evla, SAChead::evlo, geo_to_km(), _SAC_ResponseStruct::iNumPoles, _SAC_ResponseStruct::iNumZeroes, logit(), _SAC_ResponseStruct::Poles, _SAC_StationStruct::pResponse, sacheadp, SACUNDEF, SAChead::stel, SAChead::stla, SAChead::stlo, and _SAC_ResponseStruct::Zeroes. Referenced by ProduceSAC_NextStationForEvent().

int SACPABase_write_trace | ( | TRACE_REQ * | ,
|  | double |
| ) |

| Definition at line 779 of file sacputaway.c. References TRACE_REQ::actLen, BufferLen, TRACE_HEADER::datatype, SAChead::delta, SAChead::e, TRACE_HEADER::endtime, EW_FAILURE, logit(), SAChead::npts, TRACE_HEADER::nsamp, SAChead::nzhour, SAChead::nzjday, SAChead::nzmin, SAChead::nzmsec, SAChead::nzsec, SAChead::nzyear, SAChead::o, TRACE_REQ::pBuf, SAC_Origin, SAC_starttime, SacBuffer, SACHEADERSIZE, sacheadp, SACPAB_Debug, SACUNDEF, TRACE_HEADER::samprate, TRACE_HEADER::starttime, _SAC_OriginStruct::tOrigin, and WaveMsgMakeLocal(). Referenced by ProduceSAC_NextStationForEvent(), and SACPA_next().