You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.3 KiB
C
91 lines
2.3 KiB
C
4 years ago
|
/*****************************************************************************
|
||
|
* mseed.h
|
||
|
*
|
||
|
* Mini-SEED format implementation
|
||
|
*
|
||
|
* (c) 2000 Andres Heinloo, GFZ Potsdam
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify it
|
||
|
* under the terms of the GNU General Public License as published by the
|
||
|
* Free Software Foundation; either version 2, or (at your option) any later
|
||
|
* version. For more information, see http://www.gnu.org/
|
||
|
*
|
||
|
* ================
|
||
|
* Change log
|
||
|
* ===============
|
||
|
*
|
||
|
* 01.01.2013 Adapted code to CAPS client library requirements (gempa GmbH)
|
||
|
*****************************************************************************/
|
||
|
|
||
|
#ifndef CAPS_MSEED_MSEED_H
|
||
|
#define CAPS_MSEED_MSEED_H
|
||
|
|
||
|
#include "packet.h"
|
||
|
#include "spclock.h"
|
||
|
|
||
|
#include <gempa/caps/mseedpacket.h>
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
|
||
|
namespace Gempa {
|
||
|
namespace CAPS {
|
||
|
|
||
|
/* SEED data encoding types */
|
||
|
enum SEEDDataEncodingType {
|
||
|
DE_ASCII = 0,
|
||
|
DE_INT16 = 1,
|
||
|
DE_INT32 = 3,
|
||
|
DE_FLOAT32 = 4,
|
||
|
DE_FLOAT64 = 5,
|
||
|
DE_STEIM1 = 10,
|
||
|
DE_STEIM2 = 11,
|
||
|
DE_GEOSCOPE24 = 12,
|
||
|
DE_GEOSCOPE163 = 13,
|
||
|
DE_GEOSCOPE164 = 14,
|
||
|
DE_CDSN = 16,
|
||
|
DE_SRO = 30,
|
||
|
DE_DWWSSN = 32
|
||
|
};
|
||
|
|
||
|
|
||
|
struct MSEEDFormat {
|
||
|
MSEEDFormat(const std::string &networkCode, const std::string &stationCode,
|
||
|
const std::string &locationCode, const std::string &channelCode,
|
||
|
unsigned short freqn, unsigned short freqd,
|
||
|
unsigned short packtype_init,
|
||
|
uint8_t recLen);
|
||
|
|
||
|
template<class T>
|
||
|
MSEEDEncoderPacket<T>
|
||
|
get_packet(const SPClock::INT_TIME &it, int usec_correction, int timing_quality) {
|
||
|
void *dataptr = NULL;
|
||
|
int datalen = 0;
|
||
|
unsigned int size = 0;
|
||
|
MSEEDDataRecord *rec = get_buffer(it, usec_correction, timing_quality, dataptr, datalen);
|
||
|
|
||
|
return MSEEDEncoderPacket<T>(rec, size, dataptr, datalen);
|
||
|
}
|
||
|
|
||
|
MSEEDDataRecord *get_buffer(const SPClock::INT_TIME &it, int usec_correction,
|
||
|
int timing_quality,
|
||
|
void *&dataptr, int &datalen);
|
||
|
|
||
|
void updateBuffer(MSEEDDataRecord *rec, int samples, int frames);
|
||
|
|
||
|
std::string networkCode;
|
||
|
std::string stationCode;
|
||
|
std::string locationCode;
|
||
|
std::string channelCode;
|
||
|
int sample_rate_factor;
|
||
|
int sample_rate_multiplier;
|
||
|
unsigned short packType;
|
||
|
int timingQuality;
|
||
|
uint8_t recordLength;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|