// // C++ Interface: Scantable // // Description: // // // Author: Malte Marquarding , (C) 2005 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAPSCANTABLE_H #define ASAPSCANTABLE_H // STL #include #include #include #include #include #include // AIPS++ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MathUtils.h" #include "STBaselineEnum.h" #include "STFit.h" #include "STFitEntry.h" #include "STFocus.h" #include "STFrequencies.h" #include "STHeader.h" #include "STHistory.h" #include "STMolecules.h" #include "STPol.h" #include "STSelector.h" #include "STTcal.h" #include "STWeather.h" namespace asap { class Fitter; struct STLineFinder; class STBaselineTable; /** * This class contains and wraps a casacore::Table, which is used to store * all the information. This can be either a MemoryTable or a * disk based Table. * It provides access functions to the underlying table * It contains n subtables: * @li weather * @li frequencies * @li molecules * @li tcal * @li focus * @li fits * * @brief The main ASAP data container * @author Malte Marquarding * @date * @version */ class Scantable { friend class STMath; public: /** * Default constructor */ explicit Scantable(casacore::Table::TableType ttype = casacore::Table::Memory); /** * Create a Scantable object from an existing table on disk * @param[in] name the name of the existing Scantable */ explicit Scantable(const std::string& name, casacore::Table::TableType ttype = casacore::Table::Memory); /// @fixme this is only sensible for MemoryTables.... Scantable(const Scantable& other, bool clear=true); /** * Destructor */ virtual ~Scantable(); /** * get a const reference to the underlying casacore::Table * @return const \ref casacore::Table reference */ const casacore::Table& table() const; /** * get a reference to the underlying casacore::Table with the Selection * object applied if set * @return casacore::Table reference */ casacore::Table& table(); /** * Get a handle to the selection object * @return constant STSelector reference */ const STSelector& getSelection() const { return selector_; } /** * Set the data to be a subset as defined by the STSelector * @param selection a STSelector object */ void setSelection(const STSelector& selection); /** * unset the selection of the data */ void unsetSelection(); /** * set the header * @param[in] sth an STHeader object */ void setHeader( const STHeader& sth ); /** * get the header information * @return an STHeader object */ STHeader getHeader( ) const; /** * Checks if the "other" Scantable is conformant with this, * i.e. if header values are the same. * @param[in] other another Scantable * @return true or false */ bool conformant( const Scantable& other); /** * * @param stype The type of the source, 0 = on, 1 = off */ void setSourceType(int stype); /** * * @param stype The name of the source */ void setSourceName(const std::string& name); /** * The number of scans in the table * @return number of scans in the table */ int nscan() const; casacore::MEpoch::Types getTimeReference() const; casacore::MEpoch getEpoch(int whichrow) const; /** * Get global antenna position * @return casacore::MPosition */ casacore::MPosition getAntennaPosition() const; /** * the @ref casacore::MDirection for a specific row * @param[in] whichrow the row number * return casacore::MDirection */ casacore::MDirection getDirection( int whichrow ) const; /** * get the direction type as a string, e.g. "J2000" * @param[in] whichrow the row number * return the direction string */ std::string getDirectionString( int whichrow ) const; /** * set the direction type as a string, e.g. "J2000" * @param[in] refstr the direction type */ void setDirectionRefString(const std::string& refstr=""); /** * get the direction reference string * @return a string describing the direction reference */ std::string getDirectionRefString() const; /** * Return the Flux unit of the data, e.g. "Jy" or "K" * @return string */ std::string getFluxUnit() const; /** * Set the Flux unit of the data * @param unit a string representing the unit, e.g "Jy" or "K" */ void setFluxUnit( const std::string& unit ); /** * Set the Stokes type of the data * @param feedtype a string representing the type, e.g "circular" or "linear" */ void setFeedType( const std::string& feedtype ); /** * * @param instrument a string representing an insturment. see xxx */ void setInstrument( const std::string& instrument ); /** * (Re)calculate the azimuth and elevationnfor all rows */ void calculateAZEL(); /** * "hard" flag the data, this flags everything selected in setSelection() * param[in] msk a boolean mask of length nchan describing the points to * to be flagged */ //void flag( const std::vector& msk = std::vector()); //void flag( const std::vector& msk = std::vector(), bool unflag=false); void flag( int whichrow = -1, const std::vector& msk = std::vector(), bool unflag=false); /** * Flag the data in a row-based manner. (CAS-1433 Wataru Kawasaki) * param[in] rows list of row numbers to be flagged */ void flagRow( const std::vector& rows = std::vector(), bool unflag=false); /** * Get flagRow info at the specified row. If true, the whole data * at the row should be flagged. */ bool getFlagRow(int whichrow) const { return (flagrowCol_(whichrow) > 0); } /** * Flag the data outside a specified range (in a channel-based manner). * (CAS-1807 Wataru Kawasaki) */ void clip(const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag); /** * Return a list of booleans with the size of nchan for a specified row, to get info * about which channel is clipped. */ std::vector getClipMask(int whichrow, const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag); void srchChannelsToClip(casacore::uInt whichrow, const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag, casacore::Vector flgs); /** * Return a list of row numbers with respect to the original table. * @return a list of unsigned ints */ std::vector rownumbers() const; /** * Get the number of beams in the data or a specific scan * @param scanno the scan number to get the number of beams for. * If scanno<0 the number is retrieved from the header. * @return an integer number */ int nbeam(int scanno=-1) const; /** * Get the number of IFs in the data or a specific scan * @param scanno the scan number to get the number of IFs for. * If scanno<0 the number is retrieved from the header. * @return an integer number */ int nif(int scanno=-1) const; /** * Get the number of polarizations in the data or a specific scan * @param scanno the scan number to get the number of polarizations for. * If scanno<0 the number is retrieved from the header. * @return an integer number */ int npol(int scanno=-1) const; std::string getPolType() const; /** * Get the number of integartion cycles * @param scanno the scan number to get the number of rows for. * If scanno<0 the number is retrieved from the header. * @return the number of rows (for the specified scanno) */ int nrow(int scanno=-1) const; int getBeam(int whichrow) const; std::vector getBeamNos() const { return getNumbers(beamCol_); } int getIF(int whichrow) const; std::vector getIFNos() const { return getNumbers(ifCol_); } int getPol(int whichrow) const; std::vector getPolNos() const { return getNumbers(polCol_); } std::vector getScanNos() const { return getNumbers(scanCol_); } int getScan(int whichrow) const { return scanCol_(whichrow); } std::vector getCycleNos() const { return getNumbers(cycleCol_); } int getCycle(int whichrow) const { return cycleCol_(whichrow); } //TT addition std::vector getMolNos() {return getNumbers(mmolidCol_); } /** * Get the number of channels in the data or a specific IF. This currently * varies only with IF number * @param ifno the IF number to get the number of channels for. * If ifno<0 the number is retrieved from the header. * @return an integer number */ int nchan(int ifno=-1) const; int getChannels(int whichrow) const; int ncycle(int scanno=-1) const; double getInterval(int whichrow) const { return integrCol_(whichrow); } float getTsys(int whichrow) const { return casacore::Vector(tsysCol_(whichrow))(0); } std::vector getTsysSpectrum(int whichrow) const ; void setTsys(const std::vector& newvals, int whichrow); float getElevation(int whichrow) const { return elCol_(whichrow); } float getAzimuth(int whichrow) const { return azCol_(whichrow); } float getParAngle(int whichrow) const { return focus().getParAngle(mfocusidCol_(whichrow)); } int getTcalId(int whichrow) const { return mtcalidCol_(whichrow); } std::string getSourceName(int whichrow) const { return srcnCol_(whichrow); } std::vector getMask(int whichrow) const; std::vector getSpectrum(int whichrow, const std::string& poltype = "" ) const; void setSpectrum(const std::vector& spec, int whichrow); std::string getPolarizationLabel(int index, const std::string& ptype) const { return STPol::getPolLabel(index, ptype ); } /** * Write the Scantable to disk * @param filename the output file name */ void makePersistent(const std::string& filename); std::vector getHistory(int nrow=-1, int start=0) const { return historyTable_.getHistory(nrow, start); } uint historyLength() { return historyTable_.nrow(); } void dropHistory() { historyTable_.drop(); } void addHistory(const std::string& hist) { historyTable_.addEntry(hist); } void appendToHistoryTable(const STHistory& otherhist) { historyTable_.append(otherhist); } std::string headerSummary(); void summary(const std::string& filename=""); std::string oldheaderSummary(); // std::string summary(); void oldsummary(const std::string& filename=""); //std::string getTime(int whichrow=-1, bool showdate=true) const; std::string getTime(int whichrow=-1, bool showdate=true, casacore::uInt prec=0) const; double getIntTime(int whichrow) const { return integrCol_(whichrow); } // returns unit, conversion frame, doppler, base-frame /** * Get the frequency set up * This is forwarded to the STFrequencies subtable * @return unit, frame, doppler */ std::vector getCoordInfo() const { return freqTable_.getInfo(); }; void setCoordInfo(std::vector theinfo) { return freqTable_.setInfo(theinfo); }; std::vector getAbcissa(int whichrow) const; std::vector getWeather(int whichrow) const; std::string getAbcissaLabel(int whichrow) const; std::vector getRestFrequencies() const { return moleculeTable_.getRestFrequencies(); } std::vector getRestFrequency(int id) const { return moleculeTable_.getRestFrequency(id); } /** void setRestFrequencies(double rf, const std::string& name = "", const std::string& = "Hz"); **/ // Modified by Takeshi Nakazato 05/09/2008 /*** void setRestFrequencies(vector rf, const vector& name = "", const std::string& = "Hz"); ***/ void setRestFrequencies(vector rf, const vector& name = vector(1,""), const std::string& = "Hz"); //void setRestFrequencies(const std::string& name); void setRestFrequencies(const vector& name); void shift(int npix); casacore::SpectralCoordinate getSpectralCoordinate(int whichrow) const; void convertDirection(const std::string& newframe); STFrequencies& frequencies() { return freqTable_; } const STFrequencies& frequencies() const { return freqTable_; } STWeather& weather() { return weatherTable_; } const STWeather& weather() const { return weatherTable_; } STFocus& focus() { return focusTable_; } const STFocus& focus() const { return focusTable_; } STTcal& tcal() { return tcalTable_; } const STTcal& tcal() const { return tcalTable_; } STMolecules& molecules() { return moleculeTable_; } const STMolecules& molecules() const { return moleculeTable_; } STHistory& history() { return historyTable_; } const STHistory& history() const { return historyTable_; } STFit& fit() { return fitTable_; } const STFit& fit() const { return fitTable_; } std::vector columnNames() const; void addFit(const STFitEntry& fit, int row); STFitEntry getFit(int row) const { STFitEntry fe; fitTable_.getEntry(fe, mfitidCol_(row)); return fe; } //Added by TT /** * Get the antenna name * @return antenna name string */ casacore::String getAntennaName() const; /** * For GBT MS data only. check a scan list * against the information found in GBT_GO table for * scan number orders to get correct pairs. * @param[in] scan list * @return status */ int checkScanInfo(const std::vector& scanlist) const; /** * Get the direction as a vector, for a specific row * @param[in] whichrow the row numbyyer * @return the direction in a vector */ std::vector getDirectionVector(int whichrow) const; /** * Set a flag indicating whether the data was parallactified * @param[in] flag true or false */ void parallactify(bool flag) { focusTable_.setParallactify(flag); } /** * Reshape spectrum * @param[in] nmin, nmax minimum and maximum channel * @param[in] irow row number * * 30/07/2008 Takeshi Nakazato **/ void reshapeSpectrum( int nmin, int nmax ) throw( casacore::AipsError ); void reshapeSpectrum( int nmin, int nmax, int irow ) ; /** * Change channel number under fixed bandwidth * @param[in] nchan, dnu new channel number and spectral resolution * @param[in] irow row number * * 27/08/2008 Takeshi Nakazato **/ void regridChannel( int nchan, double dnu ) ; void regridChannel( int nchan, double dnu, int irow ) ; void regridChannel( int nchan, double dnu, double fmin, int irow ) ; void regridSpecChannel( double dnu, int nchan=-1 ) ; bool isAllChannelsFlagged(casacore::uInt whichrow); std::vector applyBaselineTable(const std::string& bltable, const bool returnfitresult, const std::string& outbltable, const bool outbltableexists, const bool overwrite); std::vector subBaseline(const std::vector& blInfoList, const bool returnfitresult, const std::string& outbltable, const bool outbltableexists, const bool overwrite); void polyBaseline(const std::vector& mask, int order, float thresClip, int nIterClip, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void autoPolyBaseline(const std::vector& mask, int order, float thresClip, int nIterClip, const std::vector& edge, float threshold=3.0, int chanAvgLimit=1, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void chebyshevBaseline(const std::vector& mask, int order, float thresClip, int nIterClip, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void autoChebyshevBaseline(const std::vector& mask, int order, float thresClip, int nIterClip, const std::vector& edge, float threshold=3.0, int chanAvgLimit=1, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void cubicSplineBaseline(const std::vector& mask, int nPiece, float thresClip, int nIterClip, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void autoCubicSplineBaseline(const std::vector& mask, int nPiece, float thresClip, int nIterClip, const std::vector& edge, float threshold=3.0, int chanAvgLimit=1, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void sinusoidBaseline(const std::vector& mask, const std::string& fftInfo, const std::vector& addNWaves, const std::vector& rejectNWaves, float thresClip, int nIterClip, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); void autoSinusoidBaseline(const std::vector& mask, const std::string& fftInfo, const std::vector& addNWaves, const std::vector& rejectNWaves, float thresClip, int nIterClip, const std::vector& edge, float threshold=3.0, int chanAvgLimit=1, bool getResidual=true, const std::string& progressInfo="true,1000", const bool outLogger=false, const std::string& blfile="", const std::string& bltable=""); std::vector execFFT(const int whichrow, const std::vector& inMask, bool getRealImag=false, bool getAmplitudeOnly=false); float getRms(const std::vector& mask, int whichrow); std::string formatBaselineParams(const std::vector& params, const std::vector& fixed, float rms, int nClipped, const std::string& masklist, int whichrow, bool verbose=false, bool csvformat=false, int start=-1, int count=-1, bool resetparamid=false) const; std::string formatPiecewiseBaselineParams(const std::vector& ranges, const std::vector& params, const std::vector& fixed, float rms, int nClipped, const std::string& masklist, int whichrow, bool verbose=false, bool csvformat=false) const; std::vector getMoleculeIdColumnData() const; void setMoleculeIdColumnData(const std::vector& molids); /** * Get row idx of root table **/ std::vector getRootTableRowNumbers() const; double calculateModelSelectionCriteria(const std::string& valname, const std::string& blfunc, int order, const std::vector& inMask, int whichrow, bool useLineFinder, const std::vector& edge, float threshold, int chanAvgLimit); static std::vector getMaskFromMaskList(const int nchan, const std::vector& masklist); static casacore::Vector getMaskListFromMask( const std::vector& mask); static std::vector splitToIntList(const std::string& str, const char delim); static std::vector splitToStringList(const std::string& str, const char delim); void dropXPol(); private: casacore::Matrix getPolMatrix( casacore::uInt whichrow ) const; /** * Turns a time value into a formatted string * @param x * @return */ std::string formatSec(casacore::Double x) const; std::string formatTime(const casacore::MEpoch& me, bool showdate)const; std::string formatTime(const casacore::MEpoch& me, bool showdate, casacore::uInt prec)const; /** * Turns a casacore::MDirection into a nicely formatted string * @param md an casacore::MDirection * @param prec output precision of direction * @return */ std::string formatDirection(const casacore::MDirection& md, casacore::Int prec=7) const; /** * Create a unique file name for the paged (temporary) table * @return just the name */ static casacore::String generateName(); /** * attach to cached columns */ void attach(); /** * Set up the main casacore::Table */ void setupMainTable(); void attachSubtables(); void copySubtables(const Scantable& other); /** * Convert an "old" asap1 style row index into a new index * @param[in] therow * @return and index into @table_ */ int rowToScanIndex(int therow); std::vector getNumbers(const casacore::ScalarColumn& col) const; /** * Returns a number of elements with "true" in a bool vector. * @param[in] mask (boolean vector) * @return the numerb of elements in true */ std::size_t nValidMask(const std::vector& mask); static const casacore::uInt version_ = 4; STSelector selector_; casacore::Table::TableType type_; // the actual data casacore::Table table_; casacore::Table originalTable_; STTcal tcalTable_; STFrequencies freqTable_; STWeather weatherTable_; STFocus focusTable_; STMolecules moleculeTable_; STHistory historyTable_; STFit fitTable_; // Cached Columns to avoid reconstructing them for each row get/put casacore::ScalarColumn integrCol_; casacore::MDirection::ScalarColumn dirCol_; casacore::MEpoch::ScalarColumn timeCol_; casacore::ScalarColumn azCol_; casacore::ScalarColumn elCol_; casacore::ScalarColumn srcnCol_, fldnCol_; casacore::ScalarColumn scanCol_, beamCol_, ifCol_, polCol_, cycleCol_, flagrowCol_; casacore::ScalarColumn rbeamCol_, srctCol_; casacore::ArrayColumn specCol_, tsysCol_; casacore::ArrayColumn flagsCol_; // id in frequencies table casacore::ScalarColumn mfreqidCol_; // id in tcal table casacore::ScalarColumn mtcalidCol_; casacore::ArrayColumn histitemCol_; casacore::ScalarColumn mfitidCol_; casacore::ScalarColumn mweatheridCol_; casacore::ScalarColumn mfocusidCol_; casacore::ScalarColumn mmolidCol_; static std::map factories_; void initFactories(); /** * Add an auxiliary column to the main table and attach it to a * cached column. Use for adding new columns that the original asap2 * tables do not have. * @param[in] col reference to the cached column to be attached * @param[in] colName column name in asap table * @param[in] defValue default value to fill in the column * * 25/10/2009 Wataru Kawasaki */ template void attachAuxColumnDef(casacore::ScalarColumn&, const casacore::String&, const T2&); template void attachAuxColumnDef(casacore::ArrayColumn&, const casacore::String&, const casacore::Array&); double getNormalPolynomial(int n, double x); double getChebyshevPolynomial(int n, double x); std::vector > getPolynomialModel(int order, int nchan, double (Scantable::*pfunc)(int, double)); std::vector > > getPolynomialModelReservoir(int order, double (Scantable::*pfunc)(int, double), std::vector& nChanNos); std::vector doPolynomialFitting(const std::vector& data, const std::vector& mask, int order, std::vector& params, float& rms, std::vector& finalMask, float clipth, int clipn); std::vector doPolynomialFitting(const std::vector& data, const std::vector& mask, int order, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector doChebyshevFitting(const std::vector& data, const std::vector& mask, int order, std::vector& params, float& rms, std::vector& finalMask, float clipth, int clipn); std::vector doChebyshevFitting(const std::vector& data, const std::vector& mask, int order, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector doLeastSquareFitting(const std::vector& data, const std::vector& mask, const std::vector >& model, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector doCubicSplineFitting(const std::vector& data, const std::vector& mask, std::vector& idxEdge, std::vector& params, float& rms, std::vector& finalMask, float clipth, int clipn); std::vector doCubicSplineFitting(const std::vector& data, const std::vector& mask, int nPiece, std::vector& idxEdge, std::vector& params, float& rms, std::vector& finalMask, float clipth, int clipn); std::vector doCubicSplineFitting(const std::vector& data, const std::vector& mask, int nPiece, bool useGivenPieceBoundary, std::vector& idxEdge, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector doCubicSplineLeastSquareFitting(const std::vector& data, const std::vector& mask, const std::vector >& model, int nPiece, bool useGivenPieceBoundary, std::vector& idxEdge, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector doSinusoidFitting(const std::vector& data, const std::vector& mask, const std::vector& waveNumbers, std::vector& params, float& rms, std::vector& finalMask, float clipth, int clipn); std::vector doSinusoidFitting(const std::vector& data, const std::vector& mask, const std::vector& waveNumbers, std::vector& params, float& rms, std::vector& finalMask, int& nClipped, float thresClip=3.0, int nIterClip=0, bool getResidual=true); std::vector > getSinusoidModel(const std::vector& waveNumbers, int nchan); std::vector > > getSinusoidModelReservoir(const std::vector& waveNumbers, std::vector& nChanNos); std::vector selectWaveNumbers(const std::vector& addNWaves, const std::vector& rejectNWaves); std::vector selectWaveNumbers(const int whichrow, const std::vector& chanMask, //const std::string& fftInfo, const bool applyFFT, const std::string& fftMethod, const std::string& fftThresh, const std::vector& addNWaves, const std::vector& rejectNWaves); int getIdxOfNchan(const int nChan, const std::vector& nChanNos); void parseFFTInfo(const std::string& fftInfo, bool& applyFFT, std::string& fftMethod, std::string& fftThresh); void parseFFTThresholdInfo(const std::string& fftThresh, std::string& fftThAttr, float& fftThSigma, int& fftThTop); void doSelectWaveNumbers(const int whichrow, const std::vector& chanMask, const std::string& fftMethod, const float fftThSigma, const int fftThTop, const std::string& fftThAttr, std::vector& nWaves); void addAuxWaveNumbers(const int whichrow, const std::vector& addNWaves, const std::vector& rejectNWaves, std::vector& nWaves); void setWaveNumberListUptoNyquistFreq(const int whichrow, std::vector& nWaves); void initialiseBaselining(const std::string& blfile, std::ofstream& ofs, const bool outLogger, bool& outTextFile, bool& csvFormat, casacore::String& coordInfo, bool& hasSameNchan, const std::string& progressInfo, bool& showProgress, int& minNRow, casacore::Vector& timeSecCol); void finaliseBaselining(const bool outBaselineTable, STBaselineTable* pbt, const string& bltable, const bool outTextFile, std::ofstream& ofs); void initLineFinder(const std::vector& edge, const float threshold, const int chanAvgLimit, STLineFinder& lineFinder); bool hasSameNchanOverIFs(); std::string getMaskRangeList(const std::vector& mask, int whichrow, const casacore::String& coordInfo, bool hasSameNchan, bool verbose=false); std::vector getMaskEdgeIndices(const std::vector& mask); std::string formatBaselineParamsHeader(int whichrow, const std::string& masklist, bool verbose, bool csvformat) const; std::string formatBaselineParamsFooter(float rms, int nClipped, bool verbose, bool csvformat) const; std::vector getCompositeChanMask(int whichrow, const std::vector& inMask); std::vector getCompositeChanMask(int whichrow, const std::vector& inMask, const std::vector& edge, std::vector& currEdge, STLineFinder& lineFinder); void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector& chanMask, int whichrow, const casacore::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casacore::String& funcName, const std::vector& edge, const std::vector& params, const int nClipped); void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector& chanMask, int whichrow, const casacore::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casacore::String& funcName, const std::vector& params, const int nClipped); void parseProgressInfo(const std::string& progressInfo, bool& showProgress, int& minNRow); void showProgressOnTerminal(const int nProcessed, const int nTotal, const bool showProgress=true, const int nTotalThreshold=1000); void applyChanFlag( casacore::uInt whichrow, const std::vector& msk, casacore::uChar flagval); double doCalculateModelSelectionCriteria(const std::string& valname, const std::vector& spec, const std::vector& mask, const std::string& blfunc, int order); double doGetRms(const std::vector& mask, const casacore::Vector& spec); std::string packFittingResults(const int irow, const std::vector& params, const float rms); void parseBlInfo(const std::string& blInfo, int& whichrow, STBaselineFunc::FuncName& ftype, std::vector& fpar, std::vector& mask, float& thresClip, int& nIterClip, bool& useLineFinder, float& thresLF, std::vector& edgeLF, int& avgLF); std::vector doApplyBaselineTable(std::vector& spec, std::vector& mask, const STBaselineFunc::FuncName ftype, std::vector& fpar, std::vector& params, float&rms, int irow); std::vector doSubtractBaseline(std::vector& spec, std::vector& mask, const STBaselineFunc::FuncName ftype, std::vector& fpar, std::vector& params, float&rms, std::vector& finalmask, float clipth, int clipn, bool uself, int irow, float lfth, std::vector& lfedge, int lfavg); // storage of cubic spline model for various number of channels map > > cubicSplineModelPool_; }; } // namespace #endif