- Timestamp:
- Nov 20, 2018 6:20:53 AM (6 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
- Location:
- src/sas/sascalc/pr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/pr/fit/BumpsFitting.py
r9a5097c r57a91fc 2 2 BumpsFitting module runs the bumps optimizer. 3 3 """ 4 from __future__ import division 5 4 6 import os 5 7 from datetime import timedelta, datetime … … 34 36 class Progress(object): 35 37 def __init__(self, history, max_step, pars, dof): 36 remaining_time = int(history.time[0]*( float(max_step)/history.step[0]-1))38 remaining_time = int(history.time[0]*(max_step/history.step[0]-1)) 37 39 # Depending on the time remaining, either display the expected 38 40 # time of completion, or the amount of time remaining. Use precision -
src/sas/sascalc/pr/fit/Loader.py
r574adc7 r57a91fc 1 """ 2 class Loader to load any kind of file 3 """ 4 1 5 from __future__ import print_function 2 6 3 # class Loader to load any king of file4 #import wx5 #import string6 7 import numpy as np 7 8 -
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 -
src/sas/sascalc/pr/num_term.py
rb8080e1 r57a91fc 1 from __future__ import print_function 1 from __future__ import print_function, division 2 2 3 3 import math … … 51 51 osc = self.sort_osc() 52 52 dv = len(osc) 53 med = float(dv) / 2.053 med = 0.5*dv 54 54 odd = self.is_odd(dv) 55 55 medi = 0 … … 140 140 nts = self.compare_err() 141 141 div = len(nts) 142 tem = float(div) / 2.0142 tem = 0.5*div 143 143 if self.is_odd(div): 144 144 nt = nts[int(tem)]
Note: See TracChangeset
for help on using the changeset viewer.