Changeset 235f514 in sasview for src/sas/sasgui/perspectives/pr/pr.py
- Timestamp:
- Apr 9, 2017 5:46:10 AM (8 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:
- ac07a3a
- Parents:
- 5b2b04d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
r959eb01 r235f514 291 291 """ 292 292 qtemp = pr.x 293 if not q ==None:293 if not q is None: 294 294 qtemp = q 295 295 … … 303 303 304 304 # Check for user min/max 305 if not pr.q_min ==None:305 if not pr.q_min is None: 306 306 minq = pr.q_min 307 if not pr.q_max ==None:307 if not pr.q_max is None: 308 308 maxq = pr.q_max 309 309 … … 393 393 394 394 for i in range(len(x)): 395 if cov2 ==None:395 if cov2 is None: 396 396 value = pr.pr(out, x[i]) 397 397 else: … … 412 412 dy = dy / pmax 413 413 414 if cov2 ==None:414 if cov2 is None: 415 415 new_plot = Data1D(x, y) 416 416 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM … … 487 487 scale = None 488 488 min_err = 0.0 489 if not path ==None:489 if not path is None: 490 490 input_f = open(path, 'r') 491 491 buff = input_f.read() … … 499 499 err = float(toks[2]) 500 500 else: 501 if scale ==None:501 if scale is None: 502 502 scale = 0.05 * math.sqrt(y) 503 503 #scale = 0.05/math.sqrt(y) … … 512 512 logger.error(sys.exc_value) 513 513 514 if not scale ==None:514 if not scale is None: 515 515 message = "The loaded file had no error bars, statistical errors are assumed." 516 516 wx.PostEvent(self.parent, StatusEvent(status=message)) … … 537 537 538 538 data_started = False 539 if not path ==None:539 if not path is None: 540 540 input_f = open(path, 'r') 541 541 buff = input_f.read() … … 550 550 err = float(toks[2]) 551 551 else: 552 if scale ==None:552 if scale is None: 553 553 scale = 0.05 * math.sqrt(y) 554 554 #scale = 0.05/math.sqrt(y) … … 565 565 data_started = True 566 566 567 if not scale ==None:567 if not scale is None: 568 568 message = "The loaded file had no error bars, statistical errors are assumed." 569 569 wx.PostEvent(self.parent, StatusEvent(status=message)) … … 761 761 self.elapsed = elapsed 762 762 self.control_panel.alpha_estimate = alpha 763 if not message ==None:763 if not message is None: 764 764 wx.PostEvent(self.parent, StatusEvent(status=str(message))) 765 765 self.perform_estimateNT() … … 779 779 self.control_panel.nterms_estimate = nterms 780 780 self.control_panel.alpha_estimate = alpha 781 if not message ==None:781 if not message is None: 782 782 wx.PostEvent(self.parent, StatusEvent(status=str(message))) 783 783 … … 858 858 859 859 # Make a plot of I(q) data 860 if self.pr.err ==None:860 if self.pr.err is None: 861 861 new_plot = Data1D(self.pr.x, self.pr.y) 862 862 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM … … 921 921 try: 922 922 pr = self._create_plot_pr() 923 if not pr ==None:923 if not pr is None: 924 924 self.pr = pr 925 925 self.perform_inversion() … … 944 944 try: 945 945 pr = self._create_plot_pr() 946 if not pr ==None:946 if not pr is None: 947 947 self.pr = pr 948 948 self.perform_estimate() … … 983 983 err = self.current_plottable.dy 984 984 all_zeros = True 985 if err ==None:985 if err is None: 986 986 err = np.zeros(len(pr.y)) 987 987 else: … … 995 995 for i in range(len(pr.y)): 996 996 # Scale the error so that we can fit over several decades of Q 997 if scale ==None:997 if scale is None: 998 998 scale = 0.05 * math.sqrt(pr.y[i]) 999 999 min_err = 0.01 * pr.y[i] … … 1024 1024 try: 1025 1025 pr = self._create_file_pr(data) 1026 if not pr ==None:1026 if not pr is None: 1027 1027 self.pr = pr 1028 1028 self.perform_inversion() … … 1090 1090 # If we have not errors, add statistical errors 1091 1091 if y is not None: 1092 if err ==None or np.all(err) == 0:1092 if err is None or np.all(err) == 0: 1093 1093 err = np.zeros(len(y)) 1094 1094 scale = None … … 1096 1096 for i in range(len(y)): 1097 1097 # Scale the error so that we can fit over several decades of Q 1098 if scale ==None:1098 if scale is None: 1099 1099 scale = 0.05 * math.sqrt(y[i]) 1100 1100 min_err = 0.01 * y[i]
Note: See TracChangeset
for help on using the changeset viewer.