Changeset 1603 for branches/alma/python/asapfitter.py
- Timestamp:
- 07/18/09 06:35:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/asapfitter.py
r1461 r1603 3 3 from asap import print_log 4 4 from asap import _n_bools 5 from asap import mask_and 5 6 6 7 class fitter: … … 53 54 Parameters: 54 55 thescan: a scantable 55 mask: a msk ret ireved from the scantable56 mask: a msk retrieved from the scantable 56 57 """ 57 58 if not thescan: … … 142 143 self.x = self.data._getabcissa(row) 143 144 self.y = self.data._getspectrum(row) 145 self.mask = mask_and(self.mask, self.data._getmask(row)) 144 146 from asap import asaplog 145 147 asaplog.push("Fitting:") 146 148 i = row 147 out = "Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (self.data.getscan(i),self.data.getbeam(i),self.data.getif(i),self.data.getpol(i), self.data.getcycle(i)) 149 out = "Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (self.data.getscan(i), 150 self.data.getbeam(i), 151 self.data.getif(i), 152 self.data.getpol(i), 153 self.data.getcycle(i)) 148 154 asaplog.push(out,False) 149 155 self.fitter.setdata(self.x, self.y, self.mask) … … 245 251 246 252 def set_gauss_parameters(self, peak, centre, fwhm, 247 peakfixed=0, cent erfixed=0,253 peakfixed=0, centrefixed=0, 248 254 fwhmfixed=0, 249 255 component=0): … … 253 259 peak, centre, fwhm: The gaussian parameters 254 260 peakfixed, 255 cent erfixed,261 centrefixed, 256 262 fwhmfixed: Optional parameters to indicate if 257 263 the paramters should be held fixed during … … 270 276 if 0 <= component < len(self.components): 271 277 d = {'params':[peak, centre, fwhm], 272 'fixed':[peakfixed, cent erfixed, fwhmfixed]}278 'fixed':[peakfixed, centrefixed, fwhmfixed]} 273 279 self.set_parameters(d, component) 274 280 else: … … 604 610 asaplog.push("Fitting:") 605 611 for r in rows: 606 out = " Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (scan.getscan(r),scan.getbeam(r),scan.getif(r),scan.getpol(r), scan.getcycle(r)) 612 out = " Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (scan.getscan(r), 613 scan.getbeam(r), 614 scan.getif(r), 615 scan.getpol(r), 616 scan.getcycle(r)) 607 617 asaplog.push(out, False) 608 618 self.x = scan._getabcissa(r) 609 619 self.y = scan._getspectrum(r) 620 self.mask = mask_and(self.mask, scan._getmask(r)) 610 621 self.data = None 611 622 self.fit() 623 x = self.get_parameters() 612 624 fpar = self.get_parameters() 613 625 if plot:
Note: See TracChangeset
for help on using the changeset viewer.