Ignore:
Timestamp:
05/05/17 08:58:36 (7 years ago)
Author:
rlacroix
Message:

Instant filter: Optimize the sampling when it is easy to do so.

This way the "xios_field_is_active" function can provide more useful information for the current timestamp even if the user did not specify "freq_op" and "freq_offset".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/temporal_filter.cpp

    r1122 r1123  
    1212    : CFilter(gc, 1, this) 
    1313    , functor(createFunctor(opId, ignoreMissingValue, missingValue, tmpData)) 
    14     , samplingFreq(samplingFreq) 
     14    // If we can optimize the sampling when dealing with an instant functor we do it 
     15    , samplingFreq((functor->timeType() == func::CFunctor::instant && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq : samplingFreq) 
     16    , samplingOffset((functor->timeType() == func::CFunctor::instant && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq - initDate.getRelCalendar().getTimeStep() : samplingOffset) 
    1517    , opFreq(opFreq) 
    16     , nextSamplingDate(initDate + samplingOffset + initDate.getRelCalendar().getTimeStep()) 
    17     , nextOperationDate(initDate + samplingOffset + opFreq) 
     18    , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 
     19    , nextOperationDate(initDate + this->samplingOffset + opFreq) 
    1820    , isFirstOperation(true) 
    1921    , isOnceOperation(functor->timeType() == func::CFunctor::once) 
Note: See TracChangeset for help on using the changeset viewer.