mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 19:40:42 +02:00
included subexptime in metadata for hdf5
This commit is contained in:
parent
ad3e3ce255
commit
c724756b5f
@ -102,11 +102,12 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
|||||||
* @param nx number of pixels in x direction
|
* @param nx number of pixels in x direction
|
||||||
* @param ny number of pixels in y direction
|
* @param ny number of pixels in y direction
|
||||||
* @param at acquisition time
|
* @param at acquisition time
|
||||||
|
* @param at sub exposure time
|
||||||
* @param ap acquisition period
|
* @param ap acquisition period
|
||||||
* @returns OK or FAIL
|
* @returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
int CreateMasterFile(bool en, uint32_t size,
|
int CreateMasterFile(bool en, uint32_t size,
|
||||||
uint32_t nx, uint32_t ny, uint64_t at, uint64_t ap);
|
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* End of Acquisition
|
* End of Acquisition
|
||||||
|
@ -231,13 +231,14 @@ public:
|
|||||||
* @param ny number of pixels in y direction
|
* @param ny number of pixels in y direction
|
||||||
* @param nf number of images
|
* @param nf number of images
|
||||||
* @param acquisitionTime acquisition time
|
* @param acquisitionTime acquisition time
|
||||||
|
* @param subexposuretime sub exposure time
|
||||||
* @param acquisitionPeriod acquisition period
|
* @param acquisitionPeriod acquisition period
|
||||||
* @param version version of software for hdf5 writing
|
* @param version version of software for hdf5 writing
|
||||||
* @returns 0 for success and 1 for fail
|
* @returns 0 for success and 1 for fail
|
||||||
*/
|
*/
|
||||||
static int CreateMasterDataFile(H5File*& fd, string fname, bool owenable,
|
static int CreateMasterDataFile(H5File*& fd, string fname, bool owenable,
|
||||||
uint32_t dr, bool tenE, uint32_t size, uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf,
|
uint32_t dr, bool tenE, uint32_t size, uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf,
|
||||||
uint64_t acquisitionTime, uint64_t acquisitionPeriod, double version)
|
uint64_t acquisitionTime, uint64_t subexposuretime, uint64_t acquisitionPeriod, double version)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Exception::dontPrint(); //to handle errors
|
Exception::dontPrint(); //to handle errors
|
||||||
@ -306,6 +307,12 @@ public:
|
|||||||
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
|
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
|
||||||
attribute.write(strdatatype, string("ns"));
|
attribute.write(strdatatype, string("ns"));
|
||||||
|
|
||||||
|
//SubExptime
|
||||||
|
dataset = group5.createDataSet ( "sub exposure time", PredType::STD_U64LE, dataspace );
|
||||||
|
dataset.write ( &subexposuretime, PredType::STD_U64LE);
|
||||||
|
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
|
||||||
|
attribute.write(strdatatype, string("ns"));
|
||||||
|
|
||||||
//Period
|
//Period
|
||||||
dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace );
|
dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace );
|
||||||
dataset.write ( &acquisitionPeriod, PredType::STD_U64LE);
|
dataset.write ( &acquisitionPeriod, PredType::STD_U64LE);
|
||||||
|
@ -181,7 +181,7 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
|
|||||||
|
|
||||||
|
|
||||||
int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||||
uint32_t nx, uint32_t ny, uint64_t at, uint64_t ap) {
|
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) {
|
||||||
|
|
||||||
//beginning of every acquisition
|
//beginning of every acquisition
|
||||||
numFramesInFile = 0;
|
numFramesInFile = 0;
|
||||||
@ -193,7 +193,7 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
|||||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
|
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
|
||||||
*dynamicRange, en, size, nx, ny, *numImages, at, ap, HDF5_WRITER_VERSION);
|
*dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION);
|
||||||
pthread_mutex_unlock(&Mutex);
|
pthread_mutex_unlock(&Mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user