Changeset 580ee7a in sasview for calculator
- Timestamp:
- Aug 5, 2011 12:18:09 PM (13 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:
- 148f0dd
- Parents:
- 1bf1bc0
- Location:
- calculator
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
calculator/instrument.py
r19637b1 r580ee7a 17 17 18 18 _MIN = 0.0 19 _MAX = 30.019 _MAX = 50.0 20 20 _INTENSITY = 368428 21 21 _WAVE_LENGTH = 6.0 22 22 _WAVE_SPREAD = 0.125 23 23 _MASS = 1.67492729E-24 #[gr] 24 X_VAL = numpy.linspace(0, 30, 310) 25 _LAMBDA_ARRAY = [[0, 5, 10, 15, 20, 25, 30], [1, 1, 1, 1, 1, 1, 1]] 24 _LAMBDA_ARRAY = [[0, 1e+16],[_INTENSITY, _INTENSITY]] 26 25 27 26 class Aperture(object): … … 152 151 self.distance = distance 153 152 validate(distance[0]) 154 155 153 154 156 155 class Neutron(object): 157 156 """ … … 160 159 def __init__(self): 161 160 162 # intensity in counts/sec163 self.intensity = _INTENSITY164 161 # neutron mass in cgs unit 165 162 self.mass = _MASS 166 # wavelength spectrum 167 self.spectrum = [] 163 168 164 # wavelength 169 165 self.wavelength = _WAVE_LENGTH 170 166 # wavelength spread (FWHM) 171 167 self.wavelength_spread = _WAVE_SPREAD 172 # mean wavelength 173 self.mean = _WAVE_LENGTH 174 # wavelength = distribution after velocity selector 175 self.peak = [] 176 # std of of the spectrum 177 self.std = None 168 # wavelength spectrum 169 self.spectrum = self.get_default_spectrum() 170 # intensity in counts/sec 171 self.intensity = numpy.interp(self.wavelength, 172 self.spectrum[0], 173 self.spectrum[1], 174 0.0, 175 0.0) 178 176 # min max range of the spectrum 179 self.min = _MIN 180 self.max = _MAX 181 # x-range of the spectrum 182 self.x_val = X_VAL 183 # default distribution function 184 # ex., 'gaussian', or an array 185 self.func = _LAMBDA_ARRAY 177 self.min = min(self.spectrum[0]) 178 self.max = max(self.spectrum[0]) 179 # wavelength band 180 self.band = [self.min, self.max] 181 186 182 # default unit of the thickness 187 183 self.wavelength_unit = 'A' 188 184 185 def set_full_band(self): 186 """ 187 set band to default value 188 """ 189 self.band = self.spectrum 190 def set_spectrum(self, spectrum): 191 """ 192 Set spectrum 193 194 :param spectrum: numpy array 195 """ 196 self.spectrum = spectrum 197 self.setup_spectrum() 198 199 def setup_spectrum(self): 200 """ 201 To set the wavelength spectrum, and intensity, assumes 202 wavelength is already within the spectrum 203 """ 204 spectrum = self.spectrum 205 intensity = numpy.interp(self.wavelength, 206 spectrum[0], 207 spectrum[1], 208 0.0, 209 0.0) 210 self.set_intensity(intensity) 211 # min max range of the spectrum 212 self.min = min(self.spectrum[0]) 213 self.max = max(self.spectrum[0]) 214 # set default band 215 self.set_band([self.min,self.max]) 216 217 def set_band(self, band=[]): 218 """ 219 To set the wavelength band 220 221 :param band: array of [min, max] 222 """ 223 # check if the wavelength is in range 224 if min(band) < self.min or\ 225 max(band) > self.max: 226 raise 227 self.band = band 228 229 189 230 def set_intensity(self, intensity = 368428): 190 231 """ … … 198 239 Sets the wavelength 199 240 """ 241 # check if the wavelength is in range 242 if wavelength < min(self.band) or\ 243 wavelength > max(self.band): 244 raise 200 245 self.wavelength = wavelength 201 246 validate(wavelength) 247 self.intensity = numpy.interp(self.wavelength, 248 self.spectrum[0], 249 self.spectrum[1], 250 0.0, 251 0.0) 252 202 253 203 254 def set_mass(self, mass = _MASS): … … 245 296 """ 246 297 return self.wavelength 247 248 def _set_mean(self):249 """250 To get mean value of wavelength251 """252 mean_value = numpy.mean(self.peak[0]*253 self.peak[1])254 self.mean = mean_value255 256 257 def get_mean_peakvalue(self):258 """259 To get mean value of wavelength260 """261 mean_value = numpy.mean(self.peak[1])262 return mean_value263 298 264 299 def get_spectrum(self): … … 267 302 """ 268 303 return self.spectrum 304 def get_default_spectrum(self): 305 """ 306 get default spectrum 307 """ 308 return numpy.array(_LAMBDA_ARRAY) 309 def get_band(self): 310 """ 311 To get the wavelength band 312 """ 313 return self.band 269 314 270 315 def plot_spectrum(self): … … 275 320 try: 276 321 import matplotlib.pyplot as plt 277 plt.plot(self. x_val, self.spectrum, linewidth = 2, color = 'r')322 plt.plot(self.spectrum[0], self.spectrum[1], linewidth = 2, color = 'r') 278 323 plt.legend(['Spectrum'], loc = 'best') 279 324 plt.show() … … 281 326 raise RuntimeError, "Can't import matplotlib required to plot..." 282 327 283 def plot_peak(self): 284 """ 285 To plot the wavelength peak spactrum 286 : requirment: matplotlib.pyplot 287 """ 288 try: 289 min = self.mean * (1 - self.wavelength_spread) 290 max = self.mean * (1 + self.wavelength_spread) 291 x_val = numpy.linspace(min, max, 310) 292 import matplotlib.pyplot as plt 293 plt.plot(x_val, self.peak, linewidth = 2, color = 'r') 294 plt.legend(['peak'], loc = 'best') 295 plt.show() 296 except: 297 raise RuntimeError, "Can't import matplotlib required to plot..." 298 328 329 class TOF(Neutron): 330 """ 331 TOF: make list of wavelength and wave length spreads 332 """ 333 def __init__(self): 334 """ 335 Init 336 """ 337 Neutron.__init__(self) 338 #self.switch = switch 339 self.wavelength_list = [self.wavelength] 340 self.wavelength_spread_list = [self.wavelength_spread] 341 self.intensity_list = self.get_intensity_list() 342 343 def get_intensity_list(self): 344 """ 345 get list of the intensity wrt wavelength_list 346 """ 347 out = numpy.interp(self.wavelength_list, 348 self.spectrum[0], 349 self.spectrum[1], 350 0.0, 351 0.0) 352 return out 353 354 def get_wave_list(self): 355 """ 356 Get wavelength and wavelength_spread list 357 """ 358 return self.wavelength_list, self.wavelengthspread_list 359 360 def set_wave_list(self, wavelength=[]): 361 """ 362 Set wavelength list 363 364 :param wavelength: list of wavelengths 365 """ 366 self.wavelength_list = wavelength 367 368 def set_wave_spread_list(self, wavelength_spread=[]): 369 """ 370 Set wavelength_spread list 371 372 :param wavelength_spread: list of wavelength spreads 373 """ 374 self.wavelengthspread_list = wavelength_spread 375 376 299 377 def validate(value = None): 300 378 """ -
calculator/resolution_calculator.py
r9f5b505 r580ee7a 6 6 from instrument import Sample 7 7 from instrument import Detector 8 from instrument import Neutron8 from instrument import TOF as Neutron 9 9 from instrument import Aperture 10 10 # import math stuffs … … 36 36 # 2d image of the resolution 37 37 self.image = [] 38 self.image_lam = [] 38 39 # resolutions 39 40 # lamda in r-direction … … 55 56 self.detector_qy_min = -0.3 56 57 self.detector_qy_max = 0.3 58 # possible max qrange 59 self.qxmin_limit = 0 60 self.qxmax_limit = 0 61 self.qymin_limit = 0 62 self.qymax_limit = 0 63 # set sigmas 64 self.sigma_1 = 0 65 self.sigma_lamd = 0 66 self.sigma_2 = 0 67 self.sigma_1d = 0 57 68 # plots 58 69 self.plot = None … … 70 81 self.detector_size = [] 71 82 # get all the values of the instrumental parameters 83 #self.intensity = self.get_intensity() 84 #self.wavelength = self.get_wavelength() 85 #self.wavelength_spread = self.get_wavelength_spread() 72 86 self.get_all_instrument_params() 87 # max q range for all lambdas 88 self.qxrange = [] 89 self.qyrange = [] 73 90 74 91 def compute_and_plot(self, qx_value, qy_value, qx_min, qx_max, … … 79 96 : qy_value: y component of q 80 97 """ 81 # compute 2d resolution 82 _, _, sigma_1, sigma_2, sigma_r = \ 83 self.compute(qx_value, qy_value, coord) 84 # make image 85 image = self.get_image(qx_value, qy_value, sigma_1, sigma_2, sigma_r, 86 qx_min, qx_max, qy_min, qy_max, coord) 98 # make sure to update all the variables need. 99 # except lambda, dlambda, and intensity 100 self.get_all_instrument_params() 101 # wavelength etc. 102 lamda_list, dlamb_list = self.get_wave_list() 103 intens_list = []#self.get_intensity_list() 104 105 sig1_list = [] 106 sig2_list = [] 107 sigr_list = [] 108 sigma1d_list = [] 109 num_lamda = len(lamda_list) 110 for num in range(num_lamda): 111 lam = lamda_list[num] 112 # wavelength spread 113 dlam = dlamb_list[num] 114 intens = self.setup_tof(lam, dlam) 115 intens_list.append(intens) 116 # save q min max 117 #qx_min = 0 118 #qx_max = 0 119 #qy_min = 0 120 #qy_max = 0 121 # compute 2d resolution 122 _, _, sigma_1, sigma_2, sigma_r, sigma1d = \ 123 self.compute(lam, dlam, qx_value, qy_value, coord) 124 # make image 125 image = self.get_image(qx_value, qy_value, sigma_1, sigma_2, 126 sigma_r, qx_min, qx_max, qy_min, qy_max, 127 coord, False) 128 129 # Non tof mode to be speed up 130 #if num_lamda < 2: 131 # return self.plot_image(image) 132 133 if qx_min > self.qx_min: 134 qx_min = self.qx_min 135 if qx_max < self.qx_max: 136 qx_max = self.qx_max 137 if qy_min > self.qy_min: 138 qy_min = self.qy_min 139 if qy_max < self.qy_max: 140 qy_max = self.qy_max 141 142 # set max qranges 143 self.qxrange = [qx_min, qx_max] 144 self.qyrange = [qy_min, qy_max] 145 146 sig1_list.append(sigma_1) 147 sig2_list.append(sigma_2) 148 sigr_list.append(sigma_r) 149 sigma1d_list.append(sigma1d) 150 # redraw image in global 2d q-space. 151 self.image_lam = [] 152 total_intensity = 0 153 sigma_1 = 0 154 sigma_r = 0 155 sigma_2 = 0 156 sigma1d = 0 157 for ind in range(num_lamda): 158 lam = lamda_list[ind] 159 dlam = dlamb_list[ind] 160 intens = self.setup_tof(lam, dlam) 161 out = self.get_image(qx_value, qy_value, sig1_list[ind], 162 sig2_list[ind], sigr_list[ind], 163 qx_min, qx_max, qy_min, qy_max, coord) 164 # this is the case of q being outside the detector 165 #if numpy.all(out==0.0): 166 # continue 167 image = out 168 # set sigmas 169 sigma_1 += sig1_list[ind] * self.intensity 170 sigma_r += sigr_list[ind] * self.intensity 171 sigma_2 += sig2_list[ind] * self.intensity 172 sigma1d += sigma1d_list[ind] * self.intensity 173 total_intensity += self.intensity 174 if total_intensity != 0: 175 image_out = image / total_intensity 176 sigma_1 = sigma_1 / total_intensity 177 sigma_r = sigma_r / total_intensity 178 sigma_2 = sigma_2 / total_intensity 179 sigma1d = sigma1d / total_intensity 180 # set sigmas 181 self.sigma_1 = sigma_1 182 self.sigma_lamd = sigma_r 183 self.sigma_2 = sigma_2 184 self.sigma_1d = sigma1d 185 # rescale 186 max_im_val = 1 #image_out.max() 187 if max_im_val > 0: 188 image_out /= max_im_val 189 else: 190 image_out = image * 0.0 191 # Don't calculate sigmas nor set self.sigmas! 192 sigma_1 = 0 193 sigma_r = 0 194 sigma_2 = 0 195 sigma1d = 0 196 if len(self.image) > 0: 197 self.image += image_out 198 else: 199 self.image = image_out 200 87 201 # plot image 88 return self.plot_image(image) 89 90 def compute(self, qx_value, qy_value, coord = 'cartesian'): 202 return self.plot_image(self.image) 203 204 def setup_tof(self, wavelength, wavelength_spread): 205 """ 206 Setup all parameters in instrument 207 208 : param ind: index of lambda, etc 209 """ 210 211 # set wave.wavelength 212 self.set_wavelength(wavelength) 213 self.set_wavelength_spread(wavelength_spread) 214 self.intensity = self.wave.get_intensity() 215 216 if wavelength == 0: 217 msg = "Can't compute the resolution: the wavelength is zero..." 218 raise RuntimeError, msg 219 return self.intensity 220 221 def compute(self, wavelength, wavelength_spread, qx_value, qy_value, 222 coord = 'cartesian'): 91 223 """ 92 224 Compute the Q resoltuion in || and + direction of 2D … … 95 227 """ 96 228 coord = 'cartesian' 97 # make sure to update all the variables need. 98 self.get_all_instrument_params() 99 # wavelength 100 lamb = self.wavelength 101 102 if lamb == 0: 103 msg = "Can't compute the resolution: the wavelength is zero..." 104 raise RuntimeError, msg 105 # wavelength spread 106 lamb_spread = self.wavelength_spread 229 lamb = wavelength 230 lamb_spread = wavelength_spread 231 107 232 # Find polar values 108 233 qr_value, phi = self._get_polar_value(qx_value, qy_value) … … 136 261 lp_cor = (l_ssa * l_two) / (l_one + l_two) 137 262 # the radial distance to the pixel from the center of the detector 138 radius = math.tan(theta) *l_two263 radius = math.tan(theta) * l_two 139 264 #Lp = l_one*l_two/(l_one+l_two) 140 265 # default polar coordinate … … 161 286 phi, 'radial', 'on') 162 287 # for 1d 163 variance_1d_1 = sigma_1/2 + sigma_wave_1288 variance_1d_1 = sigma_1/2 + sigma_wave_1 164 289 # normalize 165 variance_1d_1 = knot *knot*variance_1d_1/12290 variance_1d_1 = knot * knot * variance_1d_1 / 12 166 291 167 292 # for 2d 168 293 #sigma_1 += sigma_wave_1 169 294 # normalize 170 sigma_1 = knot*sqrt(sigma_1 /12)171 sigma_r = knot*sqrt(sigma_wave_1 /12)295 sigma_1 = knot*sqrt(sigma_1 / 12) 296 sigma_r = knot*sqrt(sigma_wave_1 / 12) 172 297 # sigma in the phi/y direction 173 298 # for source apperture … … 192 317 variance_1d_2 = sigma_2/2 +sigma_wave_2 193 318 # normalize 194 variance_1d_2 = knot*knot*variance_1d_2 /12319 variance_1d_2 = knot*knot*variance_1d_2 / 12 195 320 196 321 # for 2d … … 198 323 #sigma_2 += sigma_wave_2 199 324 # normalize 200 sigma_2 = knot *sqrt(sigma_2/12)201 325 sigma_2 = knot * sqrt(sigma_2 / 12) 326 sigma1d = sqrt(variance_1d_1 + variance_1d_2) 202 327 # set sigmas 203 328 self.sigma_1 = sigma_1 204 329 self.sigma_lamd = sigma_r 205 330 self.sigma_2 = sigma_2 206 207 self.sigma_1d = sqrt(variance_1d_1 + variance_1d_2) 208 return qr_value, phi, sigma_1, sigma_2, sigma_r 331 self.sigma_1d = sigma1d 332 return qr_value, phi, sigma_1, sigma_2, sigma_r, sigma1d 333 334 def _within_detector_range(self,qx_value, qy_value): 335 """ 336 check if qvalues are within detector range 337 """ 338 # detector range 339 detector_qx_min = self.detector_qx_min 340 detector_qx_max = self.detector_qx_max 341 detector_qy_min = self.detector_qy_min 342 detector_qy_max = self.detector_qy_max 343 if self.qxmin_limit > detector_qx_min: 344 self.qxmin_limit = detector_qx_min 345 if self.qxmax_limit < detector_qx_max: 346 self.qxmax_limit = detector_qx_max 347 if self.qymin_limit > detector_qy_min: 348 self.qymin_limit = detector_qy_min 349 if self.qymax_limit < detector_qy_max: 350 self.qymax_limit = detector_qy_max 351 if qx_value < detector_qx_min or qx_value > detector_qx_max: 352 return False 353 if qy_value < detector_qy_min or qy_value > detector_qy_max: 354 return False 355 return True 209 356 210 357 def get_image(self, qx_value, qy_value, sigma_1, sigma_2, sigma_r, 211 qx_min, qx_max, qy_min, qy_max, coord = 'cartesian'): 358 qx_min, qx_max, qy_min, qy_max, 359 coord = 'cartesian', full_cal=True): 212 360 """ 213 361 Get the resolution in polar coordinate ready to plot … … 220 368 # Get qx_max and qy_max... 221 369 output = self._get_detector_qxqy_pixels() 222 # Set qx_value/qy_value min/max 223 #qx_min = self.qx_min 224 #qx_max = self.qx_max 225 #qy_min = self.qy_min 226 #qy_max = self.qy_max 370 227 371 qr_value, phi = self._get_polar_value(qx_value, qy_value) 228 372 … … 241 385 self.qy_max = qy_max 242 386 #raise ValueError, msg 243 387 if not full_cal: 388 return None 389 244 390 # Make an empty graph in the detector scale 245 391 dx_size = (self.qx_max - self.qx_min) / (1000 - 1) … … 269 415 image = self._gaussian2d(q_1, q_2, qc_1, qc_2, 270 416 sigma_1, sigma_2, sigma_r) 417 # out side of detector 418 if not self._within_detector_range(qx_value, qy_value): 419 image *= 0.0 420 self.intensity = 0.0 421 #return self.image 422 271 423 # Add it if there are more than one inputs. 272 if len(self.image ) > 0:273 self.image += image274 else: 275 self.image = image276 277 return self.image 424 if len(self.image_lam) > 0: 425 self.image_lam += image * self.intensity 426 else: 427 self.image_lam = image * self.intensity 428 429 return self.image_lam 278 430 279 431 def plot_image(self, image): … … 291 443 # Max value of the image 292 444 max = numpy.max(image) 445 qx_min, qx_max, qy_min, qy_max = self.get_detector_qrange() 446 293 447 # Image 294 448 im = plt.imshow(image, 295 extent = [ self.qx_min, self.qx_max, self.qy_min, self.qy_max])449 extent = [qx_min, qx_max, qy_min, qy_max]) 296 450 297 451 # bilinear interpolation to make it smoother … … 446 600 return self.wave.wavelength 447 601 602 def get_spectrum(self): 603 """ 604 Get spectrum 605 """ 606 return self.wave.spectrum 607 608 def get_default_spectrum(self): 609 """ 610 Get default_spectrum 611 """ 612 return self.wave.get_default_spectrum() 613 614 def get_spectrum(self): 615 """ 616 Get _spectrum 617 """ 618 return self.wave.get_spectrum() 619 448 620 def get_wavelength_spread(self): 449 621 """ … … 475 647 """ 476 648 return self.detector.pix_size 477 649 478 650 def get_detector_size(self): 479 651 """ … … 505 677 """ 506 678 self.wave.set_intensity(intensity) 507 679 680 def set_wave(self, wavelength): 681 """ 682 Set wavelength list or wavelength 683 """ 684 if wavelength.__class__.__name__ == 'list': 685 self.wave.set_wave_list(wavelength) 686 elif wavelength.__class__.__name__ == 'float': 687 self.wave.set_wave_list([wavelength]) 688 #self.set_wavelength(wavelength) 689 else: 690 raise 691 692 def set_wave_spread(self, wavelength_spread): 693 """ 694 Set wavelength spread or wavelength spread 695 """ 696 if wavelength_spread.__class__.__name__ == 'list': 697 self.wave.set_wave_spread_list(wavelength_spread) 698 elif wavelength_spread.__class__.__name__ == 'float': 699 self.wave.set_wave_spread_list([wavelength_spread]) 700 #self.set_wavelength_spread(wavelength_spread) 701 else: 702 raise 703 508 704 def set_wavelength(self, wavelength): 509 705 """ 510 706 Set wavelength 511 707 """ 708 self.wavelength = wavelength 512 709 self.wave.set_wavelength(wavelength) 513 710 711 def set_spectrum(self, spectrum): 712 """ 713 Set spectrum 714 """ 715 self.spectrum = spectrum 716 self.wave.set_spectrum(spectrum) 717 514 718 def set_wavelength_spread(self, wavelength_spread): 515 719 """ 516 720 Set wavelength spread 517 721 """ 722 self.wavelength_spread = wavelength_spread 518 723 self.wave.set_wavelength_spread(wavelength_spread) 519 724 725 def set_wave_list(self, wavelength_list, wavelengthspread_list): 726 """ 727 Set wavelength and its spread list 728 """ 729 self.wave.set_wave_list(wavelength_list, wavelengthspread_list) 730 731 def get_wave_list(self): 732 """ 733 Set wavelength spread 734 """ 735 return self.wave.get_wave_list() 736 737 def get_intensity_list(self): 738 """ 739 Set wavelength spread 740 """ 741 return self.wave.get_intensity_list() 742 520 743 def set_source_aperture_size(self, size): 521 744 """ … … 592 815 Get all instrumental parameters 593 816 """ 594 self.intensity = self.get_intensity()595 self.wavelength = self.get_wavelength()596 self.wavelength_spread = self.get_wavelength_spread()817 #self.intensity = self.get_intensity() 818 #self.wavelength = self.get_wavelength() 819 #self.wavelength_spread = self.get_wavelength_spread() 597 820 self.mass = self.get_neutron_mass() 821 self.spectrum = self.get_spectrum() 598 822 self.source_aperture_size = self.get_source_aperture_size() 599 823 self.sample_aperture_size = self.get_sample_aperture_size() … … 603 827 self.sample2sample_distance = self.get_sample2sample_distance() 604 828 self.sample2detector_distance = self.get_sample2detector_distance() 605 606 607 829 830 def get_detector_qrange(self): 831 """ 832 get max detector q ranges 833 834 : return: qx_min, qx_max, qy_min, qy_max tuple 835 """ 836 if len(self.qxrange) != 2 or len(self.qyrange) != 2: 837 return None 838 qx_min = self.qxrange[0] 839 qx_max = self.qxrange[1] 840 qy_min = self.qyrange[0] 841 qy_max = self.qyrange[1] 842 843 return qx_min, qx_max, qy_min, qy_max 844 608 845 def _rotate_z(self, x_value, y_value, theta= 0.0): 609 846 """ … … 744 981 745 982 # wavelength 746 wavelength = self.wave length983 wavelength = self.wave.wavelength 747 984 # Gavity correction 748 985 delta_y = self._get_beamcenter_drop() # in cm … … 839 1076 self.qx_max += self._get_qx(0.5 * pix_x_size, 840 1077 sample2detector_distance, wavelength) 1078 841 1079 # min and max values of detecter 842 1080 self.detector_qx_min = self.qx_min … … 844 1082 self.detector_qy_min = self.qy_min 845 1083 self.detector_qy_max = self.qy_max 1084 1085 846 1086 847 1087 # try to set it as a Data2D otherwise pass (not required for now) … … 916 1156 unit_cm = 1e-08 917 1157 # Velocity of neutron in horizontal direction (~ actual velocity) 918 velocity = _PLANK_H / (self.mass * self.wave length * unit_cm)1158 velocity = _PLANK_H / (self.mass * self.wave.wavelength * unit_cm) 919 1159 # Compute delta y 920 1160 delta_y = 0.5 -
calculator/test/utest_resolution_calculator.py
r7c372f8 r580ee7a 24 24 self.cal.set_sample2detector_distance([1500]) 25 25 self.cal.set_wavelength_spread(0.1) 26 qr, phi, sigma_1, sigma_2, _ = self.cal.compute(0, 0, coord = 'polar') 26 # all instr. params for cal 27 self.cal.get_all_instrument_params() 28 qr, phi, sigma_1, sigma_2, _, sigma_1d = self.cal.compute(15, 0.1, 29 0, 0, coord = 'polar') 27 30 sigma_1d = self.cal.sigma_1d 28 31
Note: See TracChangeset
for help on using the changeset viewer.