Changeset 14e9eb3 in sasview for calculator/slit_length_calculator.py
- Timestamp:
- May 28, 2010 1:24:47 PM (14 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:
- 25a2ee3
- Parents:
- 2882fb5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculator/slit_length_calculator.py
r0bf2c6f r14e9eb3 1 1 """ 2 This software was developed by the University of Tennessee as part of the 3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 4 project funded by the US National Science Foundation. 5 6 See the license text in license.txt 7 8 copyright 2008, 2009, University of Tennessee 2 This module is a small tool to allow user to quickly 3 determine the slit length value of data. 9 4 """ 10 5 from numpy import * … … 12 7 class SlitlengthCalculator(object): 13 8 """ 14 compute slit length from SAXSess beam profile (1st col. Q , 2nd col. I , and 3rd col. dI.: don't need the 3rd)15 @object: data where are data.y and data.x9 compute slit length from SAXSess beam profile (1st col. Q , 2nd col. I , 10 and 3rd col. dI.: don't need the 3rd) 16 11 """ 17 12 def __init__(self): … … 31 26 def set_data(self, x=None, y=None): 32 27 """ 33 34 @ Param x, y: x array and y array28 set data 29 :param x, y: x array and y array 35 30 """ 36 31 self.x = x 37 32 self.y = y 38 33 39 40 34 def calculate_slit_length(self): 41 35 """ 42 Calculate slit length using 10 max point 43 ToDo: Near future, it should be re-factored in better method. 36 Calculate slit length. 44 37 """ 45 38 # None data do nothing 46 39 if self.y == None or self.x == None: 47 40 return 48 49 41 # set local variable 50 42 y = self.y … … 96 88 # set slit_length 97 89 self.slit_length = slit_length 98 99 def get_slit_length(self):100 """101 Calculate and return the slit length102 """103 self.calculate_slit_length()104 90 return self.slit_length 105 91 106 92 def get_slit_length_unit(self): 107 93 """ 108 return the slit length unit94 return the slit length unit. 109 95 """ 110 96 return self.slit_length_unit
Note: See TracChangeset
for help on using the changeset viewer.