Ignore:
Timestamp:
03/03/15 18:26:31 (9 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-6929)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): asap as a whole

Description: committing Darrell's changes to make asap work with merged casacore.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STLineFinder.cpp

    r2961 r3029  
    8989                 const casa::Vector<casa::Bool>   &in_mask,
    9090                 const std::pair<int,int>         &in_edge,
    91                  int in_max_box_nchan) throw(AipsError);
     91                 int in_max_box_nchan);
    9292
    9393   // access to the statistics
    94    const casa::Float& getLinMean() const throw(AipsError);
    95    const casa::Float& getLinVariance() const throw(AipsError);
    96    casa::Float aboveMean() const throw(AipsError);
    97    int getChannel() const throw();
     94   const casa::Float& getLinMean() const;
     95   const casa::Float& getLinVariance() const;
     96   casa::Float aboveMean() const;
     97   int getChannel() const;
    9898
    9999   // actual number of channels in the box (max_box_nchan, if no channels
    100100   // are masked)
    101    int getNumberOfBoxPoints() const throw();
     101   int getNumberOfBoxPoints() const;
    102102
    103103   // next channel
    104    void next() throw(AipsError);
     104   void next();
    105105
    106106   // checking whether there are still elements
    107    casa::Bool haveMore() const throw();
     107   casa::Bool haveMore() const;
    108108
    109109   // go to start
    110    void rewind() throw(AipsError);
     110   void rewind();
    111111
    112112protected:
     
    116116   // Channels, for which the mask is false or index is beyond the
    117117   // allowed range, are ignored
    118    void advanceRunningBox(int ch) throw(casa::AipsError);
     118   void advanceRunningBox(int ch);
    119119
    120120   // calculate derivative statistics. This function is const, because
    121121   // it updates the cache only
    122    void updateDerivativeStatistics() const throw(AipsError);
     122   void updateDerivativeStatistics() const;
    123123};
    124124
     
    166166                    casa::Float in_threshold = 5,
    167167                    bool use_median = false,
    168                     int noise_sample_size = -1) throw();
    169    virtual ~LFAboveThreshold() throw();
     168                    int noise_sample_size = -1);
     169   virtual ~LFAboveThreshold();
    170170
    171171   // replace the detection criterion
    172    void setCriterion(int in_min_nchan, casa::Float in_threshold) throw();
     172   void setCriterion(int in_min_nchan, casa::Float in_threshold);
    173173
    174174   // return the array with signs of the value-current mean
     
    176176   // This array is updated each time the findLines method is called and
    177177   // is used to search the line wings
    178    const casa::Vector<Int>& getSigns() const throw();
     178   const casa::Vector<Int>& getSigns() const;
    179179
    180180   // find spectral lines and add them into list
     
    186186                  const casa::Vector<casa::Bool> &mask,
    187187                  const std::pair<int,int> &edge,
    188                   int max_box_nchan) throw(casa::AipsError);
     188                  int max_box_nchan);
    189189
    190190protected:
     
    193193   // add a new line to the list, if necessary using processCurLine()
    194194   // detect=true indicates that the current channel satisfies the criterion
    195    void processChannel(Bool detect, const casa::Vector<casa::Bool> &mask)
    196                                                   throw(casa::AipsError);
     195   void processChannel(Bool detect, const casa::Vector<casa::Bool> &mask);
    197196
    198197   // process the interval of channels stored in curline
    199198   // if it satisfies the criterion, add this interval as a new line
    200    void processCurLine(const casa::Vector<casa::Bool> &mask)
    201                                                  throw(casa::AipsError);
     199   void processCurLine(const casa::Vector<casa::Bool> &mask);
    202200
    203201   // get the sign of runningBox->aboveMean(). The RunningBox pointer
    204202   // should be defined
    205    casa::Int getAboveMeanSign() const throw();
     203   casa::Int getAboveMeanSign() const;
    206204};
    207205
     
    463461                       const casa::Vector<casa::Bool>   &in_mask,
    464462                       const std::pair<int,int>         &in_edge,
    465                        int in_max_box_nchan) throw(AipsError) :
     463                       int in_max_box_nchan) :
    466464        spectrum(in_spectrum), mask(in_mask), edge(in_edge),
    467465        max_box_nchan(in_max_box_nchan)
     
    470468}
    471469
    472 void RunningBox::rewind() throw(AipsError) {
     470void RunningBox::rewind() {
    473471  // fill statistics for initial box
    474472  box_chan_cntr=0; // no channels are currently in the box
     
    491489
    492490// access to the statistics
    493 const casa::Float& RunningBox::getLinMean() const throw(AipsError)
     491const casa::Float& RunningBox::getLinMean() const
    494492{
    495493  DebugAssert(cur_channel<edge.second, AipsError);
     
    498496}
    499497
    500 const casa::Float& RunningBox::getLinVariance() const throw(AipsError)
     498const casa::Float& RunningBox::getLinVariance() const
    501499{
    502500  DebugAssert(cur_channel<edge.second, AipsError);
     
    505503}
    506504
    507 casa::Float RunningBox::aboveMean() const throw(AipsError)
     505casa::Float RunningBox::aboveMean() const
    508506{
    509507  DebugAssert(cur_channel<edge.second, AipsError);
     
    512510}
    513511
    514 int RunningBox::getChannel() const throw()
     512int RunningBox::getChannel() const
    515513{
    516514  return cur_channel;
     
    519517// actual number of channels in the box (max_box_nchan, if no channels
    520518// are masked)
    521 int RunningBox::getNumberOfBoxPoints() const throw()
     519int RunningBox::getNumberOfBoxPoints() const
    522520{
    523521  return box_chan_cntr;
     
    529527// Channels, for which the mask is false or index is beyond the
    530528// allowed range, are ignored
    531 void RunningBox::advanceRunningBox(int ch) throw(AipsError)
     529void RunningBox::advanceRunningBox(int ch)
    532530{
    533531  if (ch>=edge.first && ch<edge.second)
     
    555553
    556554// next channel
    557 void RunningBox::next() throw(AipsError)
     555void RunningBox::next()
    558556{
    559557   AlwaysAssert(cur_channel<edge.second,AipsError);
     
    564562
    565563// checking whether there are still elements
    566 casa::Bool RunningBox::haveMore() const throw()
     564casa::Bool RunningBox::haveMore() const
    567565{
    568566   return cur_channel<edge.second;
     
    571569// calculate derivative statistics. This function is const, because
    572570// it updates the cache only
    573 void RunningBox::updateDerivativeStatistics() const throw(AipsError)
     571void RunningBox::updateDerivativeStatistics() const
    574572{
    575573  AlwaysAssert(box_chan_cntr, AipsError);
     
    616614                                   casa::Float in_threshold,
    617615                                   bool use_median,
    618                                    int noise_sample_size) throw() :
     616                                   int noise_sample_size) :
    619617             min_nchan(in_min_nchan), threshold(in_threshold),
    620618             lines(in_lines), running_box(NULL), itsUseMedian(use_median),
    621619             itsNoiseSampleSize(noise_sample_size) {}
    622620
    623 LFAboveThreshold::~LFAboveThreshold() throw()
     621LFAboveThreshold::~LFAboveThreshold()
    624622{
    625623  if (running_box!=NULL) delete running_box;
     
    628626// replace the detection criterion
    629627void LFAboveThreshold::setCriterion(int in_min_nchan, casa::Float in_threshold)
    630                                  throw()
    631628{
    632629  min_nchan=in_min_nchan;
     
    636633// get the sign of runningBox->aboveMean(). The RunningBox pointer
    637634// should be defined
    638 casa::Int LFAboveThreshold::getAboveMeanSign() const throw()
     635casa::Int LFAboveThreshold::getAboveMeanSign() const
    639636{
    640637  const Float buf=running_box->aboveMean();
     
    648645// add a new line to the list, if necessary
    649646void LFAboveThreshold::processChannel(Bool detect,
    650                  const casa::Vector<casa::Bool> &mask) throw(casa::AipsError)
     647                 const casa::Vector<casa::Bool> &mask)
    651648{
    652649  try {
     
    680677// if it satisfies the criterion, add this interval as a new line
    681678void LFAboveThreshold::processCurLine(const casa::Vector<casa::Bool> &mask)
    682                                    throw(casa::AipsError)
    683679{
    684680  try {
     
    714710// This array is updated each time the findLines method is called and
    715711// is used to search the line wings
    716 const casa::Vector<Int>& LFAboveThreshold::getSigns() const throw()
     712const casa::Vector<Int>& LFAboveThreshold::getSigns() const
    717713{
    718714  return signs;
     
    724720                              const std::pair<int,int> &edge,
    725721                              int max_box_nchan)
    726                         throw(casa::AipsError)
    727722{
    728723  const int minboxnchan=4;
     
    811806// common channel, and false otherwise
    812807// line2 - range of the second line: start channel and stop+1
    813 bool LFLineListOperations::IntersectsWith::operator()(const std::pair<int,int> &line2)
    814                           const throw()
     808bool LFLineListOperations::IntersectsWith::operator()(const std::pair<int,int> &line2) const
    815809{
    816810  if (line2.second<line1.first) return false; // line2 is at lower channels
     
    835829// provided there is no gap between the lines
    836830void LFLineListOperations::BuildUnion::operator()(const std::pair<int,int> &new_line)
    837                                    throw()
    838831{
    839832  if (new_line.first<temp_line.first) temp_line.first=new_line.first;
     
    842835
    843836// return the result (temp_line)
    844 const std::pair<int,int>& LFLineListOperations::BuildUnion::result() const throw()
     837const std::pair<int,int>& LFLineListOperations::BuildUnion::result() const
    845838{
    846839  return temp_line;
     
    864857// in the ordered list (so, it is at greater channel numbers)
    865858bool LFLineListOperations::LaterThan::operator()(const std::pair<int,int> &line2)
    866                           const throw()
     859                          const
    867860{
    868861  if (line2.second<line1.first) return false; // line2 is at lower channels
     
    884877//
    885878
    886 STLineFinder::STLineFinder() throw() : edge(0,0), err("spurious")
     879STLineFinder::STLineFinder() : edge(0,0), err("spurious")
    887880{
    888881  useScantable = true;
     
    918911                              const casa::Float &in_box_size,
    919912                              const casa::Float &in_noise_box,
    920                               const casa::Bool &in_median) throw()
     913                              const casa::Bool &in_median)
    921914{
    922915  threshold=in_threshold;
     
    928921}
    929922
    930 STLineFinder::~STLineFinder() throw(AipsError) {}
     923STLineFinder::~STLineFinder() {}
    931924
    932925// set scan to work with (in_scan parameter)
    933 void STLineFinder::setScan(const ScantableWrapper &in_scan) throw(AipsError)
     926void STLineFinder::setScan(const ScantableWrapper &in_scan)
    934927{
    935928  scan=in_scan.getCP();
     
    957950int STLineFinder::findLines(const std::vector<bool> &in_mask,
    958951                            const std::vector<int> &in_edge,
    959                             const casa::uInt &whichRow) throw(casa::AipsError)
     952                            const casa::uInt &whichRow)
    960953{
    961954  if (useScantable && scan.null())
     
    11051098// reducing the spectral resolution if the baseline shape is bad
    11061099void STLineFinder::subtractBaseline(const casa::Vector<casa::Bool> &temp_mask,
    1107                       const casa::Int &order) throw(casa::AipsError)
     1100                      const casa::Int &order)
    11081101{
    11091102  AlwaysAssert(spectrum.nelements(),AipsError);
     
    11311124void STLineFinder::averageAdjacentChannels(casa::Vector<casa::Bool> &mask2update,
    11321125                                   const casa::Int &boxsize)
    1133                             throw(casa::AipsError)
    11341126{
    11351127  DebugAssert(mask2update.nelements()==spectrum.nelements(), AipsError);
     
    11631155//       in setScan) are still excluded regardless on the invert option
    11641156std::vector<bool> STLineFinder::getMask(bool invert)
    1165                                         const throw(casa::AipsError)
     1157                                        const
    11661158{
    11671159  try {
     
    12051197// get range for all lines found. The same units as used in the scan
    12061198// will be returned (e.g. velocity instead of channels).
    1207 std::vector<double> STLineFinder::getLineRanges()
    1208                              const throw(casa::AipsError)
     1199std::vector<double> STLineFinder::getLineRanges() const
    12091200{
    12101201  std::vector<double> vel;
     
    12301221// The same as getLineRanges, but channels are always used to specify
    12311222// the range
    1232 std::vector<int> STLineFinder::getLineRangesInChannels()
    1233                                    const throw(casa::AipsError)
     1223std::vector<int> STLineFinder::getLineRangesInChannels() const
    12341224{
    12351225  try {
     
    12801270                  std::list<std::pair<int, int> > &lines2update,
    12811271                  int max_box_nchan)
    1282                                    throw (casa::AipsError)
    12831272{
    12841273  try {
     
    13391328void LFLineListOperations::addNewSearchResult(const std::list<pair<int, int> > &newlines,
    13401329                         std::list<std::pair<int, int> > &lines_list)
    1341                         throw(AipsError)
    13421330{
    13431331  try {
     
    13861374           const casa::Vector<casa::Int> &signs,
    13871375           const casa::Vector<casa::Bool> &mask,
    1388            const std::pair<int,int> &edge) throw(casa::AipsError)
     1376           const std::pair<int,int> &edge)
    13891377{
    13901378  try {
Note: See TracChangeset for help on using the changeset viewer.