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

# seiutils.c File Reference

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

Go to the source code of this file.

## Functions
void | write_seisan (FILE *fp, long length, void *data)
int | open_seisan_file (char *od, char *nn, double st, double dur, int onn)
int | add_seisan_channel (char *chan_name, char *chan_type)
int | start_seisan_channel (char *chan_name, char *chan_type, double start_time, double sample_rate, long n_samples)
void | add_seisan_channel_data (long data_len, long *data)
int | end_seisan_channel (void)
int | close_seisan_file (void)
int | pa_find_data (TRACE_REQ *trace_req, double sample_time, struct Found_data *data)
## Variables
char | output_dir [MAX_DIR_LEN]
char | tmp_dirname [MAX_DIR_LEN]
char | network_name [50]
double | start_time
double | duration
int | n_channels
Sei_channel_details * | channels
Sei_channel_details * | current_channel
FILE * | channel_fp
int | output_native_numbers
int | tmp_dir_count = 0

## Function Documentation

int add_seisan_channel | ( | char * | chan_name,
|  | char * | chan_type
| ) |

| Definition at line 142 of file seiutils.c. References channels, duration, FALSE, n_channels, start_time, and TRUE. Referenced by SEIPA_next_ev().

void add_seisan_channel_data | ( | long | data_len,
|  | long * | data
| ) |

| Definition at line 249 of file seiutils.c. References current_channel, Sei_channel_details::n_samples, Sei_channel_details::n_written, output_native_numbers, and SwapLong(). Referenced by SEIPA_next().

int close_seisan_file | ( | void |  | ) |

| Definition at line 325 of file seiutils.c. References channels, FALSE, gmtime_ew(), MAX_DIR_LEN, n_channels, network_name, output_native_numbers, SEISAN_MISSING_DATA_FLAG, start_time, SwapLong(), TRUE, and write_seisan(). Referenced by SEIPA_end_ev().

int end_seisan_channel | ( | void |  | ) |

| Definition at line 283 of file seiutils.c. References current_channel, FALSE, Sei_channel_details::n_samples, Sei_channel_details::n_written, output_native_numbers, SEISAN_MISSING_DATA_FLAG, SwapLong(), and TRUE. Referenced by SEIPA_next().

int open_seisan_file | ( | char * | od,
|  | char * | nn,
|  | double | st,
|  | double | dur,
|  | int | onn
| ) |

| Definition at line 105 of file seiutils.c. References channels, CreateDir(), current_channel, duration, EW_SUCCESS, FALSE, n_channels, output_native_numbers, start_time, and TRUE. Referenced by SEIPA_next_ev().

int pa_find_data | ( | TRACE_REQ * | trace_req,
|  | double | sample_time,
|  | struct Found_data * | data
| ) |

| Definition at line 540 of file seiutils.c. References TRACE_REQ::actLen, Found_data::data, Found_data::data_type_code, TRACE_HEADER::datatype, TRACE_HEADER::endtime, 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, logit(), Found_data::n_samples, TRACE_HEADER::nsamp, TRACE_REQ::pBuf, Found_data::sample_rate, TRACE_HEADER::samprate, start_time, TRACE_HEADER::starttime, Found_data::trace_hdr, and WaveMsgMakeLocal(). Referenced by GSEPA_next(), and SEIPA_next().

int start_seisan_channel | ( | char * | chan_name,
|  | char * | chan_type,
|  | double | start_time,
|  | double | sample_rate,
|  | long | n_samples
| ) |

| Definition at line 189 of file seiutils.c. References Sei_channel_details::channel_count, channel_fp, channels, current_channel, FALSE, Sei_channel_details::filename, n_channels, Sei_channel_details::n_samples, output_native_numbers, Sei_channel_details::sample_rate, Sei_channel_details::start_time, start_time, SwapLong(), and TRUE. Referenced by SEIPA_next().

void write_seisan | ( | FILE * | fp,
|  | long | length,
|  | void * | data
| ) | `[static]`

| Definition at line 486 of file seiutils.c. References output_native_numbers, and SwapLong(). Referenced by close_seisan_file().

## Variable Documentation

FILE* channel_fp`[static]`

| Definition at line 81 of file seiutils.c. Referenced by start_seisan_channel().

struct Sei_channel_details* channels`[static]`

| Definition at line 79 of file seiutils.c. Referenced by add_seisan_channel(), close_seisan_file(), open_seisan_file(), and start_seisan_channel().

struct Sei_channel_details* current_channel`[static]`

| Definition at line 80 of file seiutils.c. Referenced by add_seisan_channel_data(), end_seisan_channel(), open_seisan_file(), and start_seisan_channel().

double duration`[static]`

| Definition at line 77 of file seiutils.c. Referenced by add_seisan_channel(), and open_seisan_file().

int n_channels`[static]`

| Definition at line 78 of file seiutils.c. Referenced by add_seisan_channel(), close_seisan_file(), open_seisan_file(), and start_seisan_channel().

char network_name[50]`[static]`

| Definition at line 75 of file seiutils.c. Referenced by close_seisan_file().

char output_dir[MAX_DIR_LEN]`[static]`

| Definition at line 73 of file seiutils.c.

int output_native_numbers`[static]`

| Definition at line 82 of file seiutils.c. Referenced by add_seisan_channel_data(), close_seisan_file(), end_seisan_channel(), open_seisan_file(), start_seisan_channel(), and write_seisan().

double start_time`[static]`

| Definition at line 76 of file seiutils.c. Referenced by add_seisan_channel(), close_seisan_file(), open_seisan_file(), pa_find_data(), and start_seisan_channel().

int tmp_dir_count = 0`[static]`

| Definition at line 83 of file seiutils.c.

char tmp_dirname[MAX_DIR_LEN]`[static]`

| Definition at line 74 of file seiutils.c.