Ignore:
Timestamp:
10/04/16 18:20:50 (8 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes/No?

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

Location:
trunk/external-alma/components/SpectralComponents
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/components/SpectralComponents/CompiledSpectralElement.h

    r2980 r3106  
    6969        // Construct a compiled string
    7070        explicit CompiledSpectralElement(
    71                 const String& function, const Vector<Double>& param
     71                const casacore::String& function, const casacore::Vector<casacore::Double>& param
    7272        );
    7373
     
    9797
    9898        // Save to a record.
    99         virtual Bool toRecord(RecordInterface& out) const;
     99        virtual casacore::Bool toRecord(RecordInterface& out) const;
    100100
    101101protected:
     
    105105        // For subclasses. Parameters and function must be set after construction.
    106106        explicit CompiledSpectralElement(
    107                 SpectralElement::Types type, const Vector<Double>& param=Vector<Double>(0)
     107                SpectralElement::Types type, const casacore::Vector<casacore::Double>& param=casacore::Vector<casacore::Double>(0)
    108108        );
    109109
    110110        CompiledSpectralElement(
    111                 SpectralElement::Types type, uInt nParam
     111                SpectralElement::Types type, casacore::uInt nParam
    112112        );
    113113
    114         virtual void _setFunction(const String& function);
     114        virtual void _setFunction(const casacore::String& function);
    115115
    116116        /*
  • trunk/external-alma/components/SpectralComponents/GaussianSpectralElement.h

    r2980 r3106  
    7676        //# Constants
    7777        // Sigma to FWHM conversion factor
    78         static const Double SigmaToFWHM;
     78        static const casacore::Double SigmaToFWHM;
    7979
    8080        //# Constructors
     
    8686        // </thrown>
    8787        GaussianSpectralElement(
    88                 const Double ampl, const Double center,
    89                 const Double sigma
     88                const casacore::Double ampl, const casacore::Double center,
     89                const casacore::Double sigma
    9090        );
    9191
     
    9595        //   <li> AipsError if sigma == 0.0
    9696        // </thrown>
    97         GaussianSpectralElement(const Vector<Double> &param);
     97        GaussianSpectralElement(const casacore::Vector<casacore::Double> &param);
    9898        // Copy constructor (deep copy)
    9999        // <thrown>
     
    114114//      GaussianSpectralElement& operator=(const GaussianSpectralElement &other);
    115115        // Evaluate the value of the element at x
    116         //Double operator()(const Double x) const;
     116        //casacore::Double operator()(const casacore::Double x) const;
    117117
    118         Double getSigma() const;
    119         Double getFWHM() const;
     118        casacore::Double getSigma() const;
     119        casacore::Double getFWHM() const;
    120120
    121         Double getSigmaErr() const;
    122         Double getFWHMErr() const;
     121        casacore::Double getSigmaErr() const;
     122        casacore::Double getFWHMErr() const;
    123123
    124124
    125         void setSigma(Double sigma);
    126         void setFWHM(Double fwhm);
     125        void setSigma(casacore::Double sigma);
     126        void setFWHM(casacore::Double fwhm);
    127127
    128         void fixSigma(const Bool fix=True);
     128        void fixSigma(const casacore::Bool fix=True);
    129129
    130         Bool fixedSigma() const;
     130        casacore::Bool fixedSigma() const;
    131131
    132         Double getIntegral() const;
     132        casacore::Double getIntegral() const;
    133133
    134134        // Save to a record.   For Gaussian elements,
    135135        // the width is defined as a FWHM in the record interface.
    136         Bool toRecord(RecordInterface &out) const;
     136        casacore::Bool toRecord(RecordInterface &out) const;
    137137
    138138        // Sigma to FWHM
    139139        // Convert from sigma to FWHM and vice versa
    140140        // <group>
    141         static Double sigmaFromFWHM (const Double fwhm);
     141        static casacore::Double sigmaFromFWHM (const casacore::Double fwhm);
    142142
    143         static Double sigmaToFWHM (const Double sigma);
     143        static casacore::Double sigmaToFWHM (const casacore::Double sigma);
    144144        // </group>
    145145
    146         void set(const Vector<Double>& v);
     146        void set(const casacore::Vector<casacore::Double>& v);
    147147
    148148private:
     
    150150        // but the second param of the corresponding Gaussian1D function is the
    151151        // FWHM :(
    152         void _set(const Vector<Double>& v);
     152        void _set(const casacore::Vector<casacore::Double>& v);
    153153
    154154};
  • trunk/external-alma/components/SpectralComponents/Spectral2Estimate.tcc

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    4040//# Member templates
    4141template <class MT>
    42 const SpectralList &SpectralEstimate::estimate(const Vector<MT> &prof,
    43                                                Vector<MT> *der) {
     42const SpectralList &SpectralEstimate::estimate(const casacore::Vector<MT> &prof,
     43                                               casacore::Vector<MT> *der) {
    4444          if (prof.nelements() != lprof_p) {
    4545    delete [] deriv_p; deriv_p = 0; lprof_p = 0;
    4646    lprof_p = prof.nelements();
    47     deriv_p = new Double[lprof_p];
     47    deriv_p = new casacore::Double[lprof_p];
    4848  };
    4949  // Check if signal in window
    5050  if (!window(prof)) return slist_p;
    5151  // Limit window
    52   windowEnd_p = min(windowEnd_p+q_p , Int(lprof_p));
     52  windowEnd_p = min(windowEnd_p+q_p , casacore::Int(lprof_p));
    5353  windowLow_p = max(windowLow_p-q_p , 0 );
    5454  // Get the second derivatives
     
    5656  // Next for debugging
    5757  if (der) {
    58     for (uInt i=0; i<lprof_p; i++) (*der)[i] = deriv_p[i];
     58    for (casacore::uInt i=0; i<lprof_p; i++) (*der)[i] = deriv_p[i];
    5959  };
    6060  // Find the estimates (sorted)
     
    6565
    6666template <class MT>
    67 const SpectralList& SpectralEstimate::estimate(const Vector<MT>& x,
    68                                                const Vector<MT>& y)
     67const SpectralList& SpectralEstimate::estimate(const casacore::Vector<MT>& x,
     68                                               const casacore::Vector<MT>& y)
    6969{
    7070  if (x.nelements() != y.nelements()) {
     
    7777  estimate(y);
    7878  // Convert
    79   for (uInt i=0; i<slist_p.nelements(); i++) {
     79  for (casacore::uInt i=0; i<slist_p.nelements(); i++) {
    8080          if (slist_p[i]->getType() != SpectralElement::GAUSSIAN) {
    8181                  throw AipsError("Non-gaussian spectral types cannot be estimated");
     
    9090
    9191template <class MT>
    92 uInt SpectralEstimate::window(const Vector<MT> &prof) {
     92casacore::uInt SpectralEstimate::window(const casacore::Vector<MT> &prof) {
    9393  windowLow_p =0;
    9494  windowEnd_p = 0;
    9595  if (!useWindow_p || rms_p <= 0.0 || lprof_p == 0) {
    9696    if (regionEnd_p) {
    97       windowLow_p = min(max(0,regionLow_p),Int(lprof_p));
    98       windowEnd_p = min(regionEnd_p, Int(lprof_p));
     97      windowLow_p = min(max(0,regionLow_p),casacore::Int(lprof_p));
     98      windowEnd_p = min(regionEnd_p, casacore::Int(lprof_p));
    9999    } else windowEnd_p = lprof_p;
    100100    return windowEnd_p-windowLow_p;
    101101  };
    102102  // Total flux in profile and max position
    103   Double flux(0.0);
    104   Double pmax(prof(0));
    105   uInt imax(0);
    106   for (Int i=windowLow_p; i<windowEnd_p; i++) {
     103  casacore::Double flux(0.0);
     104  casacore::Double pmax(prof(0));
     105  casacore::uInt imax(0);
     106  for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    107107    if (prof(i)>pmax) {
    108108      pmax = prof(i);
     
    114114  if (pmax < cutoff_p) return 0;
    115115  // Window boundaries; new/old base and centre; width
    116   Int width(-1);
    117   Int nw(0);
    118   Double bnew(flux), bold;
    119   Double cnew(imax), cold;
     116  casacore::Int width(-1);
     117  casacore::Int nw(0);
     118  casacore::Double bnew(flux), bold;
     119  casacore::Double cnew(imax), cold;
    120120  do {
    121121    width++;
    122122    cold = cnew;
    123123    bold = bnew;
    124     windowLow_p = max(0, Int(cold-width+0.5));
    125     windowEnd_p = min(Int(lprof_p), Int(cold+width+1.5));
     124    windowLow_p = max(0, casacore::Int(cold-width+0.5));
     125    windowEnd_p = min(casacore::Int(lprof_p), casacore::Int(cold+width+1.5));
    126126    // flux and first moment in window
    127     Double s(0);
    128     Double c(0);
    129     for (Int i=windowLow_p; i<windowEnd_p; i++) {
     127    casacore::Double s(0);
     128    casacore::Double c(0);
     129    for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    130130      s += prof(i);
    131131      c += i*prof(i);
     
    142142
    143143template <class MT>
    144 void SpectralEstimate::findc2(const Vector<MT> &prof) {
    145   for (Int i=windowLow_p; i<windowEnd_p; i++) {
     144void SpectralEstimate::findc2(const casacore::Vector<MT> &prof) {
     145  for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    146146    // Moments
    147     Double m0(0.0);
    148     Double m2(0.0);
    149     for (Int j = -q_p; j <= q_p; j++) {
    150       Int k = i+j;
    151       if (k >= 0 && k<Int(lprof_p)) {
     147    casacore::Double m0(0.0);
     148    casacore::Double m2(0.0);
     149    for (casacore::Int j = -q_p; j <= q_p; j++) {
     150      casacore::Int k = i+j;
     151      if (k >= 0 && k<casacore::Int(lprof_p)) {
    152152        // add to moments
    153153        m0 += prof(k);
     
    161161
    162162template <class MT>
    163 void SpectralEstimate::findga(const Vector<MT> &prof) {
    164         Int i(windowLow_p-1);
     163void SpectralEstimate::findga(const casacore::Vector<MT> &prof) {
     164        casacore::Int i(windowLow_p-1);
    165165        // Window on Gaussian
    166         Int iclo(windowLow_p);
    167         Int ichi(windowLow_p);
     166        casacore::Int iclo(windowLow_p);
     167        casacore::Int ichi(windowLow_p);
    168168        // Peak counter
    169         Int nmax = 0;
     169        casacore::Int nmax = 0;
    170170        GaussianSpectralElement tspel;
    171171        while (++i < windowEnd_p) {
     
    187187                case 2: {
    188188                        // Some moments
    189                         Double m0m(0);
    190                         Double m0(0);
    191                         Double m1(0);
    192                         Double m2(0);
     189                        casacore::Double m0m(0);
     190                        casacore::Double m0(0);
     191                        casacore::Double m1(0);
     192                        casacore::Double m2(0);
    193193                        ichi = i;
    194194                        // Do Schwarz' calculation
    195                         Double b = deriv_p[iclo];
    196                         Double a = (deriv_p[ichi] - b) / (ichi-iclo);
    197                         for (Int ic=iclo; ic<=ichi; ic++) {
     195                        casacore::Double b = deriv_p[iclo];
     196                        casacore::Double a = (deriv_p[ichi] - b) / (ichi-iclo);
     197                        for (casacore::Int ic=iclo; ic<=ichi; ic++) {
    198198                                m0m += min(deriv_p[ic], 0.0);
    199                                 Double wi = deriv_p[ic] - a*(ic-iclo) - b;
     199                                casacore::Double wi = deriv_p[ic] - a*(ic-iclo) - b;
    200200                                m0 += wi;
    201201                                m1 += wi*ic;
     
    203203                        };
    204204                        // determinant
    205                         Double det = m2*m0 - m1*m1;
     205                        casacore::Double det = m2*m0 - m1*m1;
    206206                        if (det > 0.0 && fabs(m0m) >  FLT_EPSILON) {
    207                                 Double   xm = m1/m0;
    208                                 Double sg = 1.69*sqrt(det) / fabs(m0);
     207                                casacore::Double   xm = m1/m0;
     208                                casacore::Double sg = 1.69*sqrt(det) / fabs(m0);
    209209                                // Width above critical?
    210210                                if (sg > sigmin_p) {
    211                                         Int is = Int(1.73*sg+0.5);
    212                                         Int im = Int(xm+0.5);
    213                                         Double yl(0);
     211                                        casacore::Int is = casacore::Int(1.73*sg+0.5);
     212                                        casacore::Int im = casacore::Int(xm+0.5);
     213                                        casacore::Double yl(0);
    214214                                        if ((im-is) >= 0) yl = prof(im-is);
    215                                         Double yh(0);
    216                                         if ((im + is) <= Int(lprof_p-1)) yh = prof(im+is);
    217                                         Double ym = prof(im);
     215                                        casacore::Double yh(0);
     216                                        if ((im + is) <= casacore::Int(lprof_p-1)) yh = prof(im+is);
     217                                        casacore::Double ym = prof(im);
    218218                    // modified by dmehringer 2012apr03 to deal with 0 denominator
    219219                    // 0.0/0.0 produces NaN on Linux but 0 on OSX
    220                     Double pg = (ym-0.5*(yh+yl));
     220                    casacore::Double pg = (ym-0.5*(yh+yl));
    221221                                        if (pg != 0) {
    222                                                 Double denom = (1.0-exp(-0.5*(is*is)/sg/sg));
     222                                                casacore::Double denom = (1.0-exp(-0.5*(is*is)/sg/sg));
    223223                                                if (denom == 0) {
    224224                                                        throw AipsError("Bailing because division by zero is undefined");
     
    252252
    253253template <class MT>
    254 GaussianSpectralElement SpectralEstimate::convertElement (const Vector<MT>& x,
     254GaussianSpectralElement SpectralEstimate::convertElement (const casacore::Vector<MT>& x,
    255255                                                  const GaussianSpectralElement& el) const
    256256{
    257257        GaussianSpectralElement elOut = el;
    258    const Int& idxMax = x.nelements()-1;
     258   const casacore::Int& idxMax = x.nelements()-1;
    259259
    260260// Get current (pars are amp, center, width as the SpectralElement
    261261// will always be a Gaussian)
    262262
    263    Vector<Double> par, err;
     263   casacore::Vector<casacore::Double> par, err;
    264264   el.get(par);
    265265   el.getError(err);
     
    267267// Center
    268268
    269    Int cenIdx = Int(par[1]);
     269   casacore::Int cenIdx = casacore::Int(par[1]);
    270270
    271271// Get the x-increment, local to the center, as best we can from
     
    273273// vector is monotonic
    274274
    275    Double incX;
     275   casacore::Double incX;
    276276   if (cenIdx-1<0) {
    277277      incX = x[1] - x[0];
     
    287287      par[1] = incX*(par[1]-idxMax) + x[idxMax];   // Extrapolate from x[idxMax]
    288288   } else {
    289       Double dIdx = par[1] - cenIdx;
    290       par[1] = x[cenIdx] + dIdx*incX;              // Interpolate
     289      casacore::Double dIdx = par[1] - cenIdx;
     290      par[1] = x[cenIdx] + dIdx*incX;              // casacore::Interpolate
    291291   }
    292292   err[1] = abs(err[1] * incX);
  • trunk/external-alma/components/SpectralComponents/SpectralElement.cc

    r3029 r3106  
    4242#include <casa/iostream.h>
    4343
     44using namespace casacore;
    4445namespace casa { //# NAMESPACE CASA - BEGIN
    4546
  • trunk/external-alma/components/SpectralComponents/SpectralElement.h

    r3029 r3106  
    3434#include <casa/Arrays/Vector.h>
    3535#include <casa/Containers/RecordInterface.h>
     36
     37using namespace casacore;
    3638
    3739namespace casa { //# NAMESPACE CASA - BEGIN
     
    105107
    106108        // Evaluate the value of the element at x
    107         virtual Double operator()(const Double x) const;
    108 
    109         Bool operator==(const SpectralElement& other) const;
     109        virtual casacore::Double operator()(const casacore::Double x) const;
     110
     111        casacore::Bool operator==(const SpectralElement& other) const;
    110112
    111113        // Get parameter n
     
    113115        //  <li> AipsError if illegal n
    114116        // </thrown>
    115         virtual Double operator[](const uInt n) const;
    116 
    117         // Get all the types available as String and codes, and number available
    118         static const String* allTypes(Int &nall,
     117        virtual casacore::Double operator[](const uInt n) const;
     118
     119        // Get all the types available as casacore::String and codes, and number available
     120        static const casacore::String* allTypes(Int &nall,
    119121                        const SpectralElement::Types *&typ);
    120122        // Get a string from the type
    121         static const String &fromType(SpectralElement::Types tp);
    122         // Get a type from a (non-case sensitive; minimum match) String
    123         static Bool toType(SpectralElement::Types &tp,
    124                         const String &typName);
     123        static const casacore::String &fromType(SpectralElement::Types tp);
     124        // Get a type from a (non-case sensitive; minimum match) casacore::String
     125        static casacore::Bool toType(SpectralElement::Types &tp,
     126                        const casacore::String &typName);
    125127
    126128        // Get type of this element
     
    128130
    129131        // Get all parameters
    130         void get(Vector<Double>& params) const;
    131 
    132         Vector<Double> get() const;
     132        void get(casacore::Vector<casacore::Double>& params) const;
     133
     134        casacore::Vector<casacore::Double> get() const;
    133135
    134136        // Get error estimates of parameters
    135         void getError(Vector<Double> &err) const;
    136         Vector<Double> getError() const;
     137        void getError(casacore::Vector<casacore::Double> &err) const;
     138        casacore::Vector<casacore::Double> getError() const;
    137139
    138140        // Get the order (i.e. the number of parameters)
     
    140142
    141143        // Set the error fields
    142         virtual void setError(const Vector<Double> &err);
     144        virtual void setError(const casacore::Vector<casacore::Double> &err);
    143145
    144146        // Set fixed parameters (True) or unset them (False)
     
    148150
    149151        // Fix/unfix all in one go
    150         virtual void fix(const Vector<Bool>& fix);
     152        virtual void fix(const casacore::Vector<casacore::Bool>& fix);
    151153
    152154        // Get the fix state[s]
    153         const Vector<Bool> &fixed() const;
     155        const casacore::Vector<casacore::Bool> &fixed() const;
    154156
    155157        // Save to a record.
    156         virtual Bool toRecord(RecordInterface& out) const;
     158        virtual casacore::Bool toRecord(RecordInterface& out) const;
    157159
    158160        // set parameters
    159         virtual void set(const Vector<Double>& params);
     161        virtual void set(const casacore::Vector<casacore::Double>& params);
    160162
    161163protected:
     
    163165        SpectralElement() {}
    164166
    165         SpectralElement(Types type, const Vector<Double>& parms=Vector<Double>(0));
     167        SpectralElement(Types type, const casacore::Vector<casacore::Double>& parms=casacore::Vector<casacore::Double>(0));
    166168
    167169        SpectralElement(const SpectralElement& other);
     
    169171        SpectralElement &operator=(const SpectralElement& other);
    170172
    171         void _set(const Vector<Double>& params);
     173        void _set(const casacore::Vector<casacore::Double>& params);
    172174
    173175        void _setType(const Types type);
    174176
    175         void _setFunction(const SHARED_PTR<Function<Double, Double> >& f);
    176 
    177         virtual SHARED_PTR<Function<Double, Double> > _getFunction() const {
     177        void _setFunction(const SHARED_PTR<Function<casacore::Double, casacore::Double> >& f);
     178
     179        virtual SHARED_PTR<Function<casacore::Double, casacore::Double> > _getFunction() const {
    178180                return _function;
    179181        }
     
    186188        // The parameters of the function. I.e. the polynomial coefficients;
    187189        // amplitude, center and sigma of a Gaussian.
    188         Vector<Double> _params;
     190        casacore::Vector<casacore::Double> _params;
    189191        // The errors of the parameters
    190         Vector<Double> _errors;
     192        casacore::Vector<casacore::Double> _errors;
    191193        // The indication if the parameter has to be fixed (True) or solved (False).
    192194        // Solved is the default.
    193         Vector<Bool> _fixed;
    194 
    195         SHARED_PTR<Function<Double, Double> > _function;
     195        casacore::Vector<casacore::Bool> _fixed;
     196
     197        SHARED_PTR<Function<casacore::Double, casacore::Double> > _function;
    196198
    197199};
     
    199201ostream &operator<<(ostream& os, const SpectralElement& elem);
    200202
    201 Bool near(const SpectralElement& s1, const SpectralElement& s2, const Double tol);
    202 
    203 Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const Double tol);
     203casacore::Bool near(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol);
     204
     205casacore::Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol);
    204206
    205207
  • trunk/external-alma/components/SpectralComponents/SpectralEstimate.h

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    3434#include <components/SpectralComponents/SpectralList.h>
    3535
     36namespace casacore {
     37    template <class T> class Vector;
     38}
     39
    3640namespace casa { //# NAMESPACE CASA - BEGIN
    3741
    3842//# Forward Declarations
    3943class GaussianSpectralElement;
    40 template <class T> class Vector;
    4144
    4245// <summary>
     
    97100  //# Constants
    98101  // Default maximum number of components to be found
    99   static const uInt MAXPAR = 200;
     102  static const casacore::uInt MAXPAR = 200;
    100103  //# Enumerations
    101104  //# Friends
     
    106109  // of components that will be found. A value of zero will indicate
    107110  // an unlimited number.
    108   explicit SpectralEstimate(const uInt maxpar=MAXPAR);
     111  explicit SpectralEstimate(const casacore::uInt maxpar=MAXPAR);
    109112  // Create an estimator with the given maximum number of possible
    110113  // elements. A value of zero will indicate an unlimited number.
     
    112115  // found, and a minimum width. Cutoff and minsigma default to 0.0, maximum
    113116  // size of list produced to 200.
    114   explicit SpectralEstimate(const Double rms,
    115                             const Double cutoff=0.0, const Double minsigma=0.0,
    116                             const uInt maxpar=MAXPAR);
     117  explicit SpectralEstimate(const casacore::Double rms,
     118                            const casacore::Double cutoff=0.0, const casacore::Double minsigma=0.0,
     119                            const casacore::uInt maxpar=MAXPAR);
    117120  // Copy constructor (deep copy)
    118121  SpectralEstimate(const SpectralEstimate &other);
     
    138141  // <group>
    139142  template <class MT>
    140     const SpectralList& estimate(const Vector<MT>& ordinate,
    141                                  Vector<MT> *der = 0);
    142   template <class MT>
    143     const SpectralList& estimate(const Vector<MT>& abcissa,
    144                                  const Vector<MT>& ordinate);
     143    const SpectralList& estimate(const casacore::Vector<MT>& ordinate,
     144                                 casacore::Vector<MT> *der = 0);
     145  template <class MT>
     146    const SpectralList& estimate(const casacore::Vector<MT>& abcissa,
     147                                 const casacore::Vector<MT>& ordinate);
    145148  // </group>
    146149
     
    151154  // <group>
    152155  // Set the profile's estimated rms (forced to abs(rms))
    153   void setRMS(const Double rms=0.0);
     156  void setRMS(const casacore::Double rms=0.0);
    154157  // Set the amplitude cutoff for valid estimate (forced to max(0,cutoff))
    155   void setCutoff(const Double cutoff=0.0);
     158  void setCutoff(const casacore::Double cutoff=0.0);
    156159  // Set the minimum width allowed (forced to max(0,minsigma))
    157   void setMinSigma(const Double minsigma=0.0);
     160  void setMinSigma(const casacore::Double minsigma=0.0);
    158161  // Set the number of points consider at each side of test point (i.e. a
    159162  // width of 2q+1 is taken). Default internally is 2; max(1,q) taken.
    160   void setQ(const uInt q=2);
     163  void setQ(const casacore::uInt q=2);
    161164  // Set a region [lo,hi] over which to estimate. Lo and hi are given as
    162165  // zero-based vector indices.
    163   void setRegion(const Int lo, const Int hi);
     166  void setRegion(const casacore::Int lo, const casacore::Int hi);
    164167  // Do you want to look in an automatically determined window with signal?
    165168  // Default is False, meaning the full (possibly regioned) profile.
    166169  void setWindowing(const Bool win=False);
    167170  // Set the maximum number of estimates to find (forced to >=1; 200 default)
    168   void setMaxN(const uInt maxpar=MAXPAR);
     171  void setMaxN(const casacore::uInt maxpar=MAXPAR);
    169172  // </group>
    170173
     
    174177  Bool useWindow_p;
    175178  // rms estimate in profile
    176   Double rms_p;
     179  casacore::Double rms_p;
    177180  // Source cutoff amplitude
    178   Double cutoff_p;
     181  casacore::Double cutoff_p;
    179182  // Window low and end value
    180183  // <group>
    181   Int windowLow_p;
    182   Int windowEnd_p;
     184  casacore::Int windowLow_p;
     185  casacore::Int windowEnd_p;
    183186  // </group>
    184187  // Region low and high value
    185188  // <group>
    186   Int regionLow_p;
    187   Int regionEnd_p;
     189  casacore::Int regionLow_p;
     190  casacore::Int regionEnd_p;
    188191  // </group>
    189192  // Smoothing parameter. I.e. 2q+1 points are taken
    190   Int q_p;
    191   // Internal cashing of calculated values based on q
    192   // <group>
    193   Double a_p;
    194   Double b_p;
     193  casacore::Int q_p;
     194  // casacore::Internal cashing of calculated values based on q
     195  // <group>
     196  casacore::Double a_p;
     197  casacore::Double b_p;
    195198  // </group>
    196199  // The minimum Gaussian width
    197   Double sigmin_p;
     200  casacore::Double sigmin_p;
    198201  // The second derivatives
    199   Double *deriv_p;
     202  casacore::Double *deriv_p;
    200203  // The list of components
    201204  SpectralList slist_p;
    202205  // The length of the current profile being estimated
    203   uInt lprof_p;
     206  casacore::uInt lprof_p;
    204207
    205208  //# Member functions
    206209  // Get the window or the total spectrum
    207210  template <class MT>
    208     uInt window(const Vector<MT> &prof);
     211    casacore::uInt window(const casacore::Vector<MT> &prof);
    209212  // Get the second derivatives
    210213  template <class MT>
    211     void findc2(const Vector<MT> &prof);
     214    void findc2(const casacore::Vector<MT> &prof);
    212215  // Find the Gaussians
    213216  template <class MT>
    214     void findga(const Vector<MT> &prof);
     217    void findga(const casacore::Vector<MT> &prof);
    215218  // Convert the parameters of the components in the list from
    216219  // pixel-based indices to the given abcissa-vector space.
    217   template <class MT> GaussianSpectralElement convertElement (const Vector<MT>& abcissa,
     220  template <class MT> GaussianSpectralElement convertElement (const casacore::Vector<MT>& abcissa,
    218221                                                      const GaussianSpectralElement& el) const;
    219222};
  • trunk/external-alma/components/SpectralComponents/SpectralList.h

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    3434#include <casa/Containers/Block.h>
    3535
     36namespace casacore {
     37
     38    class RecordInterface;
     39    class String;
     40    template <class T> class Vector;
     41}
     42
    3643namespace casa { //# NAMESPACE CASA - BEGIN
    3744
    3845//# Forward Declarations
    3946class SpectralElement;
    40 class RecordInterface;
    41 class String;
    42 template <class T> class Vector;
    4347
    4448// <summary>
     
    8690  SpectralList();
    8791  // Construct a list with a maximum length of n (0: unlimited length)
    88   explicit SpectralList(uInt nmax);
     92  explicit SpectralList(casacore::uInt nmax);
    8993  // Construct with an initial element
    9094  explicit SpectralList(const SpectralElement &in);
     
    100104  SpectralList &operator=(const SpectralList &other);
    101105  // Evaluate the value of the sum of the elements at x
    102   Double operator()(const Double x) const;
     106  casacore::Double operator()(const casacore::Double x) const;
    103107  // Get element n
    104108  // <thrown>
     
    106110  // </thrown>
    107111  // <group>
    108   const SpectralElement* operator[](const uInt n) const;
    109   SpectralElement* operator[](const uInt n);
     112  const SpectralElement* operator[](const casacore::uInt n) const;
     113  SpectralElement* operator[](const casacore::uInt n);
    110114  // </group>
    111115
    112116  //# Member functions
    113117  // Get the number of elements in list
    114   uInt nelements() const { return list_p.nelements(); };
     118  casacore::uInt nelements() const { return list_p.nelements(); };
    115119
    116120  // Get the profile values for all elements in list. The evaluation
     
    138142  // Add elements to list (False if list has max length and full)
    139143  // <group>
    140   Bool add(const SpectralElement &in);
    141   Bool add(const SpectralList &in);
     144  casacore::Bool add(const SpectralElement &in);
     145  casacore::Bool add(const SpectralList &in);
    142146  // </group>
    143147  // Insert in sort order in the list
     
    148152  // Set an element in the list. Return False if more than one place beyond
    149153  // end of list; or if beyond max size.
    150   Bool set(const SpectralElement &in, const uInt which);
     154  casacore::Bool set(const SpectralElement &in, const casacore::uInt which);
    151155
    152156  // Clear the list
     
    154158
    155159  // Set a maximum size of the list
    156   void set(const uInt nmax);
     160  void set(const casacore::uInt nmax);
    157161
    158162  // Sort the list on the first parameter (i.e. peak value for Gaussian)
     
    161165  // Convert to and from a Record (see details in SpectralElement)
    162166  // <group>
    163   Bool fromRecord (String& errMsg, const RecordInterface& container);
    164   Bool toRecord(RecordInterface& container) const;
     167  casacore::Bool fromRecord (casacore::String& errMsg, const casacore::RecordInterface& container);
     168  casacore::Bool toRecord(casacore::RecordInterface& container) const;
    165169  //</group>
    166170
     
    168172  //#Data
    169173  // Max length allowed of list
    170   uInt nmax_p;
     174  casacore::uInt nmax_p;
    171175  // List of elements
    172   PtrBlock<SpectralElement *> list_p;
     176  casacore::PtrBlock<SpectralElement *> list_p;
    173177
    174178  //# Member functions
    175179  // Compare two elements
    176   Int compar(const SpectralElement &p1, const SpectralElement &p2) const;
     180  casacore::Int compar(const SpectralElement &p1, const SpectralElement &p2) const;
    177181
    178182};
Note: See TracChangeset for help on using the changeset viewer.