Changeset 1700 for branches/alma
- Timestamp:
- 02/16/10 16:21:26 (15 years ago)
- Location:
- branches/alma/src
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Makefile
r1693 r1700 24 24 CASAINC := -I$(CASAROOT)/code/include -I$(COREINCD) -I$(CASAROOT)/$(CASAARCH)/include 25 25 CASALIB := $(CASAROOT)/$(CASAARCH)/lib 26 USELIB := lib 26 USELIB := lib64 27 27 28 28 # the compiler … … 34 34 CXXFLAGS := -fPIC -O3 -g 35 35 CXXFLAGS += -ansi -Wno-long-long -Wall 36 CXXOPTS := -DAIPS_64B 36 37 37 38 # darwin specific flags … … 56 57 # if not than there might by symbol resolution errors. 57 58 CASAPPLIB := -L$(CASALIB) -latnf $(CORELIB) \ 58 -L$(WCSLIBLIBD) $(WCSLIBLIB)\59 /usr/lib64/libwcs.so \ 59 60 $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++ 61 # -L$(WCSLIBLIBD) $(WCSLIBLIB) \ 60 62 61 63 # darwin specific CASA flags … … 140 142 141 143 HEADERS := MathUtils.h \ 144 Lorentzian1D.h \ 145 Lorentzian1DParam.h \ 142 146 Logger.h \ 143 147 STAttr.h \ -
branches/alma/src/STFitter.cpp
r1616 r1700 38 38 #include <scimath/Functionals/CompoundFunction.h> 39 39 #include <scimath/Functionals/Gaussian1D.h> 40 #include "Lorentzian1D.h" 40 41 #include <scimath/Functionals/Polynomial.h> 41 42 #include <scimath/Mathematics/AutoDiff.h> … … 147 148 funcs_.resize(1); 148 149 funcs_[0] = new Polynomial<Float>(ncomp); 150 } else if (expr == "lorentz") { 151 if (ncomp < 1) throw (AipsError("Need at least one lorentzian to fit.")); 152 funcs_.resize(ncomp); 153 for (Int k=0; k<ncomp; ++k) { 154 funcs_[k] = new Lorentzian1D<Float>(); 155 } 149 156 } else { 150 157 //cerr << " compiled functions not yet implemented" << endl; … … 230 237 (funcs_[0]->parameters())[i] = tmppar[i]; 231 238 } 239 } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) { 240 uInt count = 0; 241 for (uInt j=0; j < funcs_.nelements(); ++j) { 242 for (uInt i=0; i < funcs_[j]->nparameters(); ++i) { 243 (funcs_[j]->parameters())[i] = tmppar[count]; 244 parameters_[count] = tmppar[count]; 245 ++count; 246 } 247 } 232 248 } 233 249 // reset … … 263 279 funcs_[0]->mask(i) = !fixed[i]; 264 280 } 281 } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) { 282 uInt count = 0; 283 for (uInt j=0; j < funcs_.nelements(); ++j) { 284 for (uInt i=0; i < funcs_[j]->nparameters(); ++i) { 285 funcs_[j]->mask(i) = !fixed[count]; 286 fixedpar_[count] = fixed[count]; 287 ++count; 288 } 289 } 265 290 } 266 291 return true; -
branches/alma/src/Scantable.cpp
r1656 r1700 701 701 } 702 702 pushLog(String(oss)); 703 } 704 705 void Scantable::clip(const Float uthres, const Float dthres, bool clipoutside, bool unflag) 706 { 707 for (uInt i=0; i<table_.nrow(); ++i) { 708 Vector<Float> spcs = specCol_(i); 709 Vector<uChar> flgs = flagsCol_(i); 710 if (spcs.nelements() != nchan) { 711 throw(AipsError("Data has incorrect number of channels")); 712 } 713 uChar userflag = 1 << 7; 714 if (unflag) { 715 userflag = 0 << 7; 716 } 717 if (clipoutside) { 718 for (uInt j = 0; j < nchan; ++j) { 719 Float spc = spcs(j); 720 if ((spc >= uthres) || (spc <= dthres)) { 721 flgs(j) = userflag; 722 } 723 } 724 } else { 725 for (uInt j = 0; j < nchan; ++j) { 726 Float spc = spcs(j); 727 if ((spc < uthres) && (spc > dthres)) { 728 flgs(j) = userflag; 729 } 730 } 731 } 732 flagsCol_.put(i, flgs); 733 } 703 734 } 704 735 -
branches/alma/src/Scantable.h
r1656 r1700 244 244 245 245 /** 246 * Flag the data outside a specified range (in a channel-based manner). 247 * (CAS-1807 Wataru Kawasaki) 248 */ 249 void Scantable::clip(const Float uthres, const Float dthres, bool clipoutside, bool unflag); 250 251 /** 246 252 * Return a list of row numbers with respect to the original table. 247 253 * @return a list of unsigned ints -
branches/alma/src/ScantableWrapper.h
r1656 r1700 114 114 { return table_->getFlagRow(whichrow); } 115 115 116 void clip(const Float uthres, const Float dthres, bool clipoutside=true, bool unflag=false) 117 { table_->clip(uthres, dthres, clipoutside, unflag); } 118 116 119 std::string getSourceName(int whichrow=0) const 117 120 { return table_->getSourceName(whichrow); } -
branches/alma/src/python_Scantable.cpp
r1656 r1700 108 108 .def("_getflagrow", &ScantableWrapper::getFlagRow, 109 109 (boost::python::arg("whichrow")=0) ) 110 .def("_clip", &ScantableWrapper::clip, 111 (boost::python::arg("clipoutside")=true, 112 boost::python::arg("unflag")=false) ) 110 113 .def("_save", &ScantableWrapper::makePersistent) 111 114 .def("_summary", &ScantableWrapper::summary,
Note:
See TracChangeset
for help on using the changeset viewer.