Changeset 1612 for branches/alma/python/asapfitter.py
- Timestamp:
- 08/05/09 17:48:43 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/asapfitter.py
r1603 r1612 4 4 from asap import _n_bools 5 5 from asap import mask_and 6 from taskinit import * 6 7 7 8 class fitter: … … 59 60 msg = "Please give a correct scan" 60 61 if rcParams['verbose']: 61 print msg 62 #print msg 63 casalog.post( msg, 'WARN' ) 62 64 return 63 65 else: … … 105 107 msg = "Invalid function type." 106 108 if rcParams['verbose']: 107 print msg 109 #print msg 110 casalog.post( msg, 'WARN' ) 108 111 return 109 112 else: … … 134 137 msg = "Fitter not yet initialised. Please set data & fit function" 135 138 if rcParams['verbose']: 136 print msg 139 #print msg 140 casalog.post( msg, 'WARN' ) 137 141 return 138 142 else: … … 170 174 except RuntimeError, msg: 171 175 if rcParams['verbose']: 172 print msg 176 #print msg 177 casalog.post( msg, 'WARN' ) 173 178 else: 174 179 raise … … 228 233 msg = "Please specify a fitting function first." 229 234 if rcParams['verbose']: 230 print msg 235 #print msg 236 casalog.post( msg, 'WARN' ) 231 237 return 232 238 else: … … 270 276 msg = "Function only operates on Gaussian components." 271 277 if rcParams['verbose']: 272 print msg 278 #print msg 279 casalog.post( msg, 'WARN' ) 273 280 return 274 281 else: … … 281 288 msg = "Please select a valid component." 282 289 if rcParams['verbose']: 283 print msg 290 #print msg 291 casalog.post( msg, 'WARN' ) 284 292 return 285 293 else: … … 322 330 msg = "Not yet fitted." 323 331 if rcParams['verbose']: 324 print msg 332 #print msg 333 casalog.post( msg, 'WARN' ) 325 334 return 326 335 else: … … 345 354 msg = "Not yet fitted." 346 355 if rcParams['verbose']: 347 print msg 356 #print msg 357 casalog.post( msg, 'WARN' ) 348 358 return 349 359 else: … … 375 385 fpars = self._format_pars(cpars, cfixed, errors and cerrs, area) 376 386 if rcParams['verbose']: 377 print fpars 387 #print fpars 388 casalog.post( fpars ) 378 389 return {'params':cpars, 'fixed':cfixed, 'formatted': fpars, 379 390 'errors':cerrs} … … 416 427 fixed = self.fitter.getfixedparameters() 417 428 if rcParams['verbose']: 418 print self._format_pars(pars,fixed,None) 429 #print self._format_pars(pars,fixed,None) 430 casalog.post( self._format_pars(pars,fixed,None) ) 419 431 return pars 420 432 … … 426 438 msg = "Not yet fitted." 427 439 if rcParams['verbose']: 428 print msg 440 #print msg 441 casalog.post( msg, 'WARN' ) 429 442 return 430 443 else: … … 439 452 msg = "Not yet fitted." 440 453 if rcParams['verbose']: 441 print msg 454 #print msg 455 casalog.post( msg, 'WARN' ) 442 456 return 443 457 else: … … 445 459 ch2 = self.fitter.getchi2() 446 460 if rcParams['verbose']: 447 print 'Chi^2 = %3.3f' % (ch2) 461 #print 'Chi^2 = %3.3f' % (ch2) 462 casalog.post( 'Chi^2 = %3.3f' % (ch2) ) 448 463 return ch2 449 464 … … 455 470 msg = "Not yet fitted." 456 471 if rcParams['verbose']: 457 print msg 472 #print msg 473 casalog.post( msg, 'WARN' ) 458 474 return 459 475 else: … … 468 484 msg = "Not yet fitted." 469 485 if rcParams['verbose']: 470 print msg 486 #print msg 487 casalog.post( msg, 'WARN' ) 471 488 return 472 489 else: … … 476 493 msg = "Not a scantable" 477 494 if rcParams['verbose']: 478 print msg 495 #print msg 496 casalog.post( msg, 'WARN' ) 479 497 return 480 498 else: … … 594 612 msg = "Data is not a scantable" 595 613 if rcParams['verbose']: 596 print msg 614 #print msg 615 casalog.post( msg, 'WARN' ) 597 616 return 598 617 else:
Note: See TracChangeset
for help on using the changeset viewer.