Source
os << LogIO::DEBUG1 << "mad = " << mad80 << ", mad_threshold = " << mad_threshold << " (factor: " << threshold << ", bin=" << average_factor << ")" << LogIO::POST;
//# --------------------------------------------------------------------
//# LineFinder.cc: this defines utility functions of line finding
//# --------------------------------------------------------------------
//# Copyright (C) 2015
//# National Astronomical Observatory of Japan
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
using namespace std;
//#define KS_DEBUG
using namespace casacore;
using namespace casacore;
using namespace casacore;
using namespace casacore;
using namespace casacore;
using namespace casacore;
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
namespace linefinder {//# NAMESPACE LINEFINDER - BEGIN
void getMask(size_t const num_mask, bool *mask,
list<pair<size_t,size_t>>& ranges,
bool const invert, bool const initialize)
{
bool const lineval = (!invert);
if (initialize) {
for (size_t i = 0; i<num_mask; ++i) {
mask[i] = invert;
}
}
for (list<pair<size_t,size_t>>::iterator iter=ranges.begin();
iter!=ranges.end(); ++iter) {
AlwaysAssert((*iter).second >= (*iter).first, AipsError);
for (size_t i=(*iter).first; i<(*iter).second+1 && i<num_mask; ++i) {
mask[i] = lineval;
}
}
}
list<pair<size_t,size_t>> MADLineFinder(size_t const num_data,
float const* data,
bool * mask,
float const threshold,
uint8_t max_iteration,
size_t const minwidth,
size_t const maxwidth,
size_t const avg_limit,
pair<size_t,size_t> edge)
{
LogIO os(_ORIGIN);
os << LogIO::DEBUG1 << "Start MADLineFinder" << LogIO::POST;
// value check and edge handling