Skip to content
Snippets Groups Projects
Commit 86de400d authored by Thomas Jürges's avatar Thomas Jürges
Browse files

SW-561: Add more meta-data to the HDF5 file in spectral mode

parent 0a00517c
No related branches found
No related tags found
No related merge requests found
......@@ -387,8 +387,41 @@ namespace LOFAR
currentSubBand.totalSizeInSamples, "",
currentSubBand.dataSet->LITTLE);
currentSubBand.dataSet->groupType().value = "SubbandDataset";
currentSubBand.dataSet->time().value = currentSubBand.time0;
currentSubBand.dataSet->bandNumber().value = bandNr;
currentSubBand.dataSet->sliceNumber().value = sliceNr;
currentSubBand.dataSet->samplesPerFrame().value = -1;
// Filled in when the sub-band is complete.
currentSubBand.dataSet->dataLength().value = 0;
/**
* ATTENTION!
* Storing this value makes no sense. Only if all frames of a
* sub-band contain the same number of samples then this value is
* representing something real.
* But obviously this is only true if all n frames of a sub-band,
* 0 < n < infinity, contain exactly the same number of samples.
*
* A simple example that is pretty general where this does not hold:
* - Every sub-band that has a last frame with less than 480
* samples would have two values: 480 and the number of samples
* in the last frame.
*/
currentSubBand.dataSet->samplesPerFrame().value =
frame.header.nOfSamplesPerFrame;
// TODO
currentSubBand.dataSet->centralFrequency().value = 0;
currentSubBand.dataSet->centralFrequencyUnit().value =
"not filled in";
currentSubBand.dataSet->bandwidth().value = 0;
currentSubBand.dataSet->bandwidthUnit().value = "not filled in";
currentSubBand.dataSet->timeResolution().value = 1;
currentSubBand.dataSet->timeResolutionUnit().value =
"not filled in";
currentSubBand.isInitialised = true;
LOG_INFO_STR("TBB: Band #"
<< currentSubBand.bandNr
<< " initialised with the following data: time0 = "
......@@ -405,19 +438,6 @@ namespace LOFAR
<< static_cast< uint32_t >(frame.header.rspID)
<< ", rcu = "
<< static_cast< uint32_t >(frame.header.rcuID));
currentSubBand.dataSet->time().value = 0;
currentSubBand.dataSet->centralFrequency().value = 0;
currentSubBand.dataSet->centralFrequencyUnit().value = "not filled in";
currentSubBand.dataSet->bandwidth().value = 0;
currentSubBand.dataSet->bandwidthUnit().value = "not filled in";
currentSubBand.dataSet->timeResolution().value = 0;
currentSubBand.dataSet->timeResolutionUnit().value = "not filled in";
currentSubBand.dataSet->bandNumber().value = bandNr;
currentSubBand.dataSet->sliceNumber().value =
frame.header.bandSliceNr >> 10;
currentSubBand.dataSet->samplesPerFrame().value = 0;
currentSubBand.dataSet->dataLength().value = 0;
}
/**
......@@ -635,12 +655,12 @@ namespace LOFAR
if(currentSubBand.currentSizeInSamples >=
currentSubBand.totalSizeInSamples)
{
currentSubBand.isComplete = true;
currentSubBand.dataSet->dataLength().value =
currentSubBand.currentSizeInSamples;
currentSubBand.dataSet->flagOffsets().create(
itsDumpInfo.itsFlagOffsets.size()).set(
itsDumpInfo.itsFlagOffsets);
currentSubBand.isComplete = true;
LOG_INFO_STR("TBB: Data for sub-band #"
<< bandNr
......@@ -719,7 +739,10 @@ namespace LOFAR
dipoleGroup->adc2voltage();
dipoleGroup->dispersionMeasure();
dipoleGroup->dispersionMeasureUnit();
dipoleGroup->nofSubbands();
const std::vector< uint32_t > subBandsToBeStored{
parset.getUint32Vector(
"Observation.TBB.TBBsetting.subbandList", true)};
dipoleGroup->nofSubbands().value = subBandsToBeStored.size();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment