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

# gseputaway.c File Reference

`#include <stdio.h>`
`#include <time.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <math.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include "earthworm.h"`
`#include "earthworm_defs.h"`
`#include "trace_buf.h"`
`#include "swap.h"`
`#include "ws_clientII.h"`
`#include "site.h"`
`#include "time_ew.h"`
`#include "gsehead.h"`
`#include "seihead.h"`

Go to the source code of this file.

## Defines
#define | GSE_MISSING_DATA_FLAG 0
## Functions
int | open_gse_file (char *filename, char *msg_id, char *sta_code)
int | write_gse_channel_header (int start_year, int start_month, int start_day, int start_hour, int start_min, double start_sec, char *chan_name, char *chan_type, char *aux_id, long n_samps, double frequency, double calib_value, double calib_period, char *instrum_name, double horiz_angle, double vert_angle)
int | write_gse_channel_data (int n_samps, long *data)
int | write_gse_channel_trailer (void)
int | close_gse_file (void)
int | GSEPA_init (char *output_dir, char *output_format, int debug)
int | GSEPA_next_ev (TRACE_REQ *trace_req, int n_reqs, char *output_dir, char *e_date, char *e_time, int debug)
int | GSEPA_next (TRACE_REQ *trace_req, double gap_thresh, int debug)
int | GSEPA_end_ev (int debug)
int | GSEPA_close (int debug)
## Variables
char * | line_terminator
char * | file_open_mode
char | gse_filename [MAX_DIR_LEN]
char | tmp_filename [MAX_DIR_LEN]
FILE * | gse_fp
int | new_data_channel
long | channel_checksum = 0l
int | data_line_length
int | n_channels
int | channels_written

## Define Documentation

#define GSE_MISSING_DATA_FLAG 0

| Definition at line 51 of file gseputaway.c. Referenced by GSEPA_next().

## Function Documentation

int close_gse_file | ( | void |  | ) | `[static]`

| Definition at line 637 of file gseputaway.c. References FALSE, and TRUE. Referenced by GSEPA_end_ev().

int GSEPA_close | ( | int | debug | ) |

| Definition at line 424 of file gseputaway.c. References EW_SUCCESS, and logit(). Referenced by PA_close().

int GSEPA_end_ev | ( | int | debug | ) |

| Definition at line 372 of file gseputaway.c. References close_gse_file(), EW_FAILURE, EW_SUCCESS, logit(), and rename_ew(). Referenced by PA_end_ev().

int GSEPA_init | ( | char * | output_dir,
|  | char * | output_format,
|  | int | debug
| ) |

| Definition at line 94 of file gseputaway.c. References CreateDir(), EW_FAILURE, EW_SUCCESS, file_open_mode, line_terminator, and logit(). Referenced by PA_init().

int GSEPA_next | ( | TRACE_REQ * | trace_req,
|  | double | gap_thresh,
|  | int | debug
| ) |

| Definition at line 238 of file gseputaway.c. References TRACE_REQ::chan, Found_data::data, Found_data::data_type_code, EW_FAILURE, EW_SUCCESS, FD_BAD_DATATYPE, FD_CHANGED_SRATE, FD_DOUBLE, FD_FLOAT, FD_FOUND_GAP, FD_FOUND_REQUESTED, FD_LONG_INT, FD_NO_MORE_DATA, FD_SHORT_INT, gmtime_ew(), GSE_MISSING_DATA_FLAG, logit(), Found_data::n_samples, TRACE_REQ::net, pa_find_data(), TRACE_REQ::reqEndtime, TRACE_REQ::reqStarttime, Found_data::sample_rate, TRACE_REQ::sta, write_gse_channel_data(), write_gse_channel_header(), and write_gse_channel_trailer(). Referenced by PA_next().

int GSEPA_next_ev | ( | TRACE_REQ * | trace_req,
|  | int | n_reqs,
|  | char * | output_dir,
|  | char * | e_date,
|  | char * | e_time,
|  | int | debug
| ) |

| Definition at line 168 of file gseputaway.c. References channels_written, EW_FAILURE, EW_SUCCESS, logit(), n_channels, TRACE_REQ::net, open_gse_file(), and TRACE_REQ::pBuf. Referenced by PA_next_ev().

int open_gse_file | ( | char * | filename,
|  | char * | msg_id,
|  | char * | sta_code
| ) | `[static]`

| Definition at line 457 of file gseputaway.c. References FALSE, gse_fp, and TRUE. Referenced by GSEPA_next_ev().

int write_gse_channel_data | ( | int | n_samps,
|  | long * | data
| ) | `[static]`

| Definition at line 540 of file gseputaway.c. References channel_checksum, data_line_length, FALSE, new_data_channel, and TRUE. Referenced by GSEPA_next().

int write_gse_channel_header | ( | int | start_year,
|  | int | start_month,
|  | int | start_day,
|  | int | start_hour,
|  | int | start_min,
|  | double | start_sec,
|  | char * | chan_name,
|  | char * | chan_type,
|  | char * | aux_id,
|  | long | n_samps,
|  | double | frequency,
|  | double | calib_value,
|  | double | calib_period,
|  | char * | instrum_name,
|  | double | horiz_angle,
|  | double | vert_angle
| ) | `[static]`

| Definition at line 498 of file gseputaway.c. References FALSE, new_data_channel, and TRUE. Referenced by GSEPA_next().

int write_gse_channel_trailer | ( | void |  | ) | `[static]`

| Definition at line 607 of file gseputaway.c. References data_line_length, FALSE, and TRUE. Referenced by GSEPA_next().

## Variable Documentation

long channel_checksum = 0l`[static]`

| Definition at line 60 of file gseputaway.c. Referenced by write_gse_channel_data().

int channels_written`[static]`

| Definition at line 62 of file gseputaway.c. Referenced by GSEPA_next_ev().

int data_line_length`[static]`

| Definition at line 61 of file gseputaway.c. Referenced by write_gse_channel_data(), and write_gse_channel_trailer().

char* file_open_mode`[static]`

| Definition at line 55 of file gseputaway.c. Referenced by GSEPA_init().

char gse_filename[MAX_DIR_LEN]`[static]`

| Definition at line 56 of file gseputaway.c.

FILE* gse_fp`[static]`

| Definition at line 58 of file gseputaway.c. Referenced by open_gse_file().

char* line_terminator`[static]`

| Definition at line 54 of file gseputaway.c. Referenced by GSEPA_init().

int n_channels`[static]`

| Definition at line 62 of file gseputaway.c. Referenced by GSEPA_next_ev().

int new_data_channel`[static]`

| Definition at line 59 of file gseputaway.c. Referenced by write_gse_channel_data(), and write_gse_channel_header().

char tmp_filename[MAX_DIR_LEN]`[static]`

| Definition at line 57 of file gseputaway.c.