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
h5volimpl.h
1#ifndef H5VOLIMPL_H
2#define H5VOLIMPL_H
3
4#include "../h5vol.h"
5#include "h5baseobjectimpl.h"
6
7class H5VolImpl : public H5BaseObjectImpl<H5Vol>
8{
9protected:
10 explicit H5VolImpl(const h5gt::Group &group);
11 virtual ~H5VolImpl() = default;
12
13public:
14
15 virtual bool writeData(
16 Eigen::Ref<Eigen::MatrixXf> data,
17 const size_t& iX0,
18 const size_t& iY0,
19 const size_t& iZ0,
20 const size_t& nX,
21 const size_t& nY,
22 const size_t& nZ,
23 const std::string& dataUnits = "") override;
24
25 virtual bool readSEGYSTACK(
26 const std::string& segy,
27 const size_t& ilHdrOffset,
28 const size_t& ilHdrSize,
29 const size_t& xlHdrOffset,
30 const size_t& xlHdrSize,
31 const size_t& xHdrOffset,
32 const size_t& xHdrSize,
33 const size_t& yHdrOffset,
34 const size_t& yHdrSize,
35 double sampRate,
36 size_t nSamp = 0,
37 size_t nTrc = 0,
38 h5geo::SegyFormat format = static_cast<h5geo::SegyFormat>(0),
39 h5geo::Endian endian = static_cast<h5geo::Endian>(0),
40 std::function<void(double)> progressCallback = nullptr) override;
41
42 virtual bool setDomain(const h5geo::Domain& domain) override;
43 virtual bool setOrigin(
44 Eigen::Ref<Eigen::Vector3d> v,
45 const std::string& lengthUnits = "",
46 const std::string& temporalUnits = "",
47 bool doCoordTransform = false) override;
48 virtual bool setSpacings(
49 Eigen::Ref<Eigen::Vector3d> v,
50 const std::string& lengthUnits = "",
51 const std::string& temporalunits = "") override;
52 virtual bool setOrientation(
53 double val,
54 const std::string& angularUnits = "") override;
55
56 virtual bool resize(
57 size_t nx, size_t ny, size_t nz) override;
58
59 virtual Eigen::MatrixXf getData(
60 const size_t& iX0,
61 const size_t& iY0,
62 const size_t& iZ0,
63 const size_t& nX,
64 const size_t& nY,
65 const size_t& nZ,
66 const std::string& dataUnits = "") override;
67
68 virtual h5geo::Domain getDomain() override;
69 virtual Eigen::VectorXd getOrigin(
70 const std::string& lengthUnits = "",
71 const std::string& temporalUnits = "",
72 bool doCoordTransform = false) override;
73 virtual Eigen::VectorXd getSpacings(
74 const std::string& lengthUnits = "",
75 const std::string& temporalUnits = "") override;
76 virtual double getOrientation(
77 const std::string& angularUnits = "") override;
78 virtual size_t getNX() override;
79 virtual size_t getNY() override;
80 virtual size_t getNZ() override;
81
82 virtual H5VolParam getParam() override;
83
84 virtual H5VolContainer* openVolContainer() const override;
85
86 virtual std::optional<h5gt::DataSet> getVolD() const override;
87
88 virtual bool exportToSEGY(
89 const std::string& segyFile,
90 h5geo::Endian endian = h5geo::Endian::Big,
91 std::function<void(double)> progressCallback = nullptr) override;
92
93 virtual bool recreateVolD(
94 size_t nX, size_t nY, size_t nZ,
95 size_t xChunk, size_t yChunk, size_t zChunk,
96 unsigned compressionLevel) override;
97
98 //----------- FRIEND CLASSES -----------
99 friend class H5VolContainerImpl;
100 friend class H5BaseObjectImpl<H5Vol>;
101 friend H5Vol* h5geo::openVol(h5gt::Group group);
102};
103
104#endif // H5VOLIMPL_H
Definition h5baseobjectimpl.h:12
A container built around HDF5 file and used for storing and manipulating H5Vol objects.
Definition h5volcontainer.h:15
Definition h5volcontainerimpl.h:8
Provides API to work with volumes.
Definition h5vol.h:15
Definition h5volimpl.h:8
virtual H5VolParam getParam() override
Get parameters that were used to create current map.
Definition h5volimpl.cpp:390
virtual bool recreateVolD(size_t nX, size_t nY, size_t nZ, size_t xChunk, size_t yChunk, size_t zChunk, unsigned compressionLevel) override
Unlink and create new dataset without copying data.
Definition h5volimpl.cpp:558
virtual bool readSEGYSTACK(const std::string &segy, const size_t &ilHdrOffset, const size_t &ilHdrSize, const size_t &xlHdrOffset, const size_t &xlHdrSize, const size_t &xHdrOffset, const size_t &xHdrSize, const size_t &yHdrOffset, const size_t &yHdrSize, double sampRate, size_t nSamp=0, size_t nTrc=0, h5geo::SegyFormat format=static_cast< h5geo::SegyFormat >(0), h5geo::Endian endian=static_cast< h5geo::Endian >(0), std::function< void(double)> progressCallback=nullptr) override
Read SEGY STACK data, i.e. nTrc should be equal to nil*nxl. After reading origin, spacings,...
Definition h5volimpl.cpp:52
virtual bool setDomain(const h5geo::Domain &domain) override
Set domain for the map (TVD, TVDSS, TWT, OWT)
Definition h5volimpl.cpp:80
virtual size_t getNY() override
Get number of Y values.
Definition h5volimpl.cpp:364
virtual bool setSpacings(Eigen::Ref< Eigen::Vector3d > v, const std::string &lengthUnits="", const std::string &temporalunits="") override
Set X,Y,Z unrotated spacings.
Definition h5volimpl.cpp:137
virtual Eigen::VectorXd getOrigin(const std::string &lengthUnits="", const std::string &temporalUnits="", bool doCoordTransform=false) override
Get coordinates of origin.
Definition h5volimpl.cpp:249
virtual size_t getNZ() override
Get number of Z values.
Definition h5volimpl.cpp:377
virtual size_t getNX() override
Get number of X values.
Definition h5volimpl.cpp:351
virtual double getOrientation(const std::string &angularUnits="") override
Get XY plane orientation.
Definition h5volimpl.cpp:342
virtual bool setOrientation(double val, const std::string &angularUnits="") override
Set XY plane orientation.
Definition h5volimpl.cpp:174
virtual Eigen::VectorXd getSpacings(const std::string &lengthUnits="", const std::string &temporalUnits="") override
Get X,Y,Z unrotated spacings.
Definition h5volimpl.cpp:302
virtual Eigen::MatrixXf getData(const size_t &iX0, const size_t &iY0, const size_t &iZ0, const size_t &nX, const size_t &nY, const size_t &nZ, const std::string &dataUnits="") override
Read subvolume starting from iX0, iY0, iZ0 indices. data matrix is of size: nRows=nX,...
Definition h5volimpl.cpp:205
virtual bool resize(size_t nx, size_t ny, size_t nz) override
Resize volume.
Definition h5volimpl.cpp:184
virtual bool setOrigin(Eigen::Ref< Eigen::Vector3d > v, const std::string &lengthUnits="", const std::string &temporalUnits="", bool doCoordTransform=false) override
Set coordinates of origin.
Definition h5volimpl.cpp:87
virtual bool writeData(Eigen::Ref< Eigen::MatrixXf > data, const size_t &iX0, const size_t &iY0, const size_t &iZ0, const size_t &nX, const size_t &nY, const size_t &nZ, const std::string &dataUnits="") override
Write subvolume starting from iX0, iY0, iZ0 indices. data matrix is of size: nRows=nX,...
Definition h5volimpl.cpp:16
virtual h5geo::Domain getDomain() override
Get domain (TVD, TVDSS, TWT, OWT)
Definition h5volimpl.cpp:243
virtual std::optional< h5gt::DataSet > getVolD() const override
Get current vol's DataSet.
Definition h5volimpl.cpp:448
virtual H5VolContainer * openVolContainer() const override
Open H5VolContainer where current vol resides.
Definition h5volimpl.cpp:441
H5GEO_EXPORT H5Vol * openVol(h5gt::Group group)
Factory function for opening H5Vol.
Definition h5baseimpl.cpp:2080
Class for creating H5Vol.
Definition h5base.h:116