sis.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <assert.h>
#include <signal.h>
#include "common.h"

Include dependency graph for sis.c:

Go to the source code of this file.

Defines

#define CR   13
#define LF   10
#define BLOCK_LENGTH   1024
#define BLOCK_SIZE   (BLOCK_LENGTH/sizeof(int32_t))

Functions

FILE * OpenSisBinFile (void)
 open a sisbin file for output
void AbortSisBinFile (void)
 close and remove the file
void AddSisData (int channel)
 process one channel
char * time2strSismalp (double temps)
 format the time for sismalp ndx file
void CloseSisFile (void)
 end a binary file After closing the file, the image is built and the bin file is removed.

Variables

int64_t avg [MAX_CHANNEL]
int64_t ndata [MAX_CHANNEL]
FILE * sisBinFile = NULL
char sisBinFileName [255]
int sisOffset [MAX_CHANNEL]


Define Documentation

#define BLOCK_LENGTH   1024

Definition at line 56 of file sis.c.

#define BLOCK_SIZE   (BLOCK_LENGTH/sizeof(int32_t))

Definition at line 57 of file sis.c.

Referenced by CloseSisFile().

#define CR   13

Definition at line 44 of file sis.c.

Referenced by CloseSisFile().

#define LF   10

Definition at line 45 of file sis.c.

Referenced by CloseSisFile().


Function Documentation

void AbortSisBinFile ( void   ) 

close and remove the file

Definition at line 89 of file sis.c.

References sisBinFile, and sisBinFileName.

Referenced by AddSisData().

void AddSisData ( int  channel  ) 

process one channel

Parameters:
channel the channel to process

Definition at line 101 of file sis.c.

References AbortSisBinFile(), avg, CloseSisFile(), HWConfigType::data, HWConfig, infoHeader, MAX_CHANNEL, ndata, InfoHeaderType::npts, Titan2SRType::npts, OpenSisBinFile(), PrintError, removeMean, sisBinFile, sisBinFileName, HWConfigType::srExp, and HWConfigType::srObs.

Referenced by EndSuperFrame().

Here is the call graph for this function:

void CloseSisFile ( void   ) 

end a binary file After closing the file, the image is built and the bin file is removed.

Definition at line 173 of file sis.c.

References ADD_CHANNEL_CODE, avg, Titan2SRType::base, BLOCK_SIZE, correctedTime, CR, Titan2SRType::div, FileName(), fileNameOptions, infoHeader, LF, MAX_CHANNEL, ndata, InfoHeaderType::npts, oldHWConfig, PrintError, PrintLog, removeMean, sisBinFile, sisBinFileName, sisOffset, skipTime, HWConfigType::srExp, station, time2strSismalp(), UpdateInfoHeader(), and Titan2TimeType::usecond.

Referenced by AddSisData(), and FlushDataFiles().

Here is the call graph for this function:

FILE* OpenSisBinFile ( void   ) 

open a sisbin file for output

Returns:
the correponding FILE* pointer, NULL on error

Definition at line 61 of file sis.c.

References avg, FILE_BUFFER_SIZE, HWConfig, infoHeader, InitInfoHeader(), MAX_CHANNEL, ndata, InfoHeaderType::npts, Titan2SRType::npts, OpenTempFile(), sisBinFile, sisBinFileName, and HWConfigType::srObs.

Referenced by AddSisData().

Here is the call graph for this function:

char* time2strSismalp ( double  temps  ) 

format the time for sismalp ndx file

Parameters:
temps the time to represent
Returns:
the string

Definition at line 156 of file sis.c.

Referenced by CloseSisFile().


Variable Documentation

int64_t avg[MAX_CHANNEL]

Definition at line 49 of file sis.c.

Referenced by AddSisData(), CloseSisFile(), and OpenSisBinFile().

int64_t ndata[MAX_CHANNEL]

Definition at line 50 of file sis.c.

Referenced by AddSisData(), CloseMSeedSteim1File(), CloseSisFile(), OpenSisBinFile(), and PulseFilter().

FILE* sisBinFile = NULL

Definition at line 52 of file sis.c.

Referenced by AbortSisBinFile(), AddSisData(), CloseSisFile(), and OpenSisBinFile().

char sisBinFileName[255]

Definition at line 53 of file sis.c.

Referenced by AbortSisBinFile(), AddSisData(), CloseSisFile(), and OpenSisBinFile().

int sisOffset[MAX_CHANNEL]

Definition at line 54 of file sis.c.

Referenced by CloseSisFile().


Generated on Tue Jul 22 23:11:57 2008 for Titan2Reader by  doxygen 1.5.6