Changeset 1158 for XIOS/dev/dev_olga/src/filter/source_filter.cpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/filter/source_filter.cpp
r1021 r1158 3 3 #include "exception.hpp" 4 4 #include "calendar_util.hpp" 5 #include <limits> 5 6 6 7 namespace xios 7 8 { 8 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 9 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/) 10 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 11 bool hasMissingValue /*= false*/, 12 double defaultValue /*= 0.0*/) 10 13 : COutputPin(gc, manualTrigger) 11 14 , grid(grid) 12 15 , offset(offset) 16 , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 13 17 { 14 18 if (!grid) … … 29 33 packet->data.resize(grid->storeIndex_client.numElements()); 30 34 grid->inputField(data, packet->data); 35 36 // Convert missing values to NaN 37 if (hasMissingValue) 38 { 39 double nanValue = std::numeric_limits<double>::quiet_NaN(); 40 size_t nbData = packet->data.numElements(); 41 for (size_t idx = 0; idx < nbData; ++idx) 42 { 43 if (defaultValue == packet->data(idx)) 44 packet->data(idx) = nanValue; 45 } 46 } 31 47 32 48 onOutputReady(packet);
Note: See TracChangeset
for help on using the changeset viewer.