Install SeisComP and scanloc ARM64 nightly packages
This commit is contained in:
@ -70,7 +70,7 @@ class NamedCoord : public Coord<T> {
|
||||
void setName(const std::string& name);
|
||||
const std::string& name() const;
|
||||
|
||||
void serialize(Core::BaseObject::Archive& ar);
|
||||
void serialize(Core::BaseObject::Archive& ar) override;
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
@ -104,7 +104,7 @@ class City : public NamedCoord<T> {
|
||||
void setCategory(std::string &);
|
||||
const std::string &category() const;
|
||||
|
||||
void serialize(Core::BaseObject::Archive& ar);
|
||||
void serialize(Core::BaseObject::Archive& ar) override;
|
||||
|
||||
private:
|
||||
std::string _countryID;
|
||||
|
||||
@ -42,7 +42,7 @@ void fft(ComplexArray &spec, int n, const T *data);
|
||||
|
||||
template <typename T>
|
||||
void fft(ComplexArray &spec, const std::vector<T> &data) {
|
||||
fft(spec, static_cast<int>(data.size()), &data[0]);
|
||||
fft(spec, static_cast<int>(data.size()), data.data());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -65,17 +65,17 @@ void ifft(int n, T *out, ComplexArray &spec);
|
||||
|
||||
template <typename T>
|
||||
void ifft(std::vector<T> &out, ComplexArray &spec) {
|
||||
ifft(static_cast<int>(out.size()), &out[0], spec);
|
||||
ifft(static_cast<int>(out.size()), out.data(), spec);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ifft(TypedArray<T> &out, ComplexArray &spec) {
|
||||
ifft(out.impl(), &out[0], spec);
|
||||
ifft(out.impl(), spec);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ifft(TypedArray<T> &out, Seiscomp::ComplexDoubleArray &spec) {
|
||||
ifft(out.impl(), &out[0], spec.impl());
|
||||
ifft(out.impl(), spec.impl());
|
||||
}
|
||||
|
||||
inline void ifft(DoubleArray &out, Seiscomp::ComplexDoubleArray &spec) {
|
||||
|
||||
@ -37,7 +37,7 @@ namespace Filtering {
|
||||
class SC_SYSTEM_CORE_API AlignmentError : public std::exception {
|
||||
public:
|
||||
AlignmentError(const char *txt) { _txt = txt; }
|
||||
const char* what() const throw() { return _txt; }
|
||||
const char* what() const throw() override { return _txt; }
|
||||
private:
|
||||
const char *_txt;
|
||||
};
|
||||
@ -85,7 +85,7 @@ class SC_SYSTEM_CORE_API InPlaceFilter : public Core::BaseObject {
|
||||
virtual void apply(int n, TYPE *inout) = 0;
|
||||
|
||||
void apply(std::vector<TYPE> &f) {
|
||||
apply(f.size(), &f[0]);
|
||||
apply(f.size(), f.data());
|
||||
}
|
||||
|
||||
void apply(TypedArray<TYPE> &arr) {
|
||||
@ -99,7 +99,7 @@ class SC_SYSTEM_CORE_API InPlaceFilter : public Core::BaseObject {
|
||||
//! type as the called instance. The configuration
|
||||
//! parameters will be copied, too but not the internal
|
||||
//! filter state depending on former input data
|
||||
virtual InPlaceFilter<TYPE>* clone() const = 0;
|
||||
virtual InPlaceFilter<TYPE>* clone() const override = 0;
|
||||
|
||||
//! Creates a new filter by name. The user is responsible to
|
||||
//! release the memory
|
||||
@ -133,12 +133,12 @@ class SC_SYSTEM_CORE_API SelfFilter : public InPlaceFilter<TYPE> {
|
||||
SelfFilter() {}
|
||||
|
||||
public:
|
||||
virtual void setSamplingFrequency(double fsamp) {}
|
||||
virtual int setParameters(int n, const double *params) { return 0; }
|
||||
virtual void setSamplingFrequency(double fsamp) override {}
|
||||
virtual int setParameters(int n, const double *params) override { return 0; }
|
||||
|
||||
virtual void apply(int n, TYPE *inout) {}
|
||||
virtual void apply(int n, TYPE *inout) override {}
|
||||
|
||||
virtual InPlaceFilter<TYPE>* clone() const { return new SelfFilter(); }
|
||||
virtual InPlaceFilter<TYPE>* clone() const override { return new SelfFilter(); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ class BandPassEnvelope : public InPlaceFilter<T> {
|
||||
double _samplingFrequency;
|
||||
double _K, _yp;
|
||||
|
||||
using FilterPtr = typename Core::SmartPointer<Math::Filtering::InPlaceFilter<T>>::Impl;
|
||||
using FilterPtr = Core::SmartPointer<Math::Filtering::InPlaceFilter<T>>;
|
||||
FilterPtr _bp;
|
||||
|
||||
// Flag to indicate some pending initialization
|
||||
|
||||
@ -21,18 +21,18 @@
|
||||
#ifndef SEISCOMP_MATH_GEO
|
||||
#define SEISCOMP_MATH_GEO
|
||||
|
||||
|
||||
#include <seiscomp/core.h>
|
||||
#include <seiscomp/math/coord.h>
|
||||
#include <seiscomp/math/vector3.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Seiscomp
|
||||
{
|
||||
|
||||
namespace Math
|
||||
{
|
||||
namespace Seiscomp {
|
||||
namespace Math {
|
||||
namespace Geo {
|
||||
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
/**
|
||||
* For two points (lat1, lon1) and (lat2, lon2),
|
||||
@ -112,7 +112,7 @@ int scdraw(double lat0, double lon0, double radius,
|
||||
*
|
||||
* - Semi-major Axis (Equatorial Radius of the Earth) [a] : 6378137.0m
|
||||
* - Flattening Factor of the Earth [1/f] : 298.257223563
|
||||
* - Semi-major Axis (Polar Radius of the Earth) [b] : 6356752.314245179m
|
||||
* - Semi-minor Axis (Polar Radius of the Earth) [b] : 6356752.314245179m
|
||||
* b = a * (1 - f)
|
||||
* - Mean Radius of the Three Semi-Axes [r_1] : 6371008.77141506m
|
||||
* r_1 = a * (1 - f/3) = (2a + b) / 3
|
||||
@ -123,14 +123,17 @@ int scdraw(double lat0, double lon0, double radius,
|
||||
* Prior to SeisComP 6 (API 16.0.0) this constant was set to
|
||||
* 111.1329149013519096
|
||||
*/
|
||||
#define KM_OF_DEGREE 111.195079734632
|
||||
constexpr double WGS84_MEAN_RADIUS = 6371008.77141506;
|
||||
constexpr double WGS84_KM_OF_DEGREE = 111.195079734632;
|
||||
constexpr double WGS84_SEMI_MAJOR_AXIS = 6378137.0;
|
||||
constexpr double WGS84_FLATTENING = (1.0/298.2572235630);
|
||||
|
||||
|
||||
template<typename T>
|
||||
T deg2km(T deg) { return deg * (T)KM_OF_DEGREE; }
|
||||
T deg2km(T deg) { return deg * static_cast<T>(WGS84_KM_OF_DEGREE); }
|
||||
|
||||
template<typename T>
|
||||
T km2deg(T km) { return km / (T)KM_OF_DEGREE; }
|
||||
T km2deg(T km) { return km / static_cast<T>(WGS84_KM_OF_DEGREE); }
|
||||
|
||||
/**
|
||||
* Converts X, Y, Z coordinates to LTP coordinates using WGS-84 constants for
|
||||
@ -151,6 +154,11 @@ SC_SYSTEM_CORE_API
|
||||
void xyz2ltp(const double x, const double y, const double z,
|
||||
double *lat, double *lon, double *alt);
|
||||
|
||||
SC_SYSTEM_CORE_API
|
||||
inline void vec2ltp(const Vector3d &vec, double *lat, double *lon, double *alt) {
|
||||
return xyz2ltp(vec.x, vec.y, vec.z, lat, lon, alt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts LTP coordinates to X, Y, Z coordinates using WGS-84 constants for
|
||||
* the ellipsoid.
|
||||
@ -170,6 +178,11 @@ SC_SYSTEM_CORE_API
|
||||
void ltp2xyz(double lat, double lon, double alt,
|
||||
double *x, double *y, double *z);
|
||||
|
||||
SC_SYSTEM_CORE_API
|
||||
inline void ltp2vec(double lat, double lon, double alt, Vector3d &vec) {
|
||||
ltp2xyz(lat, lon, alt, &vec.x, &vec.y, &vec.z);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -303,9 +316,8 @@ inline double PositionInterpolator::longitude() const {
|
||||
|
||||
|
||||
} // namespace Seiscomp::Math::Geo
|
||||
|
||||
} // namespace Seiscomp::Math
|
||||
|
||||
} // namespace Seiscomp
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -44,8 +44,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace Math {
|
||||
namespace Seiscomp::Math {
|
||||
|
||||
|
||||
using Complex = std::complex<double>;
|
||||
@ -73,8 +72,7 @@ inline bool isNaN(T v) { return std::isnan(v)!=0; }
|
||||
Fraction double2frac(double value);
|
||||
|
||||
|
||||
} // namespace Math
|
||||
} // namespace Seiscomp
|
||||
} // namespace Seiscomp::Math
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -32,9 +32,11 @@ namespace Math {
|
||||
|
||||
template <typename T>
|
||||
struct Matrix3 {
|
||||
using Type = T;
|
||||
|
||||
Matrix3() {}
|
||||
Matrix3(const Matrix3<T> &other) {
|
||||
memcpy(d, other.d, sizeof(d));
|
||||
*this = other;
|
||||
}
|
||||
|
||||
Matrix3<T> &identity();
|
||||
@ -57,11 +59,30 @@ struct Matrix3 {
|
||||
Vector3<T> &transform(Vector3<T> &dst, const Vector3<T> &v) const;
|
||||
Vector3<T> &invTransform(Vector3<T> &dst, const Vector3<T> &v) const;
|
||||
|
||||
Matrix3<T> &operator=(const Matrix3<T> &other) {
|
||||
memcpy(d, other.d, sizeof(d));
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator T *() { return (T*)this; }
|
||||
operator const T *() const { return (const T*)this; }
|
||||
|
||||
T *operator[](size_t row) {
|
||||
return d[row];
|
||||
}
|
||||
|
||||
const T *operator[](size_t row) const {
|
||||
return d[row];
|
||||
}
|
||||
|
||||
Matrix3<T> operator*(const Matrix3<T> &m) const;
|
||||
Vector3<T> operator*(const Vector3<T> &v) const;
|
||||
|
||||
static Matrix3<T> RotationX(T theta);
|
||||
static Matrix3<T> RotationY(T theta);
|
||||
static Matrix3<T> RotationZ(T theta);
|
||||
|
||||
|
||||
// Coefficients
|
||||
union {
|
||||
T d[3][3];
|
||||
@ -75,13 +96,17 @@ struct Matrix3 {
|
||||
};
|
||||
|
||||
|
||||
typedef Matrix3<float> Matrix3f;
|
||||
typedef Matrix3<double> Matrix3d;
|
||||
using Matrix3f = Matrix3<float>;
|
||||
using Matrix3d = Matrix3<double>;
|
||||
|
||||
|
||||
#include <seiscomp/math/matrix3.ipp>
|
||||
|
||||
|
||||
template <typename T>
|
||||
std::ostream &operator<<(std::ostream &os, const Matrix3<T> &v);
|
||||
|
||||
|
||||
} // namespace Math
|
||||
} // namespace Seiscomp
|
||||
|
||||
|
||||
@ -17,8 +17,15 @@
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
#define _mat3_elem(row,column) d[row][column]
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
#define _mat3_elem(row,column) d[row][column]
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Vector3<T> &Matrix3<T>::transform(Vector3<T> &dst, const Vector3<T> &v) const {
|
||||
for ( int r = 0; r < 3; ++r )
|
||||
@ -28,8 +35,12 @@ inline Vector3<T> &Matrix3<T>::transform(Vector3<T> &dst, const Vector3<T> &v) c
|
||||
|
||||
return dst;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Vector3<T> &Matrix3<T>::invTransform(Vector3<T> &dst, const Vector3<T> &v) const {
|
||||
for ( int r = 0; r < 3; ++r )
|
||||
@ -39,11 +50,67 @@ inline Vector3<T> &Matrix3<T>::invTransform(Vector3<T> &dst, const Vector3<T> &v
|
||||
|
||||
return dst;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Vector3<T> Matrix3<T>::operator*(const Vector3<T> &v) const {
|
||||
Vector3<T> r;
|
||||
transform(r, v);
|
||||
return r;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Matrix3<T> Matrix3<T>::RotationX(T theta) {
|
||||
Matrix3<T> r;
|
||||
r.loadRotateX(theta);
|
||||
return r;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Matrix3<T> Matrix3<T>::RotationY(T theta) {
|
||||
Matrix3<T> r;
|
||||
r.loadRotateY(theta);
|
||||
return r;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Matrix3<T> Matrix3<T>::RotationZ(T theta) {
|
||||
Matrix3<T> r;
|
||||
r.loadRotateZ(theta);
|
||||
return r;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
std::ostream &operator<<(std::ostream &os, const Matrix3<T> &v) {
|
||||
os << "("
|
||||
"(" << v[0][0] << ", " << v[0][1] << ", " << v[0][2] << "), "
|
||||
"(" << v[1][0] << ", " << v[1][1] << ", " << v[1][2] << "), "
|
||||
"(" << v[2][0] << ", " << v[2][1] << ", " << v[2][2] << ")"
|
||||
")";
|
||||
return os;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
@ -47,7 +47,7 @@ bool transformFFT(int n, T *inout, double fsamp, const FFT::TransferFunction *tf
|
||||
template <typename T>
|
||||
bool transformFFT(std::vector<T> &inout, double fsamp, const FFT::TransferFunction *tf,
|
||||
double cutoff, double min_freq, double max_freq) {
|
||||
return transformFFT(inout.size(), &inout[0], fsamp, tf, cutoff, min_freq, max_freq);
|
||||
return transformFFT(inout.size(), inout.data(), fsamp, tf, cutoff, min_freq, max_freq);
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,8 @@ template <typename T>
|
||||
bool transformFFT(std::vector<T> &inout, double fsamp, const Poles &poles,
|
||||
const Zeros &zeros, double norm, double cutoff,
|
||||
double min_freq, double max_freq) {
|
||||
return transformFFT(inout.size(), &inout[0], poles.size(), &poles[0],
|
||||
zeros.size(), &zeros[0], norm, cutoff, min_freq, max_freq);
|
||||
return transformFFT(inout.size(), inout.data(), poles.size(), poles.data(),
|
||||
zeros.size(), zeros.data(), norm, cutoff, min_freq, max_freq);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ namespace Restitution {
|
||||
|
||||
// subroutines to compute parameters for the recursive filter
|
||||
|
||||
// from seismometer eigenperiod T0 and damping parameter h bool
|
||||
// from seismometer eigenperiod T0 and damping parameter h bool
|
||||
bool coefficients_from_T0_h(double fsamp, double gain, double T0, double h, double *c0, double *c1, double *c2);
|
||||
|
||||
// from the two seismometer eigenperiods T1 and T2
|
||||
@ -44,13 +44,13 @@ class TimeDomain : public Filtering::InPlaceFilter<TYPE> {
|
||||
|
||||
// configuration
|
||||
void setBandpass(int order, double fmin, double fmax);
|
||||
void setSamplingFrequency(double fsamp);
|
||||
void setCoefficients(double c0, double c1, double c2);
|
||||
|
||||
virtual int setParameters(int n, const double *params);
|
||||
virtual void setSamplingFrequency(double fsamp) override;
|
||||
virtual int setParameters(int n, const double *params) override;
|
||||
|
||||
virtual void reset() {}
|
||||
virtual void apply(int n, TYPE *inout);
|
||||
virtual void apply(int n, TYPE *inout) override;
|
||||
virtual std::string print() const;
|
||||
|
||||
protected:
|
||||
@ -79,13 +79,13 @@ class TimeDomain_from_T0_h: public TimeDomain<TYPE> {
|
||||
TimeDomain_from_T0_h(double T0, double h, double gain, double fsamp=0);
|
||||
|
||||
void setBandpass(int order, double fmin, double fmax);
|
||||
virtual std::string print() const;
|
||||
virtual std::string print() const override;
|
||||
|
||||
Filtering::InPlaceFilter<TYPE>* clone() const;
|
||||
Filtering::InPlaceFilter<TYPE>* clone() const override;
|
||||
|
||||
protected:
|
||||
virtual void init();
|
||||
|
||||
virtual void init() override;
|
||||
|
||||
private:
|
||||
// configuration
|
||||
double T0, h;
|
||||
@ -97,12 +97,12 @@ class TimeDomain_from_T1_T2: public TimeDomain<TYPE> {
|
||||
TimeDomain_from_T1_T2(double T1, double T2, double gain, double fsamp=0);
|
||||
|
||||
void setBandpass(int order, double fmin, double fmax);
|
||||
virtual std::string print() const;
|
||||
virtual std::string print() const override;
|
||||
|
||||
Filtering::InPlaceFilter<TYPE>* clone() const;
|
||||
Filtering::InPlaceFilter<TYPE>* clone() const override;
|
||||
|
||||
protected:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
private:
|
||||
// configuration
|
||||
|
||||
@ -61,7 +61,7 @@ class TransferFunction : public Core::BaseObject {
|
||||
|
||||
void evaluate(std::vector<Complex> &out, const std::vector<double> &x) const {
|
||||
out.resize(x.size());
|
||||
evaluate_(&out[0], (int)x.size(), &x[0]);
|
||||
evaluate_(out.data(), (int)x.size(), x.data());
|
||||
}
|
||||
|
||||
//! Devides the spectra by the evaluated nodes of the transfer function
|
||||
@ -72,7 +72,7 @@ class TransferFunction : public Core::BaseObject {
|
||||
|
||||
//! Convenience wrapper using a vector as output
|
||||
void deconvolve(std::vector<Complex> &spec, double startFreq, double df) const {
|
||||
deconvolve_((int)spec.size(), &spec[0], startFreq, df);
|
||||
deconvolve_((int)spec.size(), spec.data(), startFreq, df);
|
||||
}
|
||||
|
||||
//! Multiplies the spectra by the evaluated nodes of the transfer function
|
||||
@ -83,7 +83,7 @@ class TransferFunction : public Core::BaseObject {
|
||||
|
||||
//! Convenience wrapper using a vector as output
|
||||
void convolve(std::vector<Complex> &spec, double startFreq, double df) const {
|
||||
convolve_((int)spec.size(), &spec[0], startFreq, df);
|
||||
convolve_((int)spec.size(), spec.data(), startFreq, df);
|
||||
}
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ class PolesAndZeros : public TransferFunction {
|
||||
PolesAndZeros(int n_poles, Pole *poles, int n_zeros, Zero *zeros, double k, int addZeros = 0);
|
||||
|
||||
protected:
|
||||
void evaluate_(Complex *out, int n, const double *x) const;
|
||||
void deconvolve_(int n, Complex *spec, double startFreq, double df) const;
|
||||
void convolve_(int n, Complex *spec, double startFreq, double df) const;
|
||||
void evaluate_(Complex *out, int n, const double *x) const override;
|
||||
void deconvolve_(int n, Complex *spec, double startFreq, double df) const override;
|
||||
void convolve_(int n, Complex *spec, double startFreq, double df) const override;
|
||||
|
||||
public:
|
||||
SeismometerResponse::PolesAndZeros paz;
|
||||
@ -120,9 +120,9 @@ class ResponseList : public TransferFunction {
|
||||
ResponseList(int n_tuples, const SeismometerResponse::FAP *faps, int addZeros = 0);
|
||||
|
||||
protected:
|
||||
void evaluate_(Complex *out, int n, const double *x) const;
|
||||
void deconvolve_(int n, Complex *spec, double startFreq, double df) const;
|
||||
void convolve_(int n, Complex *spec, double startFreq, double df) const;
|
||||
void evaluate_(Complex *out, int n, const double *x) const override;
|
||||
void deconvolve_(int n, Complex *spec, double startFreq, double df) const override;
|
||||
void convolve_(int n, Complex *spec, double startFreq, double df) const override;
|
||||
|
||||
public:
|
||||
SeismometerResponse::FAPs faps;
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
|
||||
#include <seiscomp/math/math.h>
|
||||
#include <ostream>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
@ -31,6 +32,8 @@ namespace Math {
|
||||
|
||||
template <typename T>
|
||||
struct Vector3 {
|
||||
using Type = T;
|
||||
|
||||
Vector3() {}
|
||||
Vector3(const Vector3<T> &other) : x(other.x), y(other.y), z(other.z) {}
|
||||
Vector3(T x_, T y_, T z_) : x(x_), y(y_), z(z_) {}
|
||||
@ -40,6 +43,7 @@ struct Vector3 {
|
||||
|
||||
Vector3<T> &cross(const Vector3<T> &a, const Vector3<T> &b);
|
||||
Vector3<T> &normalize();
|
||||
Vector3<T> normalized() const;
|
||||
|
||||
Vector3<T> &operator=(const Vector3<T> &other);
|
||||
Vector3<T> operator*(T scale) const;
|
||||
@ -49,6 +53,9 @@ struct Vector3 {
|
||||
operator T *() { return (T*)this; }
|
||||
operator const T *() const { return (const T*)this; }
|
||||
|
||||
Vector3<T> operator+() const;
|
||||
Vector3<T> operator-() const;
|
||||
|
||||
Vector3<T> &operator+=(const Vector3<T> &other);
|
||||
Vector3<T> &operator-=(const Vector3<T> &other);
|
||||
|
||||
@ -62,8 +69,12 @@ struct Vector3 {
|
||||
};
|
||||
|
||||
|
||||
typedef Vector3<float> Vector3f;
|
||||
typedef Vector3<double> Vector3d;
|
||||
using Vector3f = Vector3<float>;
|
||||
using Vector3d = Vector3<double>;
|
||||
|
||||
|
||||
template <typename T>
|
||||
std::ostream &operator<<(std::ostream &os, const Vector3<T> &v);
|
||||
|
||||
|
||||
#include <seiscomp/math/vector3.ipp>
|
||||
|
||||
@ -17,18 +17,28 @@
|
||||
* gempa GmbH. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline T Vector3<T>::length() const {
|
||||
return sqrt(x*x + y*y + z*z);
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline T Vector3<T>::dot(const Vector3<T> &v) const {
|
||||
return x*v.x + y*v.y + z*v.z;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline Vector3<T> &Vector3<T>::operator=(const Vector3<T> &other) {
|
||||
x = other.x;
|
||||
@ -37,3 +47,15 @@ inline Vector3<T> &Vector3<T>::operator=(const Vector3<T> &other) {
|
||||
|
||||
return *this;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
template <typename T>
|
||||
inline std::ostream &operator<<(std::ostream &os, const Vector3<T> &v){
|
||||
os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
|
||||
return os;
|
||||
}
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
Reference in New Issue
Block a user