- Timestamp:
- Aug 3, 2017 4:27:25 AM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- cb62bd5
- Parents:
- 5c3c310
- Location:
- src/sas/sasgui/perspectives/pr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/inversion_panel.py
r5c3c310 ra0e6b1b 316 316 # Read the panel's parameters 317 317 flag, alpha, dmax, nfunc, qmin, \ 318 qmax, height, width = self._read_pars()318 qmax, height, width, bck = self._read_pars() 319 319 320 320 state.nfunc = nfunc … … 330 330 331 331 # Background evaluation checkbox 332 state.estimate_bck = self.bck_est_ctl.GetValue() 332 state.estimate_bck = self.has_bck 333 state.bck_value = bck 333 334 334 335 # Estimates … … 375 376 self.plot_data.SetValue(str(state.file)) 376 377 377 # Background evaluation checkbox 378 self.bck_man_ctl.SetValue(state.estimate_bck) 378 # Background value 379 self.bck_est_ctl.SetValue(state.estimate_bck) 380 self.bck_man_ctl.SetValue(not state.estimate_bck) 381 if not state.estimate_bck: 382 self.bck_input.Enable() 383 self.bck_input.SetValue(str(state.bck_value)) 384 self.has_bck = state.estimate_bck 385 self.bck_value = state.bck_value 379 386 380 387 # Estimates … … 456 463 size=(60, 20), value="0.0") 457 464 self.bck_input.Disable() 465 self.bck_input.Bind(wx.EVT_TEXT, self._read_pars) 458 466 background_units = wx.StaticText(self, -1, "[A^(-1)]", size=(55, 20)) 459 467 iy += 1 … … 808 816 scenes. 809 817 """ 810 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars()818 flag, alpha, dmax, nfunc, qmin, qmax, height, width, bck = self._read_pars() 811 819 812 820 # If the pars are valid, estimate alpha … … 834 842 height = 0 835 843 width = 0 844 background = 0 836 845 flag = True 837 846 # Read slit height … … 927 936 self.qmax_ctl.Refresh() 928 937 929 return flag, alpha, dmax, nfunc, qmin, qmax, height, width 938 # Read background 939 if not self.has_bck: 940 try: 941 bck_str = self.bck_input.GetValue() 942 if len(bck_str.strip()) == 0: 943 background = 0.0 944 else: 945 background = float(bck_str) 946 self.bck_input.SetBackgroundColour(wx.WHITE) 947 except ValueError: 948 background = 0.0 949 self.bck_input.SetBackgroundColour("pink") 950 self.bck_input.Refresh() 951 952 return flag, alpha, dmax, nfunc, qmin, qmax, height, width, background 930 953 931 954 def _on_explore(self, evt): … … 952 975 # Push it to the manager 953 976 954 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars()977 flag, alpha, dmax, nfunc, qmin, qmax, height, width, bck = self._read_pars() 955 978 956 979 if flag: -
src/sas/sasgui/perspectives/pr/inversion_state.py
r7432acb ra0e6b1b 36 36 ["qmin", "qmin"], 37 37 ["qmax", "qmax"], 38 ["estimate_bck", "estimate_bck"]] 38 ["estimate_bck", "estimate_bck"], 39 ["bck_value", "bck_value"]] 39 40 40 41 ## List of P(r) inversion outputs … … 62 63 self.estimate_bck = False 63 64 self.timestamp = time.time() 65 self.bck_value = 0.0 64 66 65 67 # Inversion parameters … … 109 111 state += "Timestamp: %s\n" % self.timestamp 110 112 state += "Estimate bck: %s\n" % str(self.estimate_bck) 113 state += "Bck Value: %s\n" % str(self.bck_value) 111 114 state += "No. terms: %s\n" % str(self.nfunc) 112 115 state += "D_max: %s\n" % str(self.d_max) … … 296 299 self.coefficients.append(float(c)) 297 300 except: 298 # Bad data, skip. We will count the number of 299 # coefficients at the very end and deal with 301 # Bad data, skip. We will count the number of 302 # coefficients at the very end and deal with 300 303 # inconsistencies then. 301 304 pass … … 329 332 cov_row.append(float(c)) 330 333 except: 331 # Bad data, skip. We will count the number of 332 # coefficients at the very end and deal with 334 # Bad data, skip. We will count the number of 335 # coefficients at the very end and deal with 333 336 # inconsistencies then. 334 337 pass … … 461 464 tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 462 465 # Check the format version number 463 # Specifying the namespace will take care of the file 464 #format version 466 # Specifying the namespace will take care of the file 467 #format version 465 468 root = tree.getroot() 466 469
Note: See TracChangeset
for help on using the changeset viewer.