Changeset ca10d8e in sasview for DataLoader
- Timestamp:
- Feb 11, 2009 4:12:47 PM (16 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:
- acb37d9
- Parents:
- 1309e919
- Location:
- DataLoader
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/data_info.py
r2e9b98c rca10d8e 154 154 ## Slit length of the instrument for this detector.[float] [mm] 155 155 slit_length = None 156 #slit_length_unit = '1/A' 156 157 slit_length_unit = 'mm' 157 158 … … 541 542 1D data class 542 543 """ 543 x_unit = ' A^{-1}'544 y_unit = ' cm^{-1}'544 x_unit = '1/A' 545 y_unit = '1/cm' 545 546 546 547 def __init__(self, x, y, dx=None, dy=None): … … 660 661 """ 661 662 ## Units for Q-values 662 Q_unit = ' A^{-1}'663 Q_unit = '1/A' 663 664 664 665 ## Units for I(Q) values 665 I_unit = ' cm^{-1}'666 I_unit = '1/cm' 666 667 667 668 ## Vector of Q-values at the center of each bin in x -
DataLoader/manipulations.py
r923d926 rca10d8e 231 231 err_y = 0.0 232 232 y_counts = 0.0 233 233 sign=1 234 234 for i in range(numpy.size(data2D.data,1)): 235 235 # Min and max x-value for the pixel 236 236 minx = pixel_width_x*(i - center_x) 237 237 maxx = pixel_width_x*(i+1.0 - center_x) 238 239 qxmin = get_q(minx, 0.0, det_dist, wavelength) 240 qxmax = get_q(maxx, 0.0, det_dist, wavelength) 238 if minx>=0: 239 sign=1 240 else: 241 sign=-1 242 qxmin = sign*get_q(minx, 0.0, det_dist, wavelength) 243 if maxx>=0: 244 sign=1 245 else: 246 sign=-1 247 qxmax = sign*get_q(maxx, 0.0, det_dist, wavelength) 241 248 242 249 # Get the count fraction in x for that pixel … … 249 256 miny = pixel_width_y*(j - center_y) 250 257 maxy = pixel_width_y*(j+1.0 - center_y) 251 252 qymin = get_q(0.0, miny, det_dist, wavelength) 253 qymax = get_q(0.0, maxy, det_dist, wavelength) 258 if miny>=0: 259 sign=1 260 else: 261 sign=-1 262 263 qymin = sign*get_q(0.0, miny, det_dist, wavelength) 264 if maxy>=0: 265 sign=1 266 else: 267 sign=-1 268 269 qymax = sign*get_q(0.0, maxy, det_dist, wavelength) 254 270 255 271 # Get the count fraction in x for that pixel -
DataLoader/readers/IgorReader.py
rb568ec1b rca10d8e 79 79 data_conv_i = None 80 80 81 if has_converter == True and output.Q_unit != ' A^{-1}':82 data_conv_q = Converter(' A^{-1}')81 if has_converter == True and output.Q_unit != '1/A': 82 data_conv_q = Converter('1/A') 83 83 # Test it 84 84 data_conv_q(1.0, output.Q_unit) 85 85 86 if has_converter == True and output.I_unit != ' cm^{-1}':87 data_conv_i = Converter(' cm^{-1}')86 if has_converter == True and output.I_unit != '1/cm': 87 data_conv_i = Converter('1/cm') 88 88 # Test it 89 89 data_conv_i(1.0, output.I_unit) … … 191 191 qx = 4.0*math.pi/wavelength * math.sin(theta/2.0) 192 192 193 if has_converter == True and output.Q_unit != ' A^{-1}':193 if has_converter == True and output.Q_unit != '1/A': 194 194 qx = data_conv_q(qx, units=output.Q_unit) 195 195 … … 202 202 qy = 4.0*math.pi/wavelength * math.sin(theta/2.0) 203 203 204 if has_converter == True and output.Q_unit != ' A^{-1}':204 if has_converter == True and output.Q_unit != '1/A': 205 205 qy = data_conv_q(qy, units=output.Q_unit) 206 206 … … 258 258 ymin =ymin-ystep/2.0 259 259 ymax =ymax+ystep/2.0 260 if has_converter == True and output.Q_unit != ' A^{-1}':260 if has_converter == True and output.Q_unit != '1/A': 261 261 xmin = data_conv_q(xmin, units=output.Q_unit) 262 262 xmax = data_conv_q(xmax, units=output.Q_unit) -
DataLoader/readers/abs_reader.py
rd06ba5e rca10d8e 62 62 data_conv_i = None 63 63 64 if has_converter == True and output.x_unit != ' A^{-1}':65 data_conv_q = Converter(' A^{-1}')64 if has_converter == True and output.x_unit != '1/A': 65 data_conv_q = Converter('1/A') 66 66 # Test it 67 67 data_conv_q(1.0, output.x_unit) 68 68 69 if has_converter == True and output.y_unit != ' cm^{-1}':70 data_conv_i = Converter(' cm^{-1}')69 if has_converter == True and output.y_unit != '1/cm': 70 data_conv_i = Converter('1/cm') 71 71 # Test it 72 72 data_conv_i(1.0, output.y_unit) -
DataLoader/readers/ascii_reader.py
rb92c1ad0 rca10d8e 58 58 data_conv_i = None 59 59 60 if has_converter == True and output.x_unit != ' A^{-1}':61 data_conv_q = Converter(' A^{-1}')60 if has_converter == True and output.x_unit != '1/A': 61 data_conv_q = Converter('1/A') 62 62 # Test it 63 63 data_conv_q(1.0, output.x_unit) 64 64 65 if has_converter == True and output.y_unit != ' cm^{-1}':66 data_conv_i = Converter(' cm^{-1}')65 if has_converter == True and output.y_unit != '1/cm': 66 data_conv_i = Converter('1/cm') 67 67 # Test it 68 68 data_conv_i(1.0, output.y_unit) -
DataLoader/readers/cansas_reader.py
r2bc8d4a rca10d8e 569 569 data_conv_i = None 570 570 571 if has_converter == True and data_info.x_unit != ' A^{-1}':572 data_conv_q = Converter(' A^{-1}')571 if has_converter == True and data_info.x_unit != '1/A': 572 data_conv_q = Converter('1/A') 573 573 # Test it 574 574 data_conv_q(1.0, output.Q_unit) 575 575 576 if has_converter == True and data_info.y_unit != ' cm^{-1}':577 data_conv_i = Converter(' cm^{-1}')576 if has_converter == True and data_info.y_unit != '1/cm': 577 data_conv_i = Converter('1/cm') 578 578 # Test it 579 579 data_conv_i(1.0, output.I_unit) -
DataLoader/readers/danse_reader.py
reeaabb1 rca10d8e 87 87 data_conv_i = None 88 88 89 if has_converter == True and output.Q_unit != ' A^{-1}':90 data_conv_q = Converter(' A^{-1}')89 if has_converter == True and output.Q_unit != '1/A': 90 data_conv_q = Converter('1/A') 91 91 # Test it 92 92 data_conv_q(1.0, output.Q_unit) 93 93 94 if has_converter == True and output.I_unit != ' cm^{-1}':95 data_conv_i = Converter(' cm^{-1}')94 if has_converter == True and output.I_unit != '1/cm': 95 data_conv_i = Converter('1/cm') 96 96 # Test it 97 97 data_conv_i(1.0, output.I_unit) … … 161 161 qx = 4.0*math.pi/wavelength * math.sin(theta/2.0) 162 162 163 if has_converter == True and output.Q_unit != ' A^{-1}':163 if has_converter == True and output.Q_unit != '1/A': 164 164 qx = data_conv_q(qx, units=output.Q_unit) 165 165 166 166 x_vals.append(qx) 167 if xmin==None or qx< =xmin:167 if xmin==None or qx<xmin: 168 168 xmin = qx 169 if xmax==None or qx> =xmax:169 if xmax==None or qx>xmax: 170 170 xmax = qx 171 171 … … 176 176 qy = 4.0*math.pi/wavelength * math.sin(theta/2.0) 177 177 178 if has_converter == True and output.Q_unit != ' A^{-1}':178 if has_converter == True and output.Q_unit != '1/A': 179 179 qy = data_conv_q(qy, units=output.Q_unit) 180 180 … … 242 242 ymax =ymax+stepq/2.0 243 243 244 if has_converter == True and output.Q_unit != ' A^{-1}':244 if has_converter == True and output.Q_unit != '1/A': 245 245 xmin = data_conv_q(xmin, units=output.Q_unit) 246 246 xmax = data_conv_q(xmax, units=output.Q_unit) -
DataLoader/readers/hfir1d_reader.py
rc5f0337 rca10d8e 58 58 data_conv_i = None 59 59 60 if has_converter == True and output.x_unit != ' A^{-1}':61 data_conv_q = Converter(' A^{-1}')60 if has_converter == True and output.x_unit != '1/A': 61 data_conv_q = Converter('1/A') 62 62 # Test it 63 63 data_conv_q(1.0, output.x_unit) 64 64 65 if has_converter == True and output.y_unit != ' cm^{-1}':66 data_conv_i = Converter(' cm^{-1}')65 if has_converter == True and output.y_unit != '1/cm': 66 data_conv_i = Converter('1/cm') 67 67 # Test it 68 68 data_conv_i(1.0, output.y_unit)
Note: See TracChangeset
for help on using the changeset viewer.