Changeset 1637 for XIOS/trunk/src/filter
- Timestamp:
- 01/14/19 13:33:48 (5 years ago)
- Location:
- XIOS/trunk/src/filter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/filter/file_writer_filter.cpp
r1474 r1637 17 17 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 18 18 { 19 const bool detectMissingValue = ( !field->detect_missing_value.isEmpty()20 && !field->default_value.isEmpty()21 && field->detect_missing_value == true);19 const bool detectMissingValue = ( !field->default_value.isEmpty() && 20 ( (!field->detect_missing_value.isEmpty() || field->detect_missing_value == true) 21 || field->hasGridMask()) ); 22 22 23 23 CArray<double, 1> dataArray = (detectMissingValue) ? data[0]->data.copy() : data[0]->data; -
XIOS/trunk/src/filter/source_filter.cpp
r1250 r1637 7 7 namespace xios 8 8 { 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, bool compression, 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 10 bool compression /*= true*/, bool mask /*= false*/, 10 11 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 11 12 bool hasMissingValue /*= false*/, … … 14 15 , grid(grid) 15 16 , compression(compression) 17 , mask(mask) 16 18 , offset(offset) 17 19 , hasMissingValue(hasMissingValue), defaultValue(defaultValue) … … 40 42 } 41 43 else 42 grid->inputField(data, packet->data); 43 44 45 46 // if (compression) grid->inputField(data, packet->data) ; 47 // else 48 // { 49 // // just make a flat copy 50 // CArray<double, N> data_tmp(data.copy()) ; // supress const attribute 51 // CArray<double,1> dataTmp2(data_tmp.dataFirst(),shape(data.numElements()),neverDeleteData) ; 52 // packet->data = dataTmp2 ; 53 // } 44 { 45 if (mask) 46 grid->maskField(data, packet->data); 47 else 48 grid->inputField(data, packet->data); 49 } 54 50 // Convert missing values to NaN 55 51 if (hasMissingValue) -
XIOS/trunk/src/filter/source_filter.hpp
r1241 r1637 21 21 * \param gc the garbage collector associated with this filter 22 22 * \param grid the grid to which the data is attached 23 * \param compression 24 * \param mask 23 25 * \param offset the offset applied to the timestamp of all packets 24 26 * \param manualTrigger whether the output should be triggered manually … … 27 29 */ 28 30 CSourceFilter(CGarbageCollector& gc, CGrid* grid, 29 bool compression=true, 31 bool compression = true, 32 bool mask = false, 30 33 const CDuration offset = NoneDu, bool manualTrigger = false, 31 34 bool hasMissingValue = false, … … 61 64 62 65 private: 63 CGrid* grid; //!< The grid attached to the data the filter can accept64 const CDuration offset; //!< The offset applied to the timestamp of all packets66 CGrid* grid; //!< The grid attached to the data the filter can accept 67 const CDuration offset; //!< The offset applied to the timestamp of all packets 65 68 const bool hasMissingValue; 66 69 const double defaultValue; 67 const bool compression ; //!< indicate if the data need to be compressed : on client size : true, on server side : false 70 const bool compression ; //!< indicates if data need to be compressed : on client side : true, on server side : false 71 const bool mask ; //!< indicates whether grid mask should be applied (true for clients, false for servers) 68 72 }; // class CSourceFilter 69 73 } // namespace xios -
XIOS/trunk/src/filter/spatial_transform_filter.cpp
r1542 r1637 68 68 onOutputReady(outputPacket); 69 69 } 70 71 72 73 74 70 75 71 CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount) … … 201 197 const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest(); 202 198 const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest(); 203 const std::list<std::vector<bool> >& listLocalIndexMaskOnDest = gridTransformation->getLocalMaskIndexOnGridDest();204 199 const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos(); 205 200 … … 210 205 std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin(); 211 206 std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin(); 212 std::list<std::vector<bool> >::const_iterator itLocalMaskIndexOnDest = listLocalIndexMaskOnDest.begin();213 207 std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin(); 214 208 215 for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++it LocalMaskIndexOnDest, ++itAlgo)209 for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo) 216 210 { 217 211 CArray<double,1> dataCurrentSrc(dataCurrentDest); … … 266 260 267 261 dataCurrentDest.resize(*itNbListRecv); 268 const std::vector<bool>& localMaskDest = *itLocalMaskIndexOnDest; 269 for (int i = 0; i < localMaskDest.size(); ++i) 270 if (localMaskDest[i]) dataCurrentDest(i) = 0.0; 271 else dataCurrentDest(i) = defaultValue; 262 dataCurrentDest = 0.0; 272 263 273 264 std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true);
Note: See TracChangeset
for help on using the changeset viewer.