00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "H5DataTypes/OceanOpticsConfigV1.h"
00017
00018
00019
00020
00021 #include <algorithm>
00022
00023
00024
00025
00026 #include "H5DataTypes/H5DataUtils.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/EnumType.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 namespace H5DataTypes {
00039
00040
00041
00042
00043 OceanOpticsConfigV1::OceanOpticsConfigV1 ( const Pds::OceanOptics::ConfigV1& data )
00044 : exposureTime(data.exposureTime())
00045 , strayLightConstant(data.strayLightConstant())
00046 {
00047 const ndarray<const double, 1>& waveLenCalib = data.waveLenCalib();
00048 std::copy(waveLenCalib.begin(), waveLenCalib.end(), this->waveLenCalib);
00049 const ndarray<const double, 1>& nonlinCorrect = data.nonlinCorrect();
00050 std::copy(nonlinCorrect.begin(), nonlinCorrect.end(), this->nonlinCorrect);
00051 }
00052
00053 OceanOpticsConfigV1::~OceanOpticsConfigV1()
00054 {
00055 }
00056
00057
00058 hdf5pp::Type
00059 OceanOpticsConfigV1::stored_type()
00060 {
00061 return native_type() ;
00062 }
00063
00064 hdf5pp::Type
00065 OceanOpticsConfigV1::native_type()
00066 {
00067 hdf5pp::CompoundType confType = hdf5pp::CompoundType::compoundType<OceanOpticsConfigV1>() ;
00068 confType.insert_native<float>("exposureTime", offsetof(OceanOpticsConfigV1, exposureTime));
00069 confType.insert_native<double>("waveLenCalib", offsetof(OceanOpticsConfigV1, waveLenCalib), 4);
00070 confType.insert_native<double>("nonlinCorrect", offsetof(OceanOpticsConfigV1, nonlinCorrect), 8);
00071 confType.insert_native<double>("strayLightConstant", offsetof(OceanOpticsConfigV1, strayLightConstant));
00072
00073 return confType ;
00074 }
00075
00076 void
00077 OceanOpticsConfigV1::store( const Pds::OceanOptics::ConfigV1& config, hdf5pp::Group grp )
00078 {
00079
00080 OceanOpticsConfigV1 data ( config ) ;
00081 storeDataObject ( data, "config", grp ) ;
00082 }
00083
00084
00085 }