- Timestamp:
- 10/04/16 18:20:50 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/components/SpectralComponents/SpectralEstimate.h
r2980 r3106 18 18 //# 19 19 //# Correspondence concerning AIPS++ should be addressed as follows: 20 //# Internet email: aips2-request@nrao.edu.20 //# casacore::Internet email: aips2-request@nrao.edu. 21 21 //# Postal address: AIPS++ Project Office 22 22 //# National Radio Astronomy Observatory … … 34 34 #include <components/SpectralComponents/SpectralList.h> 35 35 36 namespace casacore { 37 template <class T> class Vector; 38 } 39 36 40 namespace casa { //# NAMESPACE CASA - BEGIN 37 41 38 42 //# Forward Declarations 39 43 class GaussianSpectralElement; 40 template <class T> class Vector;41 44 42 45 // <summary> … … 97 100 //# Constants 98 101 // Default maximum number of components to be found 99 static const uInt MAXPAR = 200;102 static const casacore::uInt MAXPAR = 200; 100 103 //# Enumerations 101 104 //# Friends … … 106 109 // of components that will be found. A value of zero will indicate 107 110 // an unlimited number. 108 explicit SpectralEstimate(const uInt maxpar=MAXPAR);111 explicit SpectralEstimate(const casacore::uInt maxpar=MAXPAR); 109 112 // Create an estimator with the given maximum number of possible 110 113 // elements. A value of zero will indicate an unlimited number. … … 112 115 // found, and a minimum width. Cutoff and minsigma default to 0.0, maximum 113 116 // size of list produced to 200. 114 explicit SpectralEstimate(const Double rms,115 const Double cutoff=0.0, constDouble 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); 117 120 // Copy constructor (deep copy) 118 121 SpectralEstimate(const SpectralEstimate &other); … … 138 141 // <group> 139 142 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); 145 148 // </group> 146 149 … … 151 154 // <group> 152 155 // 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); 154 157 // 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); 156 159 // 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); 158 161 // Set the number of points consider at each side of test point (i.e. a 159 162 // 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); 161 164 // Set a region [lo,hi] over which to estimate. Lo and hi are given as 162 165 // zero-based vector indices. 163 void setRegion(const Int lo, constInt hi);166 void setRegion(const casacore::Int lo, const casacore::Int hi); 164 167 // Do you want to look in an automatically determined window with signal? 165 168 // Default is False, meaning the full (possibly regioned) profile. 166 169 void setWindowing(const Bool win=False); 167 170 // 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); 169 172 // </group> 170 173 … … 174 177 Bool useWindow_p; 175 178 // rms estimate in profile 176 Double rms_p;179 casacore::Double rms_p; 177 180 // Source cutoff amplitude 178 Double cutoff_p;181 casacore::Double cutoff_p; 179 182 // Window low and end value 180 183 // <group> 181 Int windowLow_p;182 Int windowEnd_p;184 casacore::Int windowLow_p; 185 casacore::Int windowEnd_p; 183 186 // </group> 184 187 // Region low and high value 185 188 // <group> 186 Int regionLow_p;187 Int regionEnd_p;189 casacore::Int regionLow_p; 190 casacore::Int regionEnd_p; 188 191 // </group> 189 192 // Smoothing parameter. I.e. 2q+1 points are taken 190 Int q_p;191 // Internal cashing of calculated values based on q192 // <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; 195 198 // </group> 196 199 // The minimum Gaussian width 197 Double sigmin_p;200 casacore::Double sigmin_p; 198 201 // The second derivatives 199 Double *deriv_p;202 casacore::Double *deriv_p; 200 203 // The list of components 201 204 SpectralList slist_p; 202 205 // The length of the current profile being estimated 203 uInt lprof_p;206 casacore::uInt lprof_p; 204 207 205 208 //# Member functions 206 209 // Get the window or the total spectrum 207 210 template <class MT> 208 uInt window(constVector<MT> &prof);211 casacore::uInt window(const casacore::Vector<MT> &prof); 209 212 // Get the second derivatives 210 213 template <class MT> 211 void findc2(const Vector<MT> &prof);214 void findc2(const casacore::Vector<MT> &prof); 212 215 // Find the Gaussians 213 216 template <class MT> 214 void findga(const Vector<MT> &prof);217 void findga(const casacore::Vector<MT> &prof); 215 218 // Convert the parameters of the components in the list from 216 219 // 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, 218 221 const GaussianSpectralElement& el) const; 219 222 };
Note: See TracChangeset
for help on using the changeset viewer.