Changeset 890 for trunk/src


Ignore:
Timestamp:
03/08/06 13:32:27 (19 years ago)
Author:
mar637
Message:

asap2 naming changes

Location:
trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDFITSImageWriter.h

    r717 r890  
    4040namespace asap {
    4141
    42 class SDFITSImageWriter : public SDLog {
     42class SDFITSImageWriter : public Logger {
    4343public:
    4444  // Constructor
  • trunk/src/SDFitter.cc

    r612 r890  
    11//#---------------------------------------------------------------------------
    2 //# SDFitter.cc: A Fitter class for spectra
     2//# Fitter.cc: A Fitter class for spectra
    33//#--------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:
     29//# $Id:$
    3030//#---------------------------------------------------------------------------
    3131#include <casa/aips.h>
     
    4747using namespace casa;
    4848
    49 SDFitter::SDFitter()
    50 {
    51 }
    52 
    53 SDFitter::~SDFitter()
     49Fitter::Fitter()
     50{
     51}
     52
     53Fitter::~Fitter()
    5454{
    5555  reset();
    5656}
    5757
    58 void SDFitter::clear()
     58void Fitter::clear()
    5959{
    6060  for (uInt i=0;i< funcs_.nelements();++i) {
     
    6969}
    7070
    71 void SDFitter::reset()
     71void Fitter::reset()
    7272{
    7373  clear();
     
    7878
    7979
    80 bool SDFitter::computeEstimate() {
     80bool Fitter::computeEstimate() {
    8181  if (x_.nelements() == 0 || y_.nelements() == 0)
    8282    throw (AipsError("No x/y data specified."));
     
    122122}
    123123
    124 std::vector<float> SDFitter::getEstimate() const
     124std::vector<float> Fitter::getEstimate() const
    125125{
    126126  if (estimate_.nelements() == 0)
     
    132132
    133133
    134 bool SDFitter::setExpression(const std::string& expr, int ncomp)
     134bool Fitter::setExpression(const std::string& expr, int ncomp)
    135135{
    136136  clear();
     
    154154}
    155155
    156 bool SDFitter::setData(std::vector<float> absc, std::vector<float> spec,
     156bool Fitter::setData(std::vector<float> absc, std::vector<float> spec,
    157157                       std::vector<bool> mask)
    158158{
     
    171171}
    172172
    173 std::vector<float> SDFitter::getResidual() const
     173std::vector<float> Fitter::getResidual() const
    174174{
    175175    if (residual_.nelements() == 0)
     
    180180}
    181181
    182 std::vector<float> SDFitter::getFit() const
     182std::vector<float> Fitter::getFit() const
    183183{
    184184    Vector<Float> out = thefit_;
     
    189189}
    190190
    191 std::vector<float> SDFitter::getErrors() const
     191std::vector<float> Fitter::getErrors() const
    192192{
    193193    Vector<Float> out = error_;
     
    197197}
    198198
    199 bool SDFitter::setParameters(std::vector<float> params)
     199bool Fitter::setParameters(std::vector<float> params)
    200200{
    201201    Vector<Float> tmppar(params);
     
    226226}
    227227
    228 bool SDFitter::setFixedParameters(std::vector<bool> fixed)
     228bool Fitter::setFixedParameters(std::vector<bool> fixed)
    229229{
    230230    Vector<Bool> tmp(fixed);
     
    252252}
    253253
    254 std::vector<float> SDFitter::getParameters() const {
     254std::vector<float> Fitter::getParameters() const {
    255255    Vector<Float> out = parameters_;
    256256    std::vector<float> stlout;
     
    259259}
    260260
    261 std::vector<bool> SDFitter::getFixedParameters() const {
     261std::vector<bool> Fitter::getFixedParameters() const {
    262262  Vector<Bool> out(parameters_.nelements());
    263263  if (fixedpar_.nelements() == 0) {
     
    272272}
    273273
    274 float SDFitter::getChisquared() const {
     274float Fitter::getChisquared() const {
    275275    return chisquared_;
    276276}
    277277
    278 bool SDFitter::fit() {
     278bool Fitter::fit() {
    279279  NonLinearFitLM<Float> fitter;
    280280  CompoundFunction<Float> func;
     
    293293  Vector<Float> sigma(x_.nelements());
    294294  sigma = 1.0;
    295  
     295
    296296  parameters_.resize();
    297297  parameters_ = fitter.fit(x_, y_, sigma, &m_);
     
    304304
    305305  chisquared_ = fitter.getChi2();
    306  
     306
    307307  residual_.resize();
    308308  residual_ =  y_;
     
    316316
    317317
    318 std::vector<float> SDFitter::evaluate(int whichComp) const
    319 { 
     318std::vector<float> Fitter::evaluate(int whichComp) const
     319{
    320320  std::vector<float> stlout;
    321   uInt idx = uInt(whichComp); 
     321  uInt idx = uInt(whichComp);
    322322  Float y;
    323323  if ( idx < funcs_.nelements() ) {
  • trunk/src/SDFitter.h

    r517 r890  
    11//#---------------------------------------------------------------------------
    2 //# SDFitter.h: A Fitter class for spectra
     2//# Fitter.h: A Fitter class for spectra
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    4242namespace asap {
    4343
    44 class SDFitter {
     44class Fitter {
    4545public:
    46   SDFitter();
    47   virtual ~SDFitter();
     46  Fitter();
     47  virtual ~Fitter();
    4848  // allowed "gauss" and "poly". ncomp is either numvber of gaussions
    4949  // or order of the polynomial
  • trunk/src/SDLineFinder.cc

    r881 r890  
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:$
     29//# $Id$
    3030//#---------------------------------------------------------------------------
    3131
     
    766766
    767767// auxiliary function to fit and subtract a polynomial from the current
    768 // spectrum. It uses the SDFitter class. This action is required before
     768// spectrum. It uses the Fitter class. This action is required before
    769769// reducing the spectral resolution if the baseline shape is bad
    770770void STLineFinder::subtractBaseline(const casa::Vector<casa::Bool> &temp_mask,
     
    773773  AlwaysAssert(spectrum.nelements(),AipsError);
    774774  // use the fact that temp_mask excludes channels rejected at the edge
    775   SDFitter sdf;
     775  Fitter sdf;
    776776  std::vector<float> absc(spectrum.nelements());
    777777  for (Int i=0;i<absc.size();++i)
  • trunk/src/SDLineFinder.h

    r881 r890  
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:$
     29//# $Id$
    3030//#---------------------------------------------------------------------------
    3131#ifndef STLINEFINDER_H
     
    199199
    200200   // auxiliary function to fit and subtract a polynomial from the current
    201    // spectrum. It uses the SDFitter class. This action is required before
     201   // spectrum. It uses the Fitter class. This action is required before
    202202   // reducing the spectral resolution if the baseline shape is bad
    203203   void subtractBaseline(const casa::Vector<casa::Bool> &temp_mask,
  • trunk/src/SDLog.cc

    r883 r890  
    33using namespace asap;
    44
    5 std::string SDLog::log_ = std::string("");
     5std::string Logger::log_ = std::string("");
    66
    7 SDLog::SDLog()
     7Logger::Logger()
    88{
    99  enableLog();
    1010}
    1111
    12 SDLog::SDLog(bool enabled)
     12Logger::Logger(bool enabled)
    1313{
    1414  enabled_ = enabled;
    1515}
    1616
    17 void SDLog::pushLog(const std::string& s, bool newline ) const
     17void Logger::pushLog(const std::string& s, bool newline ) const
    1818{
    1919  if (enabled_) {
     
    2222  };
    2323}
    24 std::string SDLog::popLog() const
     24std::string Logger::popLog() const
    2525{
    2626  std::string out;
     
    2828  return out;
    2929}
    30 void SDLog::enableLog()
     30void Logger::enableLog()
    3131{
    3232  enabled_ = true;
    3333}
    34 void SDLog::disableLog()
     34void Logger::disableLog()
    3535{
    3636  enabled_ = false;
  • trunk/src/SDLog.h

    r883 r890  
    77namespace asap {
    88
    9 class SDLog {
     9class Logger {
    1010public:
    11   SDLog();
    12   SDLog(bool enabled);
     11  Logger();
     12  Logger(bool enabled);
    1313  void pushLog(const std::string& s, bool newline=true) const;
    1414  //void pushLog(const char* cs);
  • trunk/src/STAttr.h

    r885 r890  
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:$
     29//# $Id$
    3030//#---------------------------------------------------------------------------
    3131#ifndef STATTR_H
     
    4444namespace asap {
    4545
    46 class STAttr : public SDLog {
     46class STAttr : public Logger {
    4747
    4848 public:
     
    5050  // Constructor
    5151  STAttr();
    52  
     52
    5353  // Destructor
    5454  ~STAttr();
    55  
     55
    5656  // Copy Constructor (copy semantics)
    5757  STAttr(const STAttr& other);
    58  
     58
    5959  // Assignment  (copy semantics)
    6060  STAttr &operator=(const STAttr& other);
    61  
     61
    6262  // Telescope diameter(m). Throws exception if unknown.
    6363  casa::Float diameter(Instrument inst) const;
    64  
     64
    6565  // Beam efficiency.  Frequency in Hz.  Returns 1 if unknown.
    66   casa::Vector<casa::Float> 
    67   beamEfficiency(Instrument instr, const casa::MEpoch& dateObs, 
     66  casa::Vector<casa::Float>
     67  beamEfficiency(Instrument instr, const casa::MEpoch& dateObs,
    6868                 const casa::Vector<casa::Float>& freqs) const;
    69  
     69
    7070  // Aperture efficiency. Frequency in Hz.  Returns 1 if unknown.
    71   casa::Vector<casa::Float> 
    72   apertureEfficiency(Instrument instr, 
    73                      const casa::MEpoch& dateObs, 
     71  casa::Vector<casa::Float>
     72  apertureEfficiency(Instrument instr,
     73                     const casa::MEpoch& dateObs,
    7474                     const casa::Vector<casa::Float>& freqs) const;
    75  
     75
    7676  // Find factor to convert Jy -> K for this telescope, date of
    7777  // observation and frequency (Hz)
    78   casa::Vector<casa::Float> JyPerK(Instrument instr, 
    79                                    const casa::MEpoch& dateObs, 
    80                                    const casa::Vector<casa::Float>& freqs) 
     78  casa::Vector<casa::Float> JyPerK(Instrument instr,
     79                                   const casa::MEpoch& dateObs,
     80                                   const casa::Vector<casa::Float>& freqs)
    8181    const;
    8282
     
    8888  // from the data themselves
    8989  FeedPolType feedPolType(Instrument) const;
    90  
     90
    9191  // Helper function to check instrument (antenna) name and give enum
    92   static Instrument convertInstrument(const casa::String& instrument, 
     92  static Instrument convertInstrument(const casa::String& instrument,
    9393                                      casa::Bool throwIt);
    94  
     94
    9595  // Helper function.  Finds factor to convert K -> Jy. Provide
    9696  // aperture efficiency and dish geometric diameter (m)
    9797  static casa::Float findJyPerK(casa::Float etaAp, casa::Float D);
    98  
     98
    9999private:
    100  
    101   // Static data 
     100
     101  // Static data
    102102  casa::Vector<casa::Float> MopEtaBeamX_;     // Beam efficiency
    103103  casa::Vector<casa::Float> MopEtaBeam2003Y_;
     
    111111
    112112  casa::Vector<casa::Float> TidGainElPoly_;   // Gain-el correction poly coeffs
    113  
     113
    114114  // Init private data
    115115  void initData();
    116116
    117117  // Linear interpolation
    118   casa::Vector<casa::Float> interp(const casa::Vector<casa::Float>& xOut, 
     118  casa::Vector<casa::Float> interp(const casa::Vector<casa::Float>& xOut,
    119119                                   const casa::Vector<casa::Float>& xIn,
    120120                                   const casa::Vector<casa::Float>& yIn) const;
  • trunk/src/STFiller.h

    r846 r890  
    3838@version  2.0a
    3939*/
    40 class STFiller : public SDLog {
     40class STFiller : public Logger {
    4141public:
    4242
  • trunk/src/STMath.h

    r867 r890  
    3333@author Malte Marquarding
    3434*/
    35 class STMath : private SDLog {
     35class STMath : private Logger {
    3636public:
    3737
  • trunk/src/STSubTable.h

    r857 r890  
    2828@version $Revision:$
    2929*/
    30 class STSubTable : public SDLog {
     30class STSubTable : public Logger {
    3131public:
    3232  STSubTable() {;}
  • trunk/src/STTemplates.cpp

    r851 r890  
    11//#---------------------------------------------------------------------------
    2 //# SDTemplates.cc: explicit templates for aips++
     2//# Templates.cc: explicit templates for aips++
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
  • trunk/src/STWriter.h

    r848 r890  
    5050  * @brief Export of ASAP data container into forign formats
    5151  * @author Malte Marquarding
    52   * @date $Date:$
     52  * @date $Date$
    5353  * @version 2.0a
    5454*/
    55 class STWriter : public SDLog {
     55class STWriter : public Logger {
    5656public:
    5757  STWriter(const string &format = "SDFITS");
  • trunk/src/Scantable.h

    r884 r890  
    6262  * @version
    6363*/
    64 class Scantable : private SDLog
     64class Scantable : private Logger
    6565{
    6666public:
  • trunk/src/python_SDFitter.cc

    r517 r890  
    11//#---------------------------------------------------------------------------
    2 //# python_SDFitter.cc: python exposure of c++ SDFitter class
     2//# python_Fitter.cc: python exposure of c++ Fitter class
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:
     29//# $Id:$
    3030//#---------------------------------------------------------------------------
    3131#include <boost/python.hpp>
     
    3838  namespace python {
    3939
    40     void python_SDFitter() {
    41       class_<SDFitter>("fitter")
     40    void python_Fitter() {
     41      class_<Fitter>("fitter")
    4242        .def( init <> () )
    43         .def("setexpression", &SDFitter::setExpression)
    44         .def("setdata", &SDFitter::setData)
    45         .def("getresidual", &SDFitter::getResidual)
    46         .def("getfit", &SDFitter::getFit)
    47         .def("getfixedparameters", &SDFitter::getFixedParameters)
    48         .def("setfixedparameters", &SDFitter::setFixedParameters)
    49         .def("getparameters", &SDFitter::getParameters)
    50         .def("setparameters", &SDFitter::setParameters)
    51         .def("getestimate", &SDFitter::getEstimate)
    52         .def("estimate", &SDFitter::computeEstimate)
    53         .def("geterrors", &SDFitter::getErrors)
    54         .def("getchi2", &SDFitter::getChisquared)
    55         .def("reset", &SDFitter::reset)
    56         .def("fit", &SDFitter::fit)
    57         .def("evaluate", &SDFitter::evaluate)
     43        .def("setexpression", &Fitter::setExpression)
     44        .def("setdata", &Fitter::setData)
     45        .def("getresidual", &Fitter::getResidual)
     46        .def("getfit", &Fitter::getFit)
     47        .def("getfixedparameters", &Fitter::getFixedParameters)
     48        .def("setfixedparameters", &Fitter::setFixedParameters)
     49        .def("getparameters", &Fitter::getParameters)
     50        .def("setparameters", &Fitter::setParameters)
     51        .def("getestimate", &Fitter::getEstimate)
     52        .def("estimate", &Fitter::computeEstimate)
     53        .def("geterrors", &Fitter::getErrors)
     54        .def("getchi2", &Fitter::getChisquared)
     55        .def("reset", &Fitter::reset)
     56        .def("fit", &Fitter::fit)
     57        .def("evaluate", &Fitter::evaluate)
    5858      ;
    5959    };
  • trunk/src/python_SDLog.cc

    r886 r890  
    11//#---------------------------------------------------------------------------
    2 //# python_SDLog.cc: python exposure of c++ SDLog class
     2//# python_Logger.cc: python exposure of c++ Logger class
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    3737namespace asap {
    3838  namespace python {
    39     void python_SDLog() {
    40       class_<SDLog>("Log")
     39    void python_Logger() {
     40      class_<Logger>("Log")
    4141        .def( init <> () )
    4242        //.def( init <bool> () )
    43         .def("push", &SDLog::pushLog,
     43        .def("push", &Logger::pushLog,
    4444         (boost::python::arg("newline")=1))
    45         .def("pop", &SDLog::popLog)
    46         .def("disable", &SDLog::disableLog)
    47         .def("enable", &SDLog::enableLog)
     45        .def("pop", &Logger::popLog)
     46        .def("disable", &Logger::disableLog)
     47        .def("enable", &Logger::enableLog)
    4848      ;
    4949    };
Note: See TracChangeset for help on using the changeset viewer.