Changeset 80d2872 in sasview
- Timestamp:
- Sep 11, 2009 7:05:01 PM (15 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:
- d9af1780
- Parents:
- 72a05d0
- Location:
- prview/perspectives/pr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/inversion_state.py
rb1f7ec6 r80d2872 20 20 CANSAS_NS = "cansas1d/1.0" 21 21 22 # Translation of names between stored and object data 22 23 ## List of P(r) inversion inputs 23 in_list= [["nterms", " self.nfunc"],24 ["d_max", " self.d_max"],25 ["alpha", " self.alpha"],26 ["slit_width", " self.width"],27 ["slit_height", " self.height"],28 ["qmin", " self.qmin"],29 ["qmax", " self.qmax"]]24 in_list= [["nterms", "nfunc"], 25 ["d_max", "d_max"], 26 ["alpha", "alpha"], 27 ["slit_width", "width"], 28 ["slit_height", "height"], 29 ["qmin", "qmin"], 30 ["qmax", "qmax"]] 30 31 31 32 ## List of P(r) inversion outputs 32 out_list= [["elapsed", " self.elapsed"],33 ["rg", " self.rg"],34 ["iq0", " self.iq0"],35 ["bck", " self.bck"],36 ["chi2", " self.chi2"],37 ["osc", " self.osc"],38 ["pos", " self.pos"],39 ["pos_err", " self.pos_err"],40 ["alpha_estimate", " self.alpha_estimate"],41 ["nterms_estimate", " self.nterms_estimate"]]33 out_list= [["elapsed", "elapsed"], 34 ["rg", "rg"], 35 ["iq0", "iq0"], 36 ["bck", "bck"], 37 ["chi2", "chi2"], 38 ["osc", "osc"], 39 ["pos", "pos"], 40 ["pos_err", "pos_err"], 41 ["alpha_estimate", "alpha_estimate"], 42 ["nterms_estimate", "nterms_estimate"]] 42 43 43 44 class InversionState(object): … … 181 182 for item in in_list: 182 183 element = newdoc.createElement(item[0]) 183 exec "element.appendChild(newdoc.createTextNode(str( %s)))" % item[1]184 exec "element.appendChild(newdoc.createTextNode(str(self.%s)))" % item[1] 184 185 inputs.appendChild(element) 185 186 … … 190 191 for item in out_list: 191 192 element = newdoc.createElement(item[0]) 192 exec "element.appendChild(newdoc.createTextNode(str( %s)))" % item[1]193 exec "element.appendChild(newdoc.createTextNode(str(self.%s)))" % item[1] 193 194 outputs.appendChild(element) 194 195 … … 243 244 if input_field is not None: 244 245 try: 245 exec ' %s = float(input_field.text.strip())' % item[1]246 exec 'self.%s = float(input_field.text.strip())' % item[1] 246 247 except: 247 exec ' %s = None' % item[1]248 exec 'self.%s = None' % item[1] 248 249 input_field = get_content('ns:estimate_bck', entry) 249 250 if input_field is not None: … … 261 262 if input_field is not None: 262 263 try: 263 exec ' %s = float(input_field.text.strip())' % item[1]264 exec 'self.%s = float(input_field.text.strip())' % item[1] 264 265 except: 265 exec ' %s = None' % item[1]266 exec 'self.%s = None' % item[1] 266 267 267 268 # Look for coefficients -
prview/perspectives/pr/pr.py
rd7412e0 r80d2872 23 23 from sans.pr.invertor import Invertor 24 24 from DataLoader.loader import Loader 25 import DataLoader 25 26 from sans.guiframe.data_loader import load_error 26 27 … … 594 595 #TODO: we might want to check that the units are consistent with I(q) 595 596 # before allowing this menu item 596 return [["Compute P(r)", "Compute P(r) from distribution", self._on_context_inversion]] 597 if issubclass(item.__class__, DataLoader.data_info.Data1D): 598 return [["Compute P(r)", "Compute P(r) from distribution", self._on_context_inversion]] 597 599 598 600 return []
Note: See TracChangeset
for help on using the changeset viewer.