Changeset 574adc7 in sasview for src/sas/sascalc/calculator/resolution_calculator.py
- Timestamp:
- Sep 22, 2017 4:01:32 PM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 34d7b35
- Parents:
- 9706d88
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/resolution_calculator.py
r7432acb r574adc7 4 4 instrumental parameters. 5 5 """ 6 from instrument import Sample 7 from instrument import Detector 8 from instrument import TOF as Neutron 9 from instrument import Aperture 10 # import math stuffs 11 from math import pi 12 from math import sqrt 6 import sys 7 from math import pi, sqrt 13 8 import math 9 import logging 10 14 11 import numpy as np 15 import sys 16 import logging 12 13 from .instrument import Sample 14 from .instrument import Detector 15 from .instrument import TOF as Neutron 16 from .instrument import Aperture 17 17 18 18 logger = logging.getLogger(__name__) … … 208 208 if wavelength == 0: 209 209 msg = "Can't compute the resolution: the wavelength is zero..." 210 raise RuntimeError , msg210 raise RuntimeError(msg) 211 211 return self.intensity 212 212 … … 379 379 if qx_min < self.qx_min: 380 380 self.qx_min = qx_min 381 #raise ValueError , msg381 #raise ValueError(msg) 382 382 if qx_max > self.qx_max: 383 383 self.qx_max = qx_max 384 #raise ValueError , msg384 #raise ValueError(msg) 385 385 if qy_min < self.qy_min: 386 386 self.qy_min = qy_min 387 #raise ValueError , msg387 #raise ValueError(msg) 388 388 if qy_max > self.qy_max: 389 389 self.qy_max = qy_max 390 #raise ValueError , msg390 #raise ValueError(msg) 391 391 if not full_cal: 392 392 return None … … 503 503 # otherwise 504 504 else: 505 raise ValueError , " Improper input..."505 raise ValueError(" Improper input...") 506 506 # get them squared 507 507 sigma = x_comp * x_comp … … 706 706 #self.set_wavelength(wavelength) 707 707 else: 708 raise 708 raise TypeError("invalid wavlength---should be list or float") 709 709 710 710 def set_wave_spread(self, wavelength_spread): … … 717 717 self.wave.set_wave_spread_list([wavelength_spread]) 718 718 else: 719 raise 719 raise TypeError("invalid wavelength spread---should be list or float") 720 720 721 721 def set_wavelength(self, wavelength): … … 766 766 """ 767 767 if len(size) < 1 or len(size) > 2: 768 raise RuntimeError , "The length of the size must be one or two."768 raise RuntimeError("The length of the size must be one or two.") 769 769 self.aperture.set_source_size(size) 770 770 … … 783 783 """ 784 784 if len(size) < 1 or len(size) > 2: 785 raise RuntimeError , "The length of the size must be one or two."785 raise RuntimeError("The length of the size must be one or two.") 786 786 self.aperture.set_sample_size(size) 787 787 … … 806 806 """ 807 807 if len(distance) < 1 or len(distance) > 2: 808 raise RuntimeError , "The length of the size must be one or two."808 raise RuntimeError("The length of the size must be one or two.") 809 809 self.aperture.set_sample_distance(distance) 810 810 … … 816 816 """ 817 817 if len(distance) < 1 or len(distance) > 2: 818 raise RuntimeError , "The length of the size must be one or two."818 raise RuntimeError("The length of the size must be one or two.") 819 819 self.sample.set_distance(distance) 820 820 … … 826 826 """ 827 827 if len(distance) < 1 or len(distance) > 2: 828 raise RuntimeError , "The length of the size must be one or two."828 raise RuntimeError("The length of the size must be one or two.") 829 829 self.detector.set_distance(distance) 830 830 … … 998 998 pix_y_size = detector_pix_size[1] 999 999 else: 1000 raise ValueError , " Input value format error..."1000 raise ValueError(" Input value format error...") 1001 1001 # Sample to detector distance = sample slit to detector 1002 1002 # minus sample offset
Note: See TracChangeset
for help on using the changeset viewer.