areaDetector  3-5-0
EPICS areaDetector framework
NDFileHDF5Dataset.h
Go to the documentation of this file.
1 #ifndef NDFILEHDF5DATASET_H_
2 #define NDFILEHDF5DATASET_H_
3 
4 #include <string>
5 #include <hdf5.h>
6 #include "NDPluginFile.h"
8 
12 {
13  public:
14  NDFileHDF5Dataset(asynUser *pAsynUser, const std::string& name, hid_t dataset);
15  virtual ~NDFileHDF5Dataset();
16 
17  asynStatus configureDims(NDArray *pArray, bool multiframe, int extradimensions, int *extra_dims, int *user_chunking);
18  asynStatus extendDataSet(int extradims);
19  asynStatus extendDataSet(int extradims, hsize_t *offsets);
20  asynStatus verifyChunking(NDArray *pArray);
21  void configureCompression(Codec_t codec);
22  asynStatus writeFile(NDArray *pArray, hid_t datatype, hid_t dataspace, hsize_t *framesize);
23  hid_t getHandle();
24  asynStatus flushDataset();
25  hsize_t getDim(int index);
26  hsize_t getMaxDim(int index);
27  hsize_t getOffset(int index);
28  hsize_t getVirtualDim(int index);
29 
30  private:
31 
32  asynUser *pAsynUser_; // Pointer to the asynUser structure
33  std::string name_; // Name of this dataset
34  hid_t dataset_; // Dataset handle
35  int nextRecord_;
36  int arrayDims[ND_ARRAY_MAX_DIMS];
37  bool multiFrame_; // Whether this is a multi frame dataset
38  int rank_; // number of dimensions
39  int extra_rank_; // number of extra dimensions
40  hsize_t *dims_; // Array of current dimension sizes. This updates as various dimensions grow.
41  hsize_t *chunkdims_; // Array of current configured chunk dimension sizes.
42  hsize_t *maxdims_; // Array of maximum dimension sizes. The value -1 is HDF5 term for infinite.
43  hsize_t *offset_; // Array of current offset in each dimension. The frame dimensions always have
44  // 0 offset but additional dimensions may grow as new frames are added.
45  hsize_t *virtualdims_; // The desired sizes of the extra (virtual) dimensions: {Y, X, n}
46  Codec_t codec; // Definition of codec used to compress the data.
47  char *ptrDimensionNames[ND_ARRAY_MAX_DIMS]; // Array of strings with human readable names for each dimension
48  char *dimsreport_; // A string which contain a verbose report of all dimension sizes. The method getDimsReport fill in this
49 };
50 
51 
52 #endif
53 
Class used for writing a Dataset with the NDFileHDF5 plugin.
Definition: NDFileHDF5Dataset.h:11
void configureCompression(Codec_t codec)
Store codec definition.
Definition: NDFileHDF5Dataset.cpp:231
asynStatus extendDataSet(int extradims)
extendDataSet.
Definition: NDFileHDF5Dataset.cpp:103
hsize_t getVirtualDim(int index)
Return the requested virtual dimension size.
Definition: NDFileHDF5Dataset.cpp:449
NDFileHDF5Dataset(asynUser *pAsynUser, const std::string &name, hid_t dataset)
Constructor.
Definition: NDFileHDF5Dataset.cpp:17
#define ND_ARRAY_MAX_DIMS
NDArray.h.
Definition: NDArray.h:25
name
Definition: makeDbAndEdl.py:232
virtual ~NDFileHDF5Dataset()
Definition: NDFileHDF5Dataset.cpp:27
hsize_t getDim(int index)
Return the requested dimension size.
Definition: NDFileHDF5Dataset.cpp:410
asynStatus verifyChunking(NDArray *pArray)
Check if pArray dimensions and codec match hdf5 dataset definition.
Definition: NDFileHDF5Dataset.cpp:180
Definition: Codec.h:20
hsize_t getMaxDim(int index)
Return the requested max dimension size.
Definition: NDFileHDF5Dataset.cpp:423
asynStatus configureDims(NDArray *pArray, bool multiframe, int extradimensions, int *extra_dims, int *user_chunking)
configureDims.
Definition: NDFileHDF5Dataset.cpp:44
asynStatus writeFile(NDArray *pArray, hid_t datatype, hid_t dataspace, hsize_t *framesize)
writeFile.
Definition: NDFileHDF5Dataset.cpp:243
hsize_t getOffset(int index)
Return the requested offset size.
Definition: NDFileHDF5Dataset.cpp:436
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
Definition: NDFileHDF5Layout.h:42
asynStatus flushDataset()
Definition: NDFileHDF5Dataset.cpp:378
hid_t getHandle()
getHandle.
Definition: NDFileHDF5Dataset.cpp:373