Changeset 57a91fc in sasview for src/sas/sascalc/pr/invertor.py
- Timestamp:
- Nov 20, 2018 4:20:53 AM (5 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c30822c
- Parents:
- be7c981
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/pr/invertor.py
raed159f r57a91fc 6 6 FIXME: The way the Invertor interacts with its C component should be cleaned up 7 7 """ 8 from __future__ import division 8 9 9 10 import numpy as np … … 423 424 A[i][j] = (Fourier transformed base function for point j) 424 425 425 We the mchoose a number of r-points, n_r, to evaluate the second426 We then choose a number of r-points, n_r, to evaluate the second 426 427 derivative of P(r) at. This is used as our regularization term. 427 428 For a vector r of length n_r, the following n_r rows are set to :: … … 480 481 481 482 # Perform the inversion (least square fit) 482 c, chi2, _, _ = lstsq(a, b )483 c, chi2, _, _ = lstsq(a, b, rcond=-1) 483 484 # Sanity check 484 485 try: … … 503 504 try: 504 505 cov = np.linalg.pinv(inv_cov) 505 err = math.fabs(chi2 / float(npts - nfunc)) * cov506 except :506 err = math.fabs(chi2 / (npts - nfunc)) * cov 507 except Exception as exc: 507 508 # We were not able to estimate the errors 508 509 # Return an empty error matrix … … 548 549 try: 549 550 return estimator.num_terms(isquit_func) 550 except :551 except Exception as exc: 551 552 # If we fail, estimate alpha and return the default 552 553 # number of terms
Note: See TracChangeset
for help on using the changeset viewer.