Changeset f168d02 in sasview for pr_inversion/invertor.py
- Timestamp:
- Jul 1, 2008 2:56:32 PM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 2a92852
- Parents:
- a17ffdf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pr_inversion/invertor.py
re96a852 rf168d02 73 73 suggested_alpha = 0 74 74 ## Last number of base functions used 75 nfunc = 075 nfunc = 10 76 76 ## Last output values 77 77 out = None … … 191 191 invertor.err = self.err 192 192 invertor.has_bck = self.has_bck 193 invertor.slit_height = self.slit_height 194 invertor.slit_width = self.slit_width 193 195 194 196 return invertor … … 391 393 392 394 # Construct the a matrix and b vector that represent the problem 395 t_0 = time.time() 393 396 self._get_matrix(nfunc, nq, a, b) 397 #print "elasped: ", time.time()-t_0 394 398 395 399 # Perform the inversion (least square fit) … … 531 535 from num_term import Num_terms 532 536 estimator = Num_terms(self.clone()) 533 534 return estimator.num_terms(isquit_func) 537 try: 538 return estimator.num_terms(isquit_func) 539 except: 540 # If we fail, estimate alpha and return the default 541 # number of terms 542 best_alpha, message, elapsed =self.estimate_alpha(self.nfunc) 543 return self.nfunc, best_alpha, "Could not estimate number of terms" 535 544 536 545 def estimate_alpha(self, nfunc): … … 572 581 # just return the estimate 573 582 if npeaks>1: 574 message = "Your P(r) is not smooth, please check your inversion parameters" 583 #message = "Your P(r) is not smooth, please check your inversion parameters" 584 message = None 575 585 return pr.suggested_alpha, message, elapsed 576 586 else:
Note: See TracChangeset
for help on using the changeset viewer.