[seiscomp, scanloc] Install, add .gitignore
This commit is contained in:
47
include/seiscomp/io/records/binaryrecord.h
Normal file
47
include/seiscomp/io/records/binaryrecord.h
Normal file
@ -0,0 +1,47 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) gempa GmbH *
|
||||
* All rights reserved. *
|
||||
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
|
||||
* *
|
||||
* GNU Affero General Public License Usage *
|
||||
* This file may be used under the terms of the GNU Affero *
|
||||
* Public License version 3.0 as published by the Free Software Foundation *
|
||||
* and appearing in the file LICENSE included in the packaging of this *
|
||||
* file. Please review the following information to ensure the GNU Affero *
|
||||
* Public License version 3.0 requirements will be met: *
|
||||
* https://www.gnu.org/licenses/agpl-3.0.html. *
|
||||
* *
|
||||
* Other Usage *
|
||||
* Alternatively, this file may be used in accordance with the terms and *
|
||||
* conditions contained in a signed written agreement between you and *
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef SC_IO_BINARYRECORD_H
|
||||
#define SC_IO_BINARYRECORD_H
|
||||
|
||||
#include <seiscomp/core/genericrecord.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace IO {
|
||||
|
||||
|
||||
DEFINE_SMARTPOINTER(BinaryRecord);
|
||||
|
||||
|
||||
class SC_SYSTEM_CORE_API BinaryRecord : public GenericRecord {
|
||||
public:
|
||||
//! Default Constructor
|
||||
BinaryRecord();
|
||||
|
||||
public:
|
||||
void read(std::istream &in);
|
||||
void write(std::ostream &out);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
188
include/seiscomp/io/records/mseedrecord.h
Normal file
188
include/seiscomp/io/records/mseedrecord.h
Normal file
@ -0,0 +1,188 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) gempa GmbH *
|
||||
* All rights reserved. *
|
||||
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
|
||||
* *
|
||||
* GNU Affero General Public License Usage *
|
||||
* This file may be used under the terms of the GNU Affero *
|
||||
* Public License version 3.0 as published by the Free Software Foundation *
|
||||
* and appearing in the file LICENSE included in the packaging of this *
|
||||
* file. Please review the following information to ensure the GNU Affero *
|
||||
* Public License version 3.0 requirements will be met: *
|
||||
* https://www.gnu.org/licenses/agpl-3.0.html. *
|
||||
* *
|
||||
* Other Usage *
|
||||
* Alternatively, this file may be used in accordance with the terms and *
|
||||
* conditions contained in a signed written agreement between you and *
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef SEISCOMP_IO_RECORDS_MSEEDRECORD_H
|
||||
#define SEISCOMP_IO_RECORDS_MSEEDRECORD_H
|
||||
|
||||
|
||||
#include <seiscomp/core/record.h>
|
||||
#include <seiscomp/core/typedarray.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
typedef struct MSRecord_s MSRecord;
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace IO {
|
||||
|
||||
|
||||
DEFINE_SMARTPOINTER(MSeedRecord);
|
||||
|
||||
|
||||
class SC_SYSTEM_CORE_API LibmseedException : public Core::StreamException {
|
||||
public:
|
||||
LibmseedException() : Core::StreamException("libmseed error") {}
|
||||
LibmseedException(std::string what) : Core::StreamException(what) {}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Uses seiscomp error logging as component MSEEDRECORD.
|
||||
**/
|
||||
class SC_SYSTEM_CORE_API MSeedRecord: public Record {
|
||||
DECLARE_SC_CLASS(MSeedRecord)
|
||||
|
||||
public:
|
||||
//! Initializing Constructor
|
||||
MSeedRecord(Array::DataType dt = Array::DOUBLE, Hint h = SAVE_RAW);
|
||||
|
||||
//! Initializing Constructor
|
||||
MSeedRecord(MSRecord *msrec, Array::DataType dt = Array::DOUBLE, Hint h = SAVE_RAW);
|
||||
|
||||
//! Copy Constructor
|
||||
MSeedRecord(const MSeedRecord &ms);
|
||||
|
||||
//! Copy-from-Record Constructor
|
||||
MSeedRecord(const Record &rec, int reclen=512);
|
||||
|
||||
//! Destructor
|
||||
~MSeedRecord() override;
|
||||
|
||||
|
||||
public:
|
||||
//! Assignment Operator
|
||||
MSeedRecord& operator=(const MSeedRecord &ms);
|
||||
|
||||
void setNetworkCode(std::string net) override;
|
||||
|
||||
//! Sets the station code
|
||||
void setStationCode(std::string sta) override;
|
||||
|
||||
//! Sets the location code
|
||||
void setLocationCode(std::string loc) override;
|
||||
|
||||
//! Sets the channel code
|
||||
void setChannelCode(std::string cha) override;
|
||||
|
||||
//! Sets the start time
|
||||
void setStartTime(const Core::Time& time) override;
|
||||
|
||||
//! Returns the sequence number
|
||||
int sequenceNumber() const;
|
||||
|
||||
//! Sets the sequence number
|
||||
void setSequenceNumber(int seqno);
|
||||
|
||||
//! Returns the data quality
|
||||
char dataQuality() const;
|
||||
|
||||
//! Sets the data quality
|
||||
void setDataQuality(char qual);
|
||||
|
||||
//! Returns the sample rate factor
|
||||
int sampleRateFactor() const;
|
||||
|
||||
//! Sets the sample rate factor
|
||||
void setSampleRateFactor(int srfact);
|
||||
|
||||
//! Returns the sample rate multiplier
|
||||
int sampleRateMultiplier() const;
|
||||
|
||||
//! Sets the sample rate multiplier
|
||||
void setSampleRateMultiplier(int srmult);
|
||||
|
||||
//! Returns the byteorder
|
||||
int8_t byteOrder() const;
|
||||
|
||||
//! Returns the encoding code
|
||||
int8_t encoding() const;
|
||||
|
||||
//! Returns the sample rate numerator
|
||||
int sampleRateNumerator() const;
|
||||
|
||||
//! Returns the sample rate denominator
|
||||
int sampleRateDenominator() const;
|
||||
|
||||
//! Returns the number of data frames
|
||||
int frameNumber() const;
|
||||
|
||||
//! Returns the end time of data samples
|
||||
const Seiscomp::Core::Time& endTime() const;
|
||||
|
||||
//! Returns the length of a Mini SEED record
|
||||
int recordLength() const;
|
||||
|
||||
//! Returns the leap seconds
|
||||
int leapSeconds() const;
|
||||
|
||||
//! Returns a nonmutable pointer to the data samples if the data is available; otherwise 0
|
||||
//! (the data type is independent from the original one and was given by the DataType flag in the constructor)
|
||||
const Array* data() const override;
|
||||
|
||||
const Array* raw() const override;
|
||||
|
||||
//! Frees the memory occupied by the decoded data samples.
|
||||
//! ! Use it with the hint SAVE_RAW only otherwise the data samples cannot be redecoded!
|
||||
void saveSpace() const override;
|
||||
|
||||
//! Returns a deep copy of the calling object.
|
||||
Record* copy() const;
|
||||
|
||||
//! Sets flag specifying the encoding type of the write routine.
|
||||
//! true(default) -> use the encoding of the original record; false -> use the type of the data
|
||||
void useEncoding(bool flag);
|
||||
|
||||
//! Sets the record length used for the output
|
||||
void setOutputRecordLength(int reclen);
|
||||
|
||||
//! Extract the packed MSeedRecord attributes from the given stream
|
||||
void read(std::istream &in);
|
||||
|
||||
//! Encode the record into the given stream
|
||||
void write(std::ostream& out);
|
||||
|
||||
private:
|
||||
void _setDataAttributes(int reclen, char *data) const;
|
||||
|
||||
private:
|
||||
CharArray _raw;
|
||||
mutable ArrayPtr _data;
|
||||
int _seqno;
|
||||
char _rectype;
|
||||
int _srfact;
|
||||
int _srmult;
|
||||
int8_t _byteorder;
|
||||
int8_t _encoding;
|
||||
int _srnum;
|
||||
int _srdenom;
|
||||
int _reclen;
|
||||
int _nframes;
|
||||
int _leap;
|
||||
Seiscomp::Core::Time _etime;
|
||||
bool _encodingFlag;
|
||||
};
|
||||
|
||||
} // namespace IO
|
||||
} // namespace Seiscomp
|
||||
|
||||
#endif
|
89
include/seiscomp/io/records/sacrecord.h
Normal file
89
include/seiscomp/io/records/sacrecord.h
Normal file
@ -0,0 +1,89 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) gempa GmbH *
|
||||
* All rights reserved. *
|
||||
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
|
||||
* *
|
||||
* GNU Affero General Public License Usage *
|
||||
* This file may be used under the terms of the GNU Affero *
|
||||
* Public License version 3.0 as published by the Free Software Foundation *
|
||||
* and appearing in the file LICENSE included in the packaging of this *
|
||||
* file. Please review the following information to ensure the GNU Affero *
|
||||
* Public License version 3.0 requirements will be met: *
|
||||
* https://www.gnu.org/licenses/agpl-3.0.html. *
|
||||
* *
|
||||
* Other Usage *
|
||||
* Alternatively, this file may be used in accordance with the terms and *
|
||||
* conditions contained in a signed written agreement between you and *
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef SEISCOMP_IO_RECORDS_SACRECORD_H
|
||||
#define SEISCOMP_IO_RECORDS_SACRECORD_H
|
||||
|
||||
|
||||
#include <seiscomp/core/record.h>
|
||||
#include <seiscomp/core/array.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace IO {
|
||||
|
||||
|
||||
DEFINE_SMARTPOINTER(SACRecord);
|
||||
|
||||
|
||||
class SC_SYSTEM_CORE_API SACRecord : public Record {
|
||||
public:
|
||||
//! Initializing Constructor
|
||||
SACRecord(const std::string &net = "AB", const std::string &sta = "12345",
|
||||
const std::string &loc = "", const std::string &cha = "XYZ",
|
||||
Core::Time stime = Core::Time(), double fsamp=0., int tqual=-1,
|
||||
Array::DataType dt = Array::DOUBLE, Hint h = DATA_ONLY);
|
||||
|
||||
//! Copy Constructor
|
||||
SACRecord(const SACRecord &rec);
|
||||
SACRecord(const Record &rec);
|
||||
|
||||
//! Destructor
|
||||
virtual ~SACRecord();
|
||||
|
||||
|
||||
public:
|
||||
//! Assignment operator
|
||||
SACRecord &operator=(const SACRecord &other);
|
||||
|
||||
//! Returns the data samples if the data is available; otherwise 0
|
||||
Array* data();
|
||||
|
||||
//! Returns the data samples if the data is available; otherwise 0
|
||||
const Array* data() const;
|
||||
|
||||
const Array* raw() const;
|
||||
|
||||
//! Sets the data sample array. The ownership goes over to the record.
|
||||
void setData(Array* data);
|
||||
|
||||
//! Sets the data sample array.
|
||||
void setData(int size, const void *data, Array::DataType datatype);
|
||||
|
||||
//! Returns a deep copy of the calling object.
|
||||
SACRecord *copy() const;
|
||||
|
||||
void saveSpace() const;
|
||||
|
||||
void read(std::istream &in);
|
||||
void write(std::ostream &out);
|
||||
|
||||
|
||||
private:
|
||||
mutable ArrayPtr _data;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
117
include/seiscomp/io/records/shrecord.h
Normal file
117
include/seiscomp/io/records/shrecord.h
Normal file
@ -0,0 +1,117 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) gempa GmbH *
|
||||
* All rights reserved. *
|
||||
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
|
||||
* *
|
||||
* GNU Affero General Public License Usage *
|
||||
* This file may be used under the terms of the GNU Affero *
|
||||
* Public License version 3.0 as published by the Free Software Foundation *
|
||||
* and appearing in the file LICENSE included in the packaging of this *
|
||||
* file. Please review the following information to ensure the GNU Affero *
|
||||
* Public License version 3.0 requirements will be met: *
|
||||
* https://www.gnu.org/licenses/agpl-3.0.html. *
|
||||
* *
|
||||
* Other Usage *
|
||||
* Alternatively, this file may be used in accordance with the terms and *
|
||||
* conditions contained in a signed written agreement between you and *
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
|
||||
//! HACK
|
||||
//! INCOMPLETE IMPLEMENTATION OF SEISMIC HANDLER FORMAT ( SH )
|
||||
//! HACK
|
||||
|
||||
|
||||
#ifndef SEISCOMP_IO_RECORDS_SHRECORD_H
|
||||
#define SEISCOMP_IO_RECORDS_SHRECORD_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
|
||||
#include <seiscomp/core/record.h>
|
||||
#include <seiscomp/core/array.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
|
||||
namespace IO {
|
||||
|
||||
|
||||
DEFINE_SMARTPOINTER(SHRecord);
|
||||
|
||||
class SC_SYSTEM_CORE_API SHRecord : public Record {
|
||||
DECLARE_SC_CLASS(SHRecord);
|
||||
|
||||
public:
|
||||
//! Default Constructor
|
||||
// SHRecord();
|
||||
|
||||
//! Initializing Constructor
|
||||
SHRecord(std::string net="AB", std::string sta="ABC",
|
||||
std::string loc="", std::string cha="XYZ",
|
||||
Core::Time stime=Core::Time(), double fsamp=0., int tqual=-1,
|
||||
Array::DataType dt = Array::DOUBLE, Hint h = DATA_ONLY);
|
||||
|
||||
//! Copy Constructor
|
||||
SHRecord(const SHRecord& rec);
|
||||
SHRecord(const Record& rec);
|
||||
|
||||
//! Destructor
|
||||
virtual ~SHRecord();
|
||||
|
||||
//! Assignment operator
|
||||
SHRecord& operator=(const SHRecord& rec);
|
||||
|
||||
//! Returns the data samples if the data is available; otherwise 0
|
||||
Array* data();
|
||||
|
||||
//! Returns the data samples if the data is available; otherwise 0
|
||||
const Array* data() const;
|
||||
|
||||
const Array* raw() const;
|
||||
|
||||
//! Sets the data sample array. The ownership goes over to the record.
|
||||
void setData(Array* data);
|
||||
|
||||
//! Sets the data sample array.
|
||||
void setData(int size, const void *data, Array::DataType datatype);
|
||||
|
||||
//! Frees the memory allocated for the data samples.
|
||||
void saveSpace() const {}
|
||||
|
||||
//! Returns a deep copy of the calling object.
|
||||
SHRecord* copy() const;
|
||||
|
||||
void read(std::istream &in);
|
||||
void write(std::ostream &out);
|
||||
|
||||
|
||||
private:
|
||||
ArrayPtr _data;
|
||||
|
||||
};
|
||||
|
||||
class SC_SYSTEM_CORE_API SHOutput {
|
||||
public:
|
||||
SHOutput() : _ofstream(0) {}
|
||||
SHOutput(const std::string& filename);
|
||||
SHOutput(const Record *rec);
|
||||
|
||||
~SHOutput();
|
||||
|
||||
bool put(const SHRecord *rec);
|
||||
|
||||
private:
|
||||
std::string _filename;
|
||||
std::ofstream *_ofstream;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user