Changeset 6060a86 in sasview
- Timestamp:
- Oct 26, 2017 5:11:00 AM (7 years ago)
- Branches:
- 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
- Children:
- 3e20577
- Parents:
- 60bf0db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/PrInversion/dmax.py
r60bf0db r6060a86 10 10 import sys 11 11 import os 12 import logging 13 import numpy as np 12 14 from PyQt4 import QtCore 13 15 from PyQt4 import QtGui … … 25 27 # from InvariantDetails import DetailsDialog 26 28 # from InvariantUtils import WIDGETS 29 30 logger = logging.getLogger(__name__) 27 31 28 32 def enum(*sequential, **named): … … 56 60 # Let's choose the Standard Item Model. 57 61 self.model = QtGui.QStandardItemModel(self) 62 self.mapper = None 58 63 59 64 # # Connect buttons to slots. … … 94 99 95 100 def modelChanged(self, item): 96 pass 101 if not self.mapper: 102 return 103 104 iq0 = [] 105 rg = [] 106 pos = [] 107 pos_err = [] 108 osc = [] 109 xs = np.linspace(float(self.model.item(W.DMIN).text()), 110 float(self.model.item(W.DMAX).text()), 111 float(self.model.item(W.NPTS).text())) 112 113 for x in xs: 114 self.pr_state.d_max = x 115 try: 116 out, cov = self.pr_state.invert(self.nfunc) 117 118 iq0.append(self.pr_state.iq0(out)) 119 rg.append(self.pr_state.rg(out)) 120 pos.append(self.pr_state.get_positive(out)) 121 pos_err.append(self.pr_state.get_pos_err(out, cov)) 122 osc.append(self.pr_state.oscillations(out)) 123 except: 124 # This inversion failed, skip this D_max value 125 msg = "ExploreDialog: inversion failed " 126 msg += "for D_max=%s\n%s" % (str(x), sys.exc_value) 127 print(msg) 128 # logger.error(msg) 129 self.plot.plot(data=Data1D(xs, rg), marker="-") 97 130 98 131
Note: See TracChangeset
for help on using the changeset viewer.