Commit d6f5641a authored by thomas.forbriger's avatar thomas.forbriger

libdatrwxx [MERGE] uniquely specify sign of correction

Merge branch '25-libdatrwxx-miniseed-consistency-checks'
parents 735775bb 51045329
......@@ -29,11 +29,12 @@
*
* REVISIONS and CHANGES
* - 23/06/2016 V1.0 Thomas Forbriger
* - 12/07/2016 V1.1 thof: uniquely specify sign of correction
*
* ============================================================================
*/
#define DATRW_MSEEDREAD_MSEEDRECORD_OTHER_CC_VERSION \
"DATRW_MSEEDREAD_MSEEDRECORD_OTHER_CC V1.0"
"DATRW_MSEEDREAD_MSEEDRECORD_OTHER_CC V1.1"
#include <datrwxx/mseedread.h>
#include<aff/subarray.h>
......@@ -77,27 +78,35 @@ namespace datrw {
libtime::TRelativeTime corr(0,0,0,0,0,100);
//long int tcorr=this->recordheader().tcorr;
int tcorr=this->recordheader().tcorr;
if (tcorr > 0)
if (tcorr >= 0)
{
retval += (corr * tcorr);
}
else
{
// result of multiplication of libtime::TAbsoluteTime with
// any value (also negative) provides a positive result;
// swap sign just to make things clear
tcorr *= -1;
retval -= (corr * tcorr);
}
}
if (this->hasblockette1001())
{
const int& tcorr=this->blockette1001().iusec();
int tcorr=this->blockette1001().iusec();
if (tcorr != 0)
{
libtime::TRelativeTime corr(0,0,0,0,0,1);
if (tcorr > 0)
if (tcorr >= 0)
{
retval += (corr * tcorr);
}
else
{
// result of multiplication of libtime::TAbsoluteTime with
// any value (also negative) provides a positive result;
// swap sign just to make things clear
tcorr *= -1;
retval -= (corr * tcorr);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment