h5geo 0.4.0
C++17 and python API to work with geo-data (seismic, wells, maps, other in process) based on HDF5. Aimed at geoscientists and developers.
Loading...
Searching...
No Matches
h5seis.h
1#ifndef H5SEIS_H
2#define H5SEIS_H
3
4#include "h5baseobject.h"
5
6#include <Eigen/Dense>
7
8#ifndef _USE_MATH_DEFINES
9#define _USE_MATH_DEFINES // should be before <cmath>, include 'pi' val
10#endif
11#include <math.h>
12
13class H5SeisContainer;
14class H5Vol;
15
32class H5Seis : public H5BaseObject
33{
34protected:
35 virtual ~H5Seis() = default;
36
37public:
38
39 // WRITERS
41 virtual bool readSEGYTextHeader(
42 const std::string& segy,
43 h5geo::TextEncoding encoding = static_cast<h5geo::TextEncoding>(0)) = 0;
45 virtual bool readSEGYBinHeader(
46 const std::string& segy,
47 h5geo::Endian endian = static_cast<h5geo::Endian>(0)) = 0;
57 virtual bool readSEGYTraces(
58 const std::vector<std::string>& segyFiles,
59 std::vector<h5geo::SegyFormat> formats = std::vector<h5geo::SegyFormat>(),
60 std::vector<h5geo::Endian> endians = std::vector<h5geo::Endian>(),
61 std::vector<std::vector<std::string>> trcHdrNamesArr = std::vector<std::vector<std::string>>(),
62 size_t trcBuffer = 10000,
63 std::function<void(double)> progressCallback = nullptr) = 0;
75 virtual bool readSEGYTracesMMap(
76 const std::vector<std::string>& segyFiles,
77 std::vector<h5geo::SegyFormat> formats = std::vector<h5geo::SegyFormat>(),
78 std::vector<h5geo::Endian> endians = std::vector<h5geo::Endian>(),
79 std::vector<std::vector<std::string>> trcHdrNamesArr = std::vector<std::vector<std::string>>(),
80 size_t trcBuffer = 10000,
81 int nThreads = -1,
82 std::function<void(double)> progressCallback = nullptr) = 0;
83
85 virtual bool writeTextHeader(const char (&txtHdr)[40][80]) = 0;
86
90 virtual bool writeTextHeader(const std::vector<std::string>& txtHdr) = 0;
92 virtual bool writeBinHeader(const double (&binHdr)[30]) = 0;
93
97 virtual bool writeBinHeader(const std::vector<double>& binHdrVec) = 0;
101 virtual bool writeBinHeader(
102 const Eigen::Ref<const Eigen::VectorXd>& binHdrVec) = 0;
104 virtual bool writeBinHeader(
105 const std::string& hdrName,
106 const double& value,
107 const std::string& unitsFrom = "",
108 const std::string& unitsTo = "") = 0;
110 virtual bool writeTrace(
111 Eigen::Ref<Eigen::MatrixXf> TRACE,
112 const size_t& fromTrc = 0,
113 const size_t& fromSampInd = 0,
114 const std::string& dataUnits = "") = 0;
118 virtual bool writeTrace(
119 Eigen::Ref<Eigen::MatrixXf> TRACE,
120 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
121 const size_t& fromSampInd = 0,
122 const std::string& dataUnits = "") = 0;
124 virtual bool writeTraceHeader(
125 const Eigen::Ref<const Eigen::MatrixXd>& HDR,
126 const size_t& fromTrc = 0,
127 const size_t& fromHdrInd = 0) = 0;
129 virtual bool writeTraceHeader(
130 const std::string& hdrName,
131 Eigen::Ref<Eigen::MatrixXd> hdr,
132 const size_t& fromTrc = 0,
133 const std::string& unitsFrom = "",
134 const std::string& unitsTo = "") = 0;
138 virtual bool writeTraceHeader(
139 const std::string& hdrName,
140 Eigen::Ref<Eigen::MatrixXd> hdr,
141 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
142 const std::string& unitsFrom = "",
143 const std::string& unitsTo = "") = 0;
144
149 const std::vector<std::string>& xyHdrNames,
150 Eigen::Ref<Eigen::MatrixX2d>& xy,
151 const size_t& fromTrc = 0,
152 const std::string& lengthUnits = "",
153 bool doCoordTransform = false) = 0;
159 const std::vector<std::string>& xyHdrNames,
160 Eigen::Ref<Eigen::MatrixX2d>& xy,
161 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
162 const std::string& lengthUnits = "",
163 bool doCoordTransform = false) = 0;
164
166 virtual bool setNTrc(size_t nTrc) = 0;
168 virtual bool setNSamp(size_t nSamp) = 0;
169
170 // GETTERS
172 virtual std::vector<std::string> getTextHeader() = 0;
174 virtual std::map<std::string, double> getBinHeader() = 0;
176 virtual double getBinHeader(
177 const std::string& hdrName,
178 const std::string& unitsFrom = "",
179 const std::string& unitsTo = "") = 0;
180
185 virtual Eigen::MatrixXf getTrace(
186 const size_t& fromTrc,
187 size_t nTrc = 1,
188 const size_t& fromSampInd = 0,
189 size_t nSamp = std::numeric_limits<size_t>::max(),
190 const std::string& dataUnits = "") = 0;
191
197 virtual Eigen::MatrixXf getTrace(
198 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
199 const size_t& fromSampInd = 0,
200 size_t nSamp = std::numeric_limits<size_t>::max(),
201 const std::string& dataUnits = "") = 0;
202
207 virtual Eigen::MatrixXd getTraceHeader(
208 const size_t& fromTrc,
209 size_t nTrc = 1,
210 const size_t& fromHdr = 0,
211 size_t nHdr = std::numeric_limits<size_t>::max(),
212 const std::vector<std::string>& unitsFrom = std::vector<std::string>(),
213 const std::vector<std::string>& unitsTo = std::vector<std::string>()) = 0;
218 virtual Eigen::VectorXd getTraceHeader(
219 const std::string& hdrName,
220 const size_t& fromTrc = 0,
221 size_t nTrc = 1,
222 const std::string& unitsFrom = "",
223 const std::string& unitsTo = "") = 0;
229 virtual Eigen::MatrixXd getTraceHeader(
230 const std::vector<size_t>& trcInd,
231 const std::vector<size_t>& trcHdrInd,
232 const std::vector<std::string>& unitsFrom = std::vector<std::string>(),
233 const std::vector<std::string>& unitsTo = std::vector<std::string>()) = 0;
239 virtual Eigen::MatrixXd getTraceHeader(
240 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
241 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcHdrInd,
242 const std::vector<std::string>& unitsFrom = std::vector<std::string>(),
243 const std::vector<std::string>& unitsTo = std::vector<std::string>()) = 0;
249 virtual Eigen::MatrixXd getTraceHeader(
250 const std::vector<std::string>& hdrNames,
251 const std::vector<size_t>& trcInd,
252 const std::vector<std::string>& unitsFrom = std::vector<std::string>(),
253 const std::vector<std::string>& unitsTo = std::vector<std::string>()) = 0;
259 virtual Eigen::MatrixXd getTraceHeader(
260 const std::vector<std::string>& hdrNames,
261 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
262 const std::vector<std::string>& unitsFrom = std::vector<std::string>(),
263 const std::vector<std::string>& unitsTo = std::vector<std::string>()) = 0;
264
268 virtual Eigen::MatrixXd getXYTraceHeaders(
269 const std::vector<std::string>& xyHdrNames,
270 const size_t& fromTrc = 0,
271 size_t nTrc = std::numeric_limits<size_t>::max(),
272 const std::string& lengthUnits = "",
273 bool doCoordTransform = false) = 0;
280 virtual Eigen::MatrixXd getXYTraceHeaders(
281 const std::vector<std::string>& xyHdrNames,
282 const Eigen::Ref<const Eigen::VectorX<size_t>>& trcInd,
283 const std::string& lengthUnits = "",
284 bool doCoordTransform = false) = 0;
285
301 virtual Eigen::VectorX<size_t> getSortedData(
302 Eigen::MatrixXf& TRACE,
303 Eigen::MatrixXd& HDR,
304 const std::vector<std::string>& keyList,
305 const std::vector<double>& minList,
306 const std::vector<double>& maxList,
307 size_t pStep = 1,
308 size_t fromSampInd = 0,
309 size_t nSamp = std::numeric_limits<size_t>::max(),
310 const std::string& dataUnits = "",
311 const std::string& lengthUnits = "",
312 bool doCoordTransform = false) = 0;
313
315 virtual ptrdiff_t getBinHeaderIndex(const std::string& hdrName) = 0;
317 virtual ptrdiff_t getTraceHeaderIndex(const std::string& hdrName) = 0;
318
320 virtual Eigen::VectorXd getSamples(
321 const size_t& trcInd,
322 const std::string& units = "") = 0;
324 virtual double getFirstSample(
325 const size_t& trcInd,
326 const std::string& units = "") = 0;
328 virtual double getLastSample(
329 const size_t& trcInd,
330 const std::string& units = "") = 0;
332 virtual double getSampRate(
333 const std::string& units = "") = 0;
335 virtual size_t getNSamp() = 0;
337 virtual size_t getNTrc() = 0;
339 virtual size_t getNTrcHdr() = 0;
341 virtual size_t getNBinHdr() = 0;
343 virtual size_t getNTextHdrRows() = 0;
351 virtual Eigen::VectorX<size_t> getPKeyIndexes(
352 const std::string& pKey,
353 double pMin, double pMax,
354 size_t pStep = 1) = 0;
358 virtual Eigen::VectorXd getPKeyValues(
359 const std::string& pKey,
360 const std::string& unitsFrom = "",
361 const std::string& unitsTo = "") = 0;
365 virtual size_t getPKeySize(const std::string& pKey) = 0;
369 virtual size_t getPKeySize(
370 const std::string& pKey,
371 double pMin, double pMax,
372 size_t pStep = 1) = 0;
380 virtual size_t getPKeyTraceSize(
381 const std::string& pKey,
382 double pMin, double pMax,
383 size_t pStep = 1) = 0;
385 virtual std::vector<std::string> getPKeyNames() = 0;
387 virtual std::map<std::string, double> getTraceHeaderMin() = 0;
389 virtual std::map<std::string, double> getTraceHeaderMax() = 0;
391 virtual double getTraceHeaderMin(
392 const std::string& hdrName,
393 const std::string& unitsFrom = "",
394 const std::string& unitsTo = "") = 0;
396 virtual double getTraceHeaderMax(
397 const std::string& hdrName,
398 const std::string& unitsFrom = "",
399 const std::string& unitsTo = "") = 0;
400
402 virtual H5SeisParam getParam() = 0;
403
409 virtual bool checkTraceLimits(
410 const size_t& fromTrc, size_t& nTrc) = 0;
411
419 const size_t& fromHdr, size_t& nHdr) = 0;
425 virtual bool checkSampleLimits(
426 const size_t& fromSampInd, size_t& nSamp) = 0;
427
431 double src_x0, double src_dx, size_t src_nx,
432 double src_y0, double src_dy, size_t src_ny,
433 double src_z,
434 double rec_x0, double rec_dx, size_t rec_nx,
435 double rec_y0, double rec_dy, size_t rec_ny,
436 double rec_z,
437 double orientation,
438 bool moveRec,
439 const std::string& lengthUnits = "",
440 bool doCoordTransform = false) = 0;
444 double x0, double dx, size_t nx,
445 double y0, double dy, size_t ny,
446 double z,
447 double orientation,
448 const std::string& lengthUnits = "",
449 bool doCoordTransform = false) = 0;
450
452 virtual bool setDomain(const h5geo::Domain& domain) = 0;
454 virtual bool setDataType(const h5geo::SeisDataType& seisType) = 0;
456 virtual bool setSurveyType(const h5geo::SurveyType& surveyType) = 0;
458 virtual bool setSRD(double val, const std::string& lengthUnits = "") = 0;
460 virtual bool setSampRate(double val, const std::string& units = "") = 0;
462 virtual bool setFirstSample(double val, const std::string& units = "") = 0;
463
465 virtual h5geo::Domain getDomain() = 0;
467 virtual h5geo::SeisDataType getDataType() = 0;
469 virtual h5geo::SurveyType getSurveyType() = 0;
471 virtual double getSRD(const std::string& lengthUnits = "") = 0;
472
474 virtual bool hasPKeySort(const std::string& pKeyName) = 0;
476 virtual bool removePKeySort(const std::string& pKeyName) = 0;
481 virtual bool addPKeySort(const std::string& pKeyName) = 0;
482
484 virtual bool updateTraceHeaderSampRate() = 0;
486 virtual bool updateTraceHeaderNSamp() = 0;
487
490
492 virtual std::optional<h5gt::DataSet> getTextHeaderD() = 0;
494 virtual std::optional<h5gt::DataSet> getBinHeaderD() = 0;
496 virtual std::optional<h5gt::DataSet> getTraceHeaderD() = 0;
498 virtual std::optional<h5gt::DataSet> getTraceD() = 0;
500 virtual std::optional<h5gt::Group> getSortG() = 0;
502 virtual std::optional<h5gt::Group> getUValG() = 0;
504 virtual std::optional<h5gt::Group> getIndexesG() = 0;
505
507 virtual std::optional<h5gt::Group> getSEGYG() = 0;
509 virtual std::optional<h5gt::DataSet> getSEGYTextHeaderD() = 0;
511 virtual std::optional<h5gt::DataSet> getSEGYBinHeader2BytesD() = 0;
513 virtual std::optional<h5gt::DataSet> getSEGYBinHeader4BytesD() = 0;
515 virtual std::optional<h5gt::DataSet> getSEGYTraceHeader2BytesD() = 0;
517 virtual std::optional<h5gt::DataSet> getSEGYTraceHeader4BytesD() = 0;
519 virtual std::optional<h5gt::DataSet> getSEGYTraceFloatD() = 0;
520
522 virtual bool updateTraceHeaderLimits(size_t nTrcBuffer = 1e7) = 0;
524 virtual bool updatePKeySort(const std::string& pKeyName) = 0;
525
529 virtual Eigen::MatrixXd calcBoundary(
530 const std::string& lengthUnits = "",
531 bool doCoordTransform = false) = 0;
532
535 virtual bool exportToVol(H5Vol* vol,
536 const std::string& xHeader = "CDP_X",
537 const std::string& yHeader = "CDP_Y",
538 const std::string& ilHeader = "INLINE",
539 const std::string& xlHeader = "XLINE",
540 double ilMin = std::numeric_limits<double>::min(),
541 double ilMax = std::numeric_limits<double>::max(),
542 double xlMin = std::numeric_limits<double>::min(),
543 double xlMax = std::numeric_limits<double>::max(),
544 size_t fromSampInd = 0,
545 size_t nSamp = std::numeric_limits<size_t>::max(),
546 std::function<void(double)> progressCallback = nullptr) = 0;
547
548 virtual bool exportToSEGY(
549 const std::string& segyFile,
550 size_t trcBuffer = 10000,
551 h5geo::Endian endian = h5geo::Endian::Big,
552 std::function<void(double)> progressCallback = nullptr) = 0;
553};
554
555using H5Seis_ptr = std::unique_ptr<H5Seis, h5geo::ObjectDeleter>;
556
557#endif // H5SEIS_H
Base class for geo-objects.
Definition h5baseobject.h:13
A container built around HDF5 file and used for storing and manipulating H5Seis objects.
Definition h5seiscontainer.h:15
Provides API to work with seismic.
Definition h5seis.h:33
virtual bool setFirstSample(double val, const std::string &units="")=0
Set first sample.
virtual bool checkTraceLimits(const size_t &fromTrc, size_t &nTrc)=0
Check fromTrc, nTrc (passed by reference) and diminish nTrc to fit in data limits (if fromTrc is insi...
virtual bool writeTraceHeader(const std::string &hdrName, Eigen::Ref< Eigen::MatrixXd > hdr, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Write trace header by name and trace indexes.
virtual Eigen::MatrixXd calcBoundary(const std::string &lengthUnits="", bool doCoordTransform=false)=0
Calculate XY boundary around the survey.
virtual bool updateTraceHeaderSampRate()=0
Set trace header samp rate from binary header.
virtual bool writeBinHeader(const std::string &hdrName, const double &value, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Write text header.
virtual h5geo::SurveyType getSurveyType()=0
Set survey type for the seismic (TWO_D or THREE_D)
virtual std::optional< h5gt::DataSet > getBinHeaderD()=0
Get binary header DataSet.
virtual bool removePKeySort(const std::string &pKeyName)=0
Remove PKey sorting.
virtual bool updatePKeySort(const std::string &pKeyName)=0
Update sorting for prepared PKey
virtual size_t getNBinHdr()=0
Get number of binary headers.
virtual bool writeBinHeader(const Eigen::Ref< const Eigen::VectorXd > &binHdrVec)=0
Write text header.
virtual bool setDomain(const h5geo::Domain &domain)=0
Set domain for the seismic (TVD, TVDSS, TWT, OWT)
virtual std::optional< h5gt::Group > getIndexesG()=0
Get sorting indexes Group.
virtual bool writeBinHeader(const std::vector< double > &binHdrVec)=0
Write text header.
virtual std::map< std::string, double > getBinHeader()=0
Get binary header.
virtual bool setSRD(double val, const std::string &lengthUnits="")=0
Set Seismic Reference Datum.
virtual size_t getNTrcHdr()=0
Get number trace headers (usually 78)
virtual bool readSEGYTracesMMap(const std::vector< std::string > &segyFiles, std::vector< h5geo::SegyFormat > formats=std::vector< h5geo::SegyFormat >(), std::vector< h5geo::Endian > endians=std::vector< h5geo::Endian >(), std::vector< std::vector< std::string > > trcHdrNamesArr=std::vector< std::vector< std::string > >(), size_t trcBuffer=10000, int nThreads=-1, std::function< void(double)> progressCallback=nullptr)=0
Read trace headers and trace data from SEGY file using Memory Mapping.
virtual ptrdiff_t getTraceHeaderIndex(const std::string &hdrName)=0
Get index (row/col within 2D dataset) for a given trace header.
virtual size_t getPKeyTraceSize(const std::string &pKey, double pMin, double pMax, size_t pStep=1)=0
Get number of traces to be selected for a given PKey
virtual std::optional< h5gt::DataSet > getSEGYTraceFloatD()=0
Get SEGY float trace DataSet (for mapped H5Seis only)
virtual bool writeTrace(Eigen::Ref< Eigen::MatrixXf > TRACE, const size_t &fromTrc=0, const size_t &fromSampInd=0, const std::string &dataUnits="")=0
Write block of traces starting from trace fromTrc and from sample fromSampInd
virtual double getSRD(const std::string &lengthUnits="")=0
Get Seismic Reference Datum.
virtual double getTraceHeaderMin(const std::string &hdrName, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Get trace header minimal value for a given trace header.
virtual bool setNSamp(size_t nSamp)=0
Resize trace DataSet.
virtual bool writeTextHeader(const std::vector< std::string > &txtHdr)=0
Write text header.
virtual std::map< std::string, double > getTraceHeaderMin()=0
Get trace header minimal values.
virtual Eigen::MatrixXd getTraceHeader(const std::vector< std::string > &hdrNames, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const std::vector< std::string > &unitsFrom=std::vector< std::string >(), const std::vector< std::string > &unitsTo=std::vector< std::string >())=0
Get trace headers by indexes and names.
virtual bool readSEGYTextHeader(const std::string &segy, h5geo::TextEncoding encoding=static_cast< h5geo::TextEncoding >(0))=0
Read text header from SEGY file.
virtual Eigen::MatrixXd getTraceHeader(const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcHdrInd, const std::vector< std::string > &unitsFrom=std::vector< std::string >(), const std::vector< std::string > &unitsTo=std::vector< std::string >())=0
Get trace headers by indexes.
virtual std::optional< h5gt::Group > getSEGYG()=0
Get SEGY Group (for mapped H5Seis only)
virtual Eigen::MatrixXd getTraceHeader(const std::vector< std::string > &hdrNames, const std::vector< size_t > &trcInd, const std::vector< std::string > &unitsFrom=std::vector< std::string >(), const std::vector< std::string > &unitsTo=std::vector< std::string >())=0
Get trace header by indexes and name.
virtual ptrdiff_t getBinHeaderIndex(const std::string &hdrName)=0
Get index (position within 1D dataset) for a given binary header.
virtual size_t getNTrc()=0
Get number of traces.
virtual Eigen::VectorX< size_t > getPKeyIndexes(const std::string &pKey, double pMin, double pMax, size_t pStep=1)=0
Get trace indexes for given PKey
virtual std::map< std::string, double > getTraceHeaderMax()=0
Get trace header maximal values.
virtual bool readSEGYTraces(const std::vector< std::string > &segyFiles, std::vector< h5geo::SegyFormat > formats=std::vector< h5geo::SegyFormat >(), std::vector< h5geo::Endian > endians=std::vector< h5geo::Endian >(), std::vector< std::vector< std::string > > trcHdrNamesArr=std::vector< std::vector< std::string > >(), size_t trcBuffer=10000, std::function< void(double)> progressCallback=nullptr)=0
Read trace headers and trace data from SEGY file.
virtual std::vector< std::string > getTextHeader()=0
Get text header.
virtual Eigen::VectorXd getPKeyValues(const std::string &pKey, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Get PKey unique values.
virtual double getTraceHeaderMax(const std::string &hdrName, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Get trace header maximal value for a given trace header.
virtual bool setSurveyType(const h5geo::SurveyType &surveyType)=0
Set survey type for the seismic (TWO_D or THREE_D)
virtual bool generateSTKGeometry(double x0, double dx, size_t nx, double y0, double dy, size_t ny, double z, double orientation, const std::string &lengthUnits="", bool doCoordTransform=false)=0
Convenient function to prepare geometry for STACK data.
virtual bool writeTrace(Eigen::Ref< Eigen::MatrixXf > TRACE, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const size_t &fromSampInd=0, const std::string &dataUnits="")=0
Write traces using indexes.
virtual bool hasPKeySort(const std::string &pKeyName)=0
Check if PKey sort is prepared.
virtual double getBinHeader(const std::string &hdrName, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Get text header by name.
virtual std::optional< h5gt::DataSet > getSEGYBinHeader2BytesD()=0
Get SEGY 2-bytes binary header DataSet (for mapped H5Seis only)
virtual double getSampRate(const std::string &units="")=0
Get sampling rate.
virtual std::optional< h5gt::DataSet > getSEGYTraceHeader2BytesD()=0
Get SEGY 2-bytes trace header DataSet (for mapped H5Seis only)
virtual std::optional< h5gt::DataSet > getSEGYBinHeader4BytesD()=0
Get SEGY 4-bytes binary header DataSet (for mapped H5Seis only)
virtual bool updateTraceHeaderLimits(size_t nTrcBuffer=1e7)=0
Calculate and write min/max trace headers.
virtual bool setDataType(const h5geo::SeisDataType &seisType)=0
Set datatype for the seismic (STACK or PRESTACK)
virtual bool exportToVol(H5Vol *vol, const std::string &xHeader="CDP_X", const std::string &yHeader="CDP_Y", const std::string &ilHeader="INLINE", const std::string &xlHeader="XLINE", double ilMin=std::numeric_limits< double >::min(), double ilMax=std::numeric_limits< double >::max(), double xlMin=std::numeric_limits< double >::min(), double xlMax=std::numeric_limits< double >::max(), size_t fromSampInd=0, size_t nSamp=std::numeric_limits< size_t >::max(), std::function< void(double)> progressCallback=nullptr)=0
Export seismic to H5Vol.
virtual bool addPKeySort(const std::string &pKeyName)=0
Prepare sorting.
virtual bool setNTrc(size_t nTrc)=0
Resize trace and trace header DataSets.
virtual Eigen::MatrixXd getTraceHeader(const std::vector< size_t > &trcInd, const std::vector< size_t > &trcHdrInd, const std::vector< std::string > &unitsFrom=std::vector< std::string >(), const std::vector< std::string > &unitsTo=std::vector< std::string >())=0
Get trace headers by indexes.
virtual bool writeTraceHeader(const std::string &hdrName, Eigen::Ref< Eigen::MatrixXd > hdr, const size_t &fromTrc=0, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Write trace header by name.
virtual H5SeisContainer * openSeisContainer()=0
Open H5SeisContainer where current seismic resides.
virtual Eigen::MatrixXf getTrace(const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const size_t &fromSampInd=0, size_t nSamp=std::numeric_limits< size_t >::max(), const std::string &dataUnits="")=0
Get traces by indexes.
virtual Eigen::MatrixXf getTrace(const size_t &fromTrc, size_t nTrc=1, const size_t &fromSampInd=0, size_t nSamp=std::numeric_limits< size_t >::max(), const std::string &dataUnits="")=0
Get block of traces.
virtual std::optional< h5gt::Group > getUValG()=0
Get sorting unique values Group.
virtual size_t getPKeySize(const std::string &pKey, double pMin, double pMax, size_t pStep=1)=0
Get number of unique values for a given PKey
virtual bool checkTraceHeaderLimits(const size_t &fromHdr, size_t &nHdr)=0
Check fromHdr and nHdr (passed by reference) and diminish nHdr to fit in data limits (if fromTrc is i...
virtual size_t getNTextHdrRows()=0
Get number of text header rows.
virtual size_t getNSamp()=0
Get number of samples.
virtual bool setSampRate(double val, const std::string &units="")=0
Set sampling rate.
virtual std::vector< std::string > getPKeyNames()=0
Get names of prepared PKeys (names of prepared sortings PKeys)
virtual bool writeTraceHeader(const Eigen::Ref< const Eigen::MatrixXd > &HDR, const size_t &fromTrc=0, const size_t &fromHdrInd=0)=0
Write block of trace headers starting from trace fromTrc and from header index fromHdrInd
virtual Eigen::VectorXd getSamples(const size_t &trcInd, const std::string &units="")=0
Get vector of equally spaced samples in specified units.
virtual bool writeXYTraceHeaders(const std::vector< std::string > &xyHdrNames, Eigen::Ref< Eigen::MatrixX2d > &xy, const size_t &fromTrc=0, const std::string &lengthUnits="", bool doCoordTransform=false)=0
Write XY trace headers (two columns in Eigen column-major matrix)
virtual bool writeXYTraceHeaders(const std::vector< std::string > &xyHdrNames, Eigen::Ref< Eigen::MatrixX2d > &xy, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const std::string &lengthUnits="", bool doCoordTransform=false)=0
Write XY trace headers (two columns in Eigen column-major matrix)
virtual bool generatePRESTKGeometry(double src_x0, double src_dx, size_t src_nx, double src_y0, double src_dy, size_t src_ny, double src_z, double rec_x0, double rec_dx, size_t rec_nx, double rec_y0, double rec_dy, size_t rec_ny, double rec_z, double orientation, bool moveRec, const std::string &lengthUnits="", bool doCoordTransform=false)=0
Convenient function to prepare geometry for PRESTACK data.
virtual double getLastSample(const size_t &trcInd, const std::string &units="")=0
Get last sample.
virtual bool readSEGYBinHeader(const std::string &segy, h5geo::Endian endian=static_cast< h5geo::Endian >(0))=0
Read binary header from SEGY file.
virtual std::optional< h5gt::DataSet > getSEGYTraceHeader4BytesD()=0
Get SEGY 4-bytes trace header DataSet (for mapped H5Seis only)
virtual h5geo::Domain getDomain()=0
Get domain (TVD, TVDSS, TWT, OWT)
virtual double getFirstSample(const size_t &trcInd, const std::string &units="")=0
Get first sample.
virtual bool writeTextHeader(const char(&txtHdr)[40][80])=0
Write text header.
virtual size_t getPKeySize(const std::string &pKey)=0
Get number of unique values for a given PKey
virtual bool checkSampleLimits(const size_t &fromSampInd, size_t &nSamp)=0
Check fromSampInd and nSamp (passed by reference) and diminish nSamp to fit in data limits (if fromSa...
virtual h5geo::SeisDataType getDataType()=0
Get datatype for the seismic (STACK or PRESTACK)
virtual Eigen::MatrixXd getXYTraceHeaders(const std::vector< std::string > &xyHdrNames, const size_t &fromTrc=0, size_t nTrc=std::numeric_limits< size_t >::max(), const std::string &lengthUnits="", bool doCoordTransform=false)=0
Get XY trace headers (two columns in Eigen column-major matrix)
virtual std::optional< h5gt::DataSet > getTraceD()=0
Get trace DataSet.
virtual Eigen::MatrixXd getTraceHeader(const size_t &fromTrc, size_t nTrc=1, const size_t &fromHdr=0, size_t nHdr=std::numeric_limits< size_t >::max(), const std::vector< std::string > &unitsFrom=std::vector< std::string >(), const std::vector< std::string > &unitsTo=std::vector< std::string >())=0
Get block of trace headers.
virtual Eigen::VectorX< size_t > getSortedData(Eigen::MatrixXf &TRACE, Eigen::MatrixXd &HDR, const std::vector< std::string > &keyList, const std::vector< double > &minList, const std::vector< double > &maxList, size_t pStep=1, size_t fromSampInd=0, size_t nSamp=std::numeric_limits< size_t >::max(), const std::string &dataUnits="", const std::string &lengthUnits="", bool doCoordTransform=false)=0
Get sorted data based on precalculated primary sort keys.
virtual std::optional< h5gt::DataSet > getTraceHeaderD()=0
Get trace header DataSet.
virtual bool updateTraceHeaderNSamp()=0
Set trace header number of samples from binary header.
virtual std::optional< h5gt::DataSet > getSEGYTextHeaderD()=0
Get SEGY text header DataSet (for mapped H5Seis only)
virtual Eigen::MatrixXd getXYTraceHeaders(const std::vector< std::string > &xyHdrNames, const Eigen::Ref< const Eigen::VectorX< size_t > > &trcInd, const std::string &lengthUnits="", bool doCoordTransform=false)=0
Get XY trace headers (two columns in Eigen column-major matrix)
virtual std::optional< h5gt::DataSet > getTextHeaderD()=0
Get text header DataSet.
virtual H5SeisParam getParam()=0
Get parameters that were used to create current seis.
virtual std::optional< h5gt::Group > getSortG()=0
Get sorting Group.
virtual bool writeBinHeader(const double(&binHdr)[30])=0
Write binary header.
virtual Eigen::VectorXd getTraceHeader(const std::string &hdrName, const size_t &fromTrc=0, size_t nTrc=1, const std::string &unitsFrom="", const std::string &unitsTo="")=0
Get block of trace header by name.
Provides API to work with volumes.
Definition h5vol.h:15
Class for creating H5Seis.
Definition h5base.h:165