Changeset f7d39c9 in sasview
- Timestamp:
- Aug 22, 2018 5:00:00 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- b7f7d3f
- Parents:
- 0d8b2db
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
rb51c8fc rf7d39c9 542 542 # 'sophisticated' test to generate standalone plot for residuals 543 543 if 'esiduals' in plot.title: 544 self.plotData([(item, plot)] )544 self.plotData([(item, plot)], transform=False) 545 545 else: 546 546 new_plots.append((item, plot)) … … 583 583 #============================================ 584 584 585 def plotData(self, plots ):585 def plotData(self, plots, transform=True): 586 586 """ 587 587 Takes 1D/2D data and generates a single plot (1D) or multiple plots (2D) … … 594 594 new_plot = Plotter(self) 595 595 new_plot.item = item 596 new_plot.plot(plot_set )596 new_plot.plot(plot_set, transform=transform) 597 597 # active_plots may contain multiple charts 598 598 self.active_plots[plot_set.id] = new_plot -
src/sas/qtgui/Perspectives/Fitting/FittingOptions.py
raed0532 rf7d39c9 146 146 """ 147 147 widget = self.widgetFromOption(option) 148 new_value = widget.currentText() if isinstance(widget, QtWidgets.QComboBox) \ 149 else float(widget.text()) 150 self.config.values[self.current_fitter_id][option] = new_value 148 if widget is None: 149 return 150 try: 151 new_value = widget.currentText() if isinstance(widget, QtWidgets.QComboBox) \ 152 else float(widget.text()) 153 self.config.values[self.current_fitter_id][option] = new_value 154 except ValueError: 155 # Don't update bumps if widget has bad data 156 self.reject 151 157 152 158 # Update the BUMPS singleton -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r04972ea rf7d39c9 335 335 gn = reference_data.y 336 336 en = dy[index][0] 337 338 # x values 339 x_current = current_data.x 340 x_reference = reference_data.x 341 337 342 # build residuals 338 343 residuals = Data1D() … … 340 345 y = (fn - gn)/en 341 346 residuals.y = -y 347 elif len(fn) > len(gn): 348 residuals.y = (fn - gn[1:len(fn)])/en 342 349 else: 343 # TODO: fix case where applying new data from file on top of existing model data344 350 try: 345 y = (fn - gn[index][0]) / en 351 y = numpy.zeros(len(current_data.y)) 352 begin = 0 353 for i, x_value in enumerate(x_reference): 354 if x_value in x_current: 355 begin = i 356 break 357 end = len(x_reference) 358 endl = 0 359 for i, x_value in enumerate(list(x_reference)[::-1]): 360 if x_value in x_current: 361 endl = i 362 break 363 # make sure we have correct lengths 364 assert len(x_current) == len(x_reference[begin:end-endl]) 365 366 y = (fn - gn[begin:end-endl])/en 346 367 residuals.y = y 347 368 except ValueError:
Note: See TracChangeset
for help on using the changeset viewer.