void BandPass::_buildData(const BinMap& map, float scale, float /*offset*/) { int mapId = map.hash(); _dataSets.insert(mapId, QVector<float>(map.numberBins()) ); for( unsigned int i=0; i < map.numberBins(); ++i ) { _dataSets[mapId][i] = scale * _evaluate(map.binAssignmentNumber(i)); } _zeroChannelsMap(map); }
// set the dataset for a specified map to zero for all killed bands void BandPass::_zeroChannelsMap(const BinMap& map) { foreach( const Range<float>& r, _killed.subranges() ) { int min = map.binIndex(r.min()); int max = map.binIndex(r.max()); if( max < min ) { int tmp; tmp = max; max = min; min = tmp; }; int mapId=map.hash(); if(_dataSets[mapId].size() < max ) _dataSets[mapId].resize(max + 1); do { _dataSets[mapId][min] = 0.0; } while( ++min <= max ); } }
void BandPass::reBin(const BinMap& map) { _currentMap = map; int mapId = map.hash(); _currentMapId = mapId; if( ! _dataSets.contains(mapId) ) { double scale = map.width()/_primaryMap.width(); // scale the RMS and median _rms[mapId]= _rms[_primaryMapId] * std::sqrt( 1.0/scale ); _median[mapId] = _median[_primaryMapId] * scale; _mean[mapId] = _mean[_primaryMapId] * scale; // scale and set the intensities _buildData(_currentMap, scale, 0.0); //for( unsigned int i=0; i < map.numberBins(); ++i ) { // _dataSets[mapId][i] = scale * _evaluate(map.binAssignmentNumber(i)); //} //_zeroChannelsMap(map); } }