# HG changeset patch # User paul # Date 2017-03-15 09:30:23 # Node ID d301b368f8835d170260a7fa214c4f6912097a7d # Parent da15683fb282f1d3ec471f1d2193934a63b9f771 Bug #978 Mauvais nombre de FFT retiré lors du filtrage PAS diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters -21ada91882790323b08a38518ed1af5a36fa4deb header/lfr_common_headers +f97721719ddb7e088956d5fd3cffb0f9587a041b header/lfr_common_headers diff --git a/src/processing/fsw_processing.c b/src/processing/fsw_processing.c --- a/src/processing/fsw_processing.c +++ b/src/processing/fsw_processing.c @@ -720,7 +720,8 @@ int getFBinMask( int index, unsigned cha unsigned char acquisitionTimeIsValid( unsigned int coarseTime, unsigned int fineTime, unsigned char channel) { - u_int64_t acquisitionTime; + u_int64_t acquisitionTimeStart; + u_int64_t acquisitionTimeStop; u_int64_t timecodeReference; u_int64_t offsetInFineTime; u_int64_t shiftInFineTime; @@ -734,8 +735,20 @@ unsigned char acquisitionTimeIsValid( un ret = 1; // compute acquisition time from caoarseTime and fineTime - acquisitionTime = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES ) + acquisitionTimeStart = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES ) + (u_int64_t) fineTime; + switch(channel) + { + case CHANNELF0: + acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F0; + break; + case CHANNELF1: + acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F1; + break; + case CHANNELF2: + acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F2; + break; + } // compute the timecode reference timecodeReference = (u_int64_t) ( (floor( ((double) coarseTime) / ((double) filterPar.sy_lfr_pas_filter_modulus) ) @@ -757,8 +770,8 @@ unsigned char acquisitionTimeIsValid( un + shiftInFineTime + tBadInFineTime; - if ( (acquisitionTime >= acquisitionTimeRangeMin) - && (acquisitionTime <= acquisitionTimeRangeMax) + if ( (acquisitionTimeStart >= acquisitionTimeRangeMin) + && (acquisitionTimeStart <= acquisitionTimeRangeMax) && (pasFilteringIsEnabled == 1) ) { ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored @@ -768,6 +781,21 @@ unsigned char acquisitionTimeIsValid( un ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging } + // the last sample of the data used to compute the matrix shall not be INSIDE the range, test it now, it depends on the channel + if (ret == 1) + { + if ( (acquisitionTimeStop >= acquisitionTimeRangeMin) + && (acquisitionTimeStop <= acquisitionTimeRangeMax) + && (pasFilteringIsEnabled == 1) ) + { + ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored + } + else + { + ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging + } + } + // printf("coarseTime = %x, fineTime = %x\n", // coarseTime, // fineTime);