Changeset 65883cf in sasview for DataLoader/extensions
- Timestamp:
- Sep 21, 2009 8:32:18 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:
- a0bc608
- Parents:
- a65ffcb
- Location:
- DataLoader/extensions
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/extensions/smearer.cpp
r5859862 r65883cf 230 230 * 231 231 */ 232 voidBaseSmearer :: get_bin_range(int i, double* q, double* q_min, double* q_max) {232 int BaseSmearer :: get_bin_range(int i, double* q, double* q_min, double* q_max) { 233 233 if (even_binning) { 234 234 double step = (qmax-qmin)/((double)nbins-1.0); … … 236 236 *q_min = *q - 0.5*step; 237 237 *q_max = *q + 0.5*step; 238 } else { 238 return 1; 239 } else if (i>=0 && i<nbins) { 239 240 *q = q_values[i]; 240 241 if (i==0) { … … 250 251 *q_max = *q + (q_values[i+1]-q_values[i])/2.0; 251 252 } 252 } 253 return 1; 254 } 255 return -1; 253 256 } 254 257 -
DataLoader/extensions/smearer.hh
r5859862 r65883cf 50 50 int get_nbins() { return nbins; } 51 51 // Get the q range of a particular bin 52 virtual voidget_bin_range(int, double*, double*, double*);52 virtual int get_bin_range(int, double*, double*, double*); 53 53 }; 54 54 -
DataLoader/extensions/smearer_module.cpp
r5859862 r65883cf 161 161 BaseSmearer* s = static_cast<BaseSmearer *>(temp); 162 162 163 if(s->get_nbins()<=0 || s->get_nbins()<=bin) { 164 return NULL; 165 } 166 163 167 double q, q_min, q_max; 164 s->get_bin_range(bin, &q, &q_min, &q_max); 165 168 if (s->get_bin_range(bin, &q, &q_min, &q_max)<0) { 169 return NULL; 170 } 166 171 return Py_BuildValue("d", q); 167 172 }
Note: See TracChangeset
for help on using the changeset viewer.