Changeset 286c757 in sasview for src/sas/sasgui
- Timestamp:
- Oct 7, 2016 10:48:25 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.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 1b1a1c1
- Parents:
- 61780e3
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitting.py
rca4d985 r286c757 1740 1740 data_id=str(page_id) + " " + data.name + " unsmeared") 1741 1741 1742 self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 1743 data_description="Data unsmeared", 1744 data_id="Data " + data.name + " unsmeared", 1745 dy=unsmeared_error) 1742 if unsmeared_data is not None and unsmeared_error is not None: 1743 self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 1744 data_description="Data unsmeared", 1745 data_id="Data " + data.name + " unsmeared", 1746 dy=unsmeared_error) 1746 1747 1747 1748 if sq_model is not None and pq_model is not None: -
src/sas/sasgui/perspectives/fitting/model_thread.py
rca4d985 r286c757 179 179 unsmeared_output[first_bin:last_bin+1] = self.model.evalDistribution(mask) 180 180 output = self.smearer(unsmeared_output, first_bin, last_bin) 181 181 182 182 # Rescale data to unsmeared model 183 unsmeared_data = numpy.zeros((len(self.data.x))) 184 unsmeared_error = numpy.zeros((len(self.data.x))) 185 unsmeared_data[first_bin:last_bin+1] = self.data.y[first_bin:last_bin+1]\ 186 * unsmeared_output[first_bin:last_bin+1]\ 187 / output[first_bin:last_bin+1] 188 unsmeared_error[first_bin:last_bin+1] = self.data.dy[first_bin:last_bin+1]\ 189 * unsmeared_output[first_bin:last_bin+1]\ 190 / output[first_bin:last_bin+1] 191 unsmeared_output=unsmeared_output[index] 192 unsmeared_data=unsmeared_data[index] 193 unsmeared_error=unsmeared_error 183 # Check that the arrays are compatible. If we only have a model but no data, 184 # the length of data.y will be zero. 185 if isinstance(self.data.y, numpy.ndarray) and output.shape == self.data.y.shape: 186 unsmeared_data = numpy.zeros((len(self.data.x))) 187 unsmeared_error = numpy.zeros((len(self.data.x))) 188 unsmeared_data[first_bin:last_bin+1] = self.data.y[first_bin:last_bin+1]\ 189 * unsmeared_output[first_bin:last_bin+1]\ 190 / output[first_bin:last_bin+1] 191 unsmeared_error[first_bin:last_bin+1] = self.data.dy[first_bin:last_bin+1]\ 192 * unsmeared_output[first_bin:last_bin+1]\ 193 / output[first_bin:last_bin+1] 194 unsmeared_output=unsmeared_output[index] 195 unsmeared_data=unsmeared_data[index] 196 unsmeared_error=unsmeared_error 194 197 else: 195 198 output[index] = self.model.evalDistribution(self.data.x[index])
Note: See TracChangeset
for help on using the changeset viewer.