#include <stdio.h>#include <ctype.h>#include <stdlib.h>#include <unistd.h>#include <time.h>#include <string.h>#include <assert.h>#include <sys/types.h>#include <netinet/in.h>#include "common.h"
Go to the source code of this file.
Defines | |
| #define | US2S 0.23283064365386962891e-9 |
| #define | FSDH_SIZE 48 |
| #define | BLOCKLEN (1<<(9+seedBlockSizePowerOf2)) |
| #define | NETBO |
| #define | ToNBOs(x) htons(x) |
| #define | ToNBOl(x) htonl(x) |
| #define | ToHBOs(x) ntohs(x) |
| #define | ToHBOl(x) ntohl(x) |
| #define | HEADEROFFSET 16 |
Functions | |
| int | ParseSeedOptions (char *cmd) |
| struct SeedTime * | TimeToSeedTime (double T0, struct SeedTime *sd) |
| double | SeedTimeToTime (struct SeedTime *sd) |
| void | UpdateFSDH (struct FixedSeedDataHeader_b1000_b1001 *fsdh, int seq, int ndata, double CT, double correction, char *station, char *location, char *channel, char *network) |
| FILE * | OpenMSeedChannel (int channel) |
| open an mseed file for output | |
| void | CloseMSeedInt32File (int channel) |
| end a mseed channel file for int32 format The mseed header is updated according to the previous information structure | |
| void | AbortMSeedFile (int channel) |
| cancel a mseed channel file | |
| void | AddMSeedDataInt32 (int channel) |
| process one channel in 32 bits format | |
| void | AddMSeedDataSteim1 (int channel) |
| process one channel in steim1 format | |
| void | CloseMSeedSteim1File (int channel) |
| steim1 compression | |
| void | CloseMSeedFile (int channel) |
| process one channel | |
| void | AddMSeedData (int channel) |
| process one channel | |
Variables | |
| FILE * | mseedChannelFile [MAX_CHANNEL] |
| char | mseedChannelFileName [MAX_CHANNEL][128] |
| int | seedDataFormat = 3 |
| double | staticDt [MAX_CHANNEL] |
| #define BLOCKLEN (1<<(9+seedBlockSizePowerOf2)) |
Definition at line 53 of file seed.c.
Referenced by AddMSeedDataInt32(), CloseMSeedInt32File(), CloseMSeedSteim1File(), ParseSeedOptions(), and UpdateFSDH().
| #define FSDH_SIZE 48 |
| #define HEADEROFFSET 16 |
| #define ToHBOs | ( | x | ) | ntohs(x) |
| #define ToNBOl | ( | x | ) | htonl(x) |
Definition at line 59 of file seed.c.
Referenced by AddMSeedDataInt32(), CloseMSeedSteim1File(), and UpdateFSDH().
| #define ToNBOs | ( | x | ) | htons(x) |
Definition at line 58 of file seed.c.
Referenced by AddMSeedDataInt32(), CloseMSeedSteim1File(), TimeToSeedTime(), and UpdateFSDH().
| void AbortMSeedFile | ( | int | channel | ) |
cancel a mseed channel file
| channel | the channel to cancel |
Definition at line 446 of file seed.c.
References mseedChannelFile, mseedChannelFileName, and PrintDebug.
| void AddMSeedData | ( | int | channel | ) |
process one channel
| channel | the channel to append the sample |
Definition at line 850 of file seed.c.
References ADCDelay(), AddMSeedDataInt32(), AddMSeedDataSteim1(), HWConfigType::digitizer, FilterDelayTime(), HWConfig, DigitizerType::ok, seedDataFormat, HWConfigType::srExp, and staticDt.
Referenced by EndSuperFrame().
| void AddMSeedDataInt32 | ( | int | channel | ) |
process one channel in 32 bits format
| channel | the channel to append the sample |
Definition at line 459 of file seed.c.
References Titan2SRType::base, BLOCKLEN, HWConfigType::channelName, currentTime, HWConfigType::data, Titan2SRType::div, HWConfigType::fieldIdent, HWConfig, infoHeader, HWConfigType::locationName, mseedChannelFile, HWConfigType::networkName, InfoHeaderType::npts, Titan2SRType::npts, OpenMSeedChannel(), PrimaryChannel(), PrintWarning, HWConfigType::srExp, HWConfigType::srObs, ToNBOl, ToNBOs, UpdateFSDH(), US2S, and Titan2TimeType::usecond.
Referenced by AddMSeedData().
| void AddMSeedDataSteim1 | ( | int | channel | ) |
process one channel in steim1 format
| channel | the channel to append the sample |
Definition at line 529 of file seed.c.
References Titan2SRType::base, currentTime, HWConfigType::data, Titan2SRType::div, HWConfig, infoHeader, mseedChannelFile, InfoHeaderType::npts, Titan2SRType::npts, OpenMSeedChannel(), PrimaryChannel(), PrintWarning, HWConfigType::srExp, HWConfigType::srObs, US2S, and Titan2TimeType::usecond.
Referenced by AddMSeedData().
| void CloseMSeedFile | ( | int | channel | ) |
process one channel
| channel | the channel to close |
Definition at line 835 of file seed.c.
References CloseMSeedInt32File(), CloseMSeedSteim1File(), and seedDataFormat.
Referenced by FlushDataFiles().
| void CloseMSeedInt32File | ( | int | channel | ) |
end a mseed channel file for int32 format The mseed header is updated according to the previous information structure
| channel | the channel to close |
Definition at line 348 of file seed.c.
References BLOCKLEN, InfoHeaderType::correctionMethod, FileName(), fileNameOptions, GetInterpolatedShift(), infoHeader, INTERPOLATION_CORRECTION, mseedChannelFile, mseedChannelFileName, NO_TIME_CORRECTION, noWrite, InfoHeaderType::npts, InfoHeaderType::otshift, PrintDebug, PrintLog, PrintWarning, Rename(), SeedTimeToTime(), staticDt, station, time2str(), UpdateFSDH(), and UpdateInfoHeader().
Referenced by CloseMSeedFile().
| void CloseMSeedSteim1File | ( | int | channel | ) |
steim1 compression
| channel | the channel to compress |
Definition at line 572 of file seed.c.
References Titan2SRType::base, BLOCKLEN, Titan2SRType::div, FileName(), fileNameOptions, fout, GetInterpolatedShift(), HEADEROFFSET, HWConfig, infoHeader, mseedChannelFile, mseedChannelFileName, ndata, NO_TIME_CORRECTION, InfoHeaderType::npts, InfoHeaderType::otshift, PrintError, PrintLog, PrintWarning, HWConfigType::srExp, staticDt, station, ToNBOl, ToNBOs, UpdateFSDH(), and UpdateInfoHeader().
Referenced by CloseMSeedFile().
| FILE* OpenMSeedChannel | ( | int | channel | ) |
open an mseed file for output
| channel | the channel number |
Definition at line 320 of file seed.c.
References ADD_LOCATION_CODE, ADD_NETWORK_CODE, FILE_BUFFER_SIZE, fileNameOptions, InitInfoHeader(), mseedChannelFile, mseedChannelFileName, OpenTempFile(), and PrintError.
Referenced by AddMSeedDataInt32(), and AddMSeedDataSteim1().
| int ParseSeedOptions | ( | char * | cmd | ) |
Definition at line 123 of file seed.c.
References BLOCKLEN, PrintDebug, PrintError, seedBlockSizePowerOf2, and seedDataFormat.
Referenced by ParseOptions().
| double SeedTimeToTime | ( | struct SeedTime * | sd | ) |
| struct SeedTime* TimeToSeedTime | ( | double | T0, | |
| struct SeedTime * | sd | |||
| ) | [read] |
| void UpdateFSDH | ( | struct FixedSeedDataHeader_b1000_b1001 * | fsdh, | |
| int | seq, | |||
| int | ndata, | |||
| double | CT, | |||
| double | correction, | |||
| char * | station, | |||
| char * | location, | |||
| char * | channel, | |||
| char * | network | |||
| ) |
Definition at line 219 of file seed.c.
References BLOCKLEN, FSDH_SIZE, HEADEROFFSET, seedBlockSizePowerOf2, seedDataFormat, TimeToSeedTime(), ToNBOl, and ToNBOs.
Referenced by AddMSeedDataInt32(), CloseMSeedInt32File(), and CloseMSeedSteim1File().
| FILE* mseedChannelFile[MAX_CHANNEL] |
Initial value:
{
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
}
Definition at line 35 of file seed.c.
Referenced by AbortMSeedFile(), AddMSeedDataInt32(), AddMSeedDataSteim1(), CloseMSeedInt32File(), CloseMSeedSteim1File(), and OpenMSeedChannel().
| char mseedChannelFileName[MAX_CHANNEL][128] |
Definition at line 42 of file seed.c.
Referenced by AbortMSeedFile(), CloseMSeedInt32File(), CloseMSeedSteim1File(), and OpenMSeedChannel().
| int seedDataFormat = 3 |
Definition at line 45 of file seed.c.
Referenced by AddMSeedData(), CloseMSeedFile(), ParseSeedOptions(), and UpdateFSDH().
| double staticDt[MAX_CHANNEL] |
Definition at line 47 of file seed.c.
Referenced by AddMSeedData(), CloseMSeedInt32File(), and CloseMSeedSteim1File().
1.5.6