Changeset 2767 for trunk/src/Scantable.h


Ignore:
Timestamp:
02/08/13 22:23:22 (11 years ago)
Author:
WataruKawasaki
Message:

New Development: Yes

JIRA Issue: Yes CAS-4794

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd

Description: functions to apply/write STBaselineTable in which baseline parameters stored.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.h

    r2737 r2767  
    2828#include <casa/Quanta/Quantum.h>
    2929#include <casa/Utilities/CountedPtr.h>
    30 
    3130#include <coordinates/Coordinates/SpectralCoordinate.h>
    32 
    3331#include <measures/TableMeasures/ScalarMeasColumn.h>
    34 
    3532#include <scimath/Mathematics/FFTServer.h>
    36 
    3733#include <tables/Tables/ArrayColumn.h>
    3834#include <tables/Tables/ScalarColumn.h>
    3935#include <tables/Tables/Table.h>
    4036
    41 
    4237#include "MathUtils.h"
     38#include "STBaselineEnum.h"
    4339#include "STFit.h"
    4440#include "STFitEntry.h"
     
    507503  void regridChannel( int nchan, double dnu, int irow ) ;
    508504  void regridChannel( int nchan, double dnu, double fmin, int irow ) ;
    509 
    510505  void regridSpecChannel( double dnu, int nchan=-1 ) ;
    511506
    512507  bool getFlagtraFast(casa::uInt whichrow);
    513508
    514   void polyBaseline(const std::vector<bool>& mask,
    515                     int order,
     509  std::vector<std::string> applyBaselineTable(const std::string& bltable, const std::string& outbltable, const bool outbltableexists, const bool overwrite);
     510  std::vector<std::string> subBaseline(const std::vector<std::string>& blInfoList, const std::string& outbltable, const bool outbltableexists, const bool overwrite);
     511  void polyBaseline(const std::vector<bool>& mask,
     512                    int order,
     513                    float thresClip,
     514                    int nIterClip,
    516515                    bool getResidual=true,
    517516                    const std::string& progressInfo="true,1000",
    518                     const bool outLogger=false,
    519                     const std::string& blfile="");
     517                    const bool outLogger=false,
     518                    const std::string& blfile="",
     519                    const std::string& bltable="");
    520520  void autoPolyBaseline(const std::vector<bool>& mask,
    521                         int order,
    522                         const std::vector<int>& edge,
    523                         float threshold=3.0,
    524                         int chanAvgLimit=1,
    525                         bool getResidual=true,
    526                         const std::string& progressInfo="true,1000",
    527                         const bool outLogger=false,
    528                         const std::string& blfile="");
     521                        int order,
     522                        float thresClip,
     523                        int nIterClip,
     524                        const std::vector<int>& edge,
     525                        float threshold=3.0,
     526                        int chanAvgLimit=1,
     527                        bool getResidual=true,
     528                        const std::string& progressInfo="true,1000",
     529                        const bool outLogger=false,
     530                        const std::string& blfile="",
     531                        const std::string& bltable="");
    529532  void chebyshevBaseline(const std::vector<bool>& mask,
    530533                         int order,
     
    534537                         const std::string& progressInfo="true,1000",
    535538                         const bool outLogger=false,
    536                          const std::string& blfile="");
     539                         const std::string& blfile="",
     540                         const std::string& bltable="");
    537541  void autoChebyshevBaseline(const std::vector<bool>& mask,
    538542                             int order,
     
    545549                             const std::string& progressInfo="true,1000",
    546550                             const bool outLogger=false,
    547                              const std::string& blfile="");
     551                             const std::string& blfile="",
     552                             const std::string& bltable="");
    548553  void cubicSplineBaseline(const std::vector<bool>& mask,
    549554                           int nPiece,
     
    553558                           const std::string& progressInfo="true,1000",
    554559                           const bool outLogger=false,
    555                            const std::string& blfile="");
     560                           const std::string& blfile="",
     561                           const std::string& bltable="");
    556562  void autoCubicSplineBaseline(const std::vector<bool>& mask,
    557563                               int nPiece,
     
    564570                               const std::string& progressInfo="true,1000",
    565571                               const bool outLogger=false,
    566                                const std::string& blfile="");
     572                               const std::string& blfile="",
     573                               const std::string& bltable="");
    567574  void sinusoidBaseline(const std::vector<bool>& mask,
    568                         const bool applyFFT,
    569                         const std::string& fftMethod,
    570                         const std::string& fftThresh,
     575                        const std::string& fftInfo,
    571576                        const std::vector<int>& addNWaves,
    572577                        const std::vector<int>& rejectNWaves,
     
    576581                        const std::string& progressInfo="true,1000",
    577582                        const bool outLogger=false,
    578                         const std::string& blfile="");
     583                        const std::string& blfile="",
     584                        const std::string& bltable="");
    579585  void autoSinusoidBaseline(const std::vector<bool>& mask,
    580                             const bool applyFFT,
    581                             const std::string& fftMethod,
    582                             const std::string& fftThresh,
     586                            const std::string& fftInfo,
    583587                            const std::vector<int>& addNWaves,
    584588                            const std::vector<int>& rejectNWaves,
     
    591595                            const std::string& progressInfo="true,1000",
    592596                            const bool outLogger=false,
    593                             const std::string& blfile="");
     597                            const std::string& blfile="",
     598                            const std::string& bltable="");
    594599  std::vector<float> execFFT(const int whichrow,
    595600                             const std::vector<bool>& inMask,
     
    628633                                         float threshold,
    629634                                         int chanAvgLimit);
     635  static std::vector<bool> getMaskFromMaskList(const int nchan,
     636                                               const std::vector<int>& masklist);
     637  static std::vector<int> splitToIntList(const std::string& str, const char delim);
     638  static std::vector<string> splitToStringList(const std::string& str, const char delim);
     639
    630640
    631641
     
    743753
    744754  void fitBaseline(const std::vector<bool>& mask, int whichrow, Fitter& fitter);
     755  double getNormalPolynomial(int n, double x);
    745756  double getChebyshevPolynomial(int n, double x);
     757  std::vector<float> doPolynomialFitting(const std::vector<float>& data,
     758                                         const std::vector<bool>& mask,
     759                                         int order,
     760                                         std::vector<float>& params,
     761                                         float& rms,
     762                                         std::vector<bool>& finalMask,
     763                                         float clipth,
     764                                         int clipn);
     765  std::vector<float> doPolynomialFitting(const std::vector<float>& data,
     766                                         const std::vector<bool>& mask,
     767                                         int order,
     768                                         std::vector<float>& params,
     769                                         float& rms,
     770                                         std::vector<bool>& finalMask,
     771                                         int& nClipped,
     772                                         float thresClip=3.0,
     773                                         int nIterClip=0,
     774                                         bool getResidual=true);
    746775  std::vector<float> doChebyshevFitting(const std::vector<float>& data,
     776                                        const std::vector<bool>& mask,
     777                                        int order,
     778                                        std::vector<float>& params,
     779                                        float& rms,
     780                                        std::vector<bool>& finalMask,
     781                                        float clipth,
     782                                        int clipn);
     783  std::vector<float> doChebyshevFitting(const std::vector<float>& data,
     784                                        const std::vector<bool>& mask,
     785                                        int order,
     786                                        std::vector<float>& params,
     787                                        float& rms,
     788                                        std::vector<bool>& finalMask,
     789                                        int& nClipped,
     790                                        float thresClip=3.0,
     791                                        int nIterClip=0,
     792                                        bool getResidual=true);
     793  std::vector<float> doLeastSquareFitting(const std::vector<float>& data,
     794                                          const std::vector<bool>& mask,
     795                                          double (Scantable::*pfunc)(int, double),
     796                                          int order,
     797                                          std::vector<float>& params,
     798                                          float& rms,
     799                                          std::vector<bool>& finalMask,
     800                                          int& nClipped,
     801                                          float thresClip=3.0,
     802                                          int nIterClip=0,
     803                                          bool getResidual=true);
     804  std::vector<float> doCubicSplineFitting(const std::vector<float>& data,
    747805                                          const std::vector<bool>& mask,
    748                                           int order,
     806                                          std::vector<int>& idxEdge,
    749807                                          std::vector<float>& params,
     808                                          float& rms,
    750809                                          std::vector<bool>& finalMask,
    751                                           float& rms,
    752                                           int& nClipped,
    753                                           float thresClip=3.0,
    754                                           int nIterClip=1,
    755                                           bool getResidual=true);
     810                                          float clipth,
     811                                          int clipn);
    756812  std::vector<float> doCubicSplineFitting(const std::vector<float>& data,
    757813                                          const std::vector<bool>& mask,
     
    759815                                          std::vector<int>& idxEdge,
    760816                                          std::vector<float>& params,
     817                                          float& rms,
     818                                          std::vector<bool>& finalMask,
     819                                          float clipth,
     820                                          int clipn);
     821  std::vector<float> doCubicSplineFitting(const std::vector<float>& data,
     822                                          const std::vector<bool>& mask,
     823                                          int nPiece,
     824                                          bool useGivenPieceBoundary,
     825                                          std::vector<int>& idxEdge,
     826                                          std::vector<float>& params,
     827                                          float& rms,
     828                                          std::vector<bool>& finalMask,
    761829                                          int& nClipped,
    762830                                          float thresClip=3.0,
    763                                           int nIterClip=1,
     831                                          int nIterClip=0,
    764832                                          bool getResidual=true);
    765833  std::vector<float> doSinusoidFitting(const std::vector<float>& data,
     
    767835                                       const std::vector<int>& waveNumbers,
    768836                                       std::vector<float>& params,
     837                                       float& rms,
     838                                       std::vector<bool>& finalMask,
     839                                       float clipth,
     840                                       int clipn);
     841  std::vector<float> doSinusoidFitting(const std::vector<float>& data,
     842                                       const std::vector<bool>& mask,
     843                                       const std::vector<int>& waveNumbers,
     844                                       std::vector<float>& params,
     845                                       float& rms,
     846                                       std::vector<bool>& finalMask,
    769847                                       int& nClipped,
    770848                                       float thresClip=3.0,
    771                                        int nIterClip=1,
     849                                       int nIterClip=0,
    772850                                       bool getResidual=true);
    773851  void selectWaveNumbers(const int whichrow,
    774852                         const std::vector<bool>& chanMask,
    775                          const bool applyFFT,
    776                          const std::string& fftMethod,
    777                          const std::string& fftThresh,
     853                         const std::string& fftInfo,
     854                         //const bool applyFFT,
     855                         //const std::string& fftMethod,
     856                         //const std::string& fftThresh,
    778857                         const std::vector<int>& addNWaves,
    779858                         const std::vector<int>& rejectNWaves,
    780859                         std::vector<int>& nWaves);
     860  void parseFFTInfo(const std::string& fftInfo,
     861                    bool& applyFFT,
     862                    std::string& fftMethod,
     863                    std::string& fftThresh);
    781864  void parseThresholdExpression(const std::string& fftThresh,
    782865                                std::string& fftThAttr,
     
    821904                                           int order);
    822905  double doGetRms(const std::vector<bool>& mask, const casa::Vector<casa::Float>& spec);
     906  std::string packFittingResults(const int irow, const std::vector<float>& params, const float rms);
     907  void parseBlInfo(const std::string& blInfo, int& whichrow, STBaselineFunc::FuncName& ftype, std::vector<int>& fpar, std::vector<bool>& mask, float& thresClip, int& nIterClip, bool& useLineFinder, float& thresLF, std::vector<int>& edgeLF, int& avgLF);
     908 std::vector<float> doApplyBaselineTable(std::vector<float>& spec, std::vector<bool>& mask, const STBaselineFunc::FuncName ftype, std::vector<int>& fpar, std::vector<float>& params, float&rms);
     909 std::vector<float> doSubtractBaseline(std::vector<float>& spec, std::vector<bool>& mask, const STBaselineFunc::FuncName ftype, std::vector<int>& fpar, std::vector<float>& params, float&rms, std::vector<bool>& finalmask, float clipth, int clipn, bool uself, int irow, float lfth, std::vector<int>& lfedge, int lfavg);
    823910
    824911};
    825 
    826912} // namespace
    827913
Note: See TracChangeset for help on using the changeset viewer.