Changeset 5a8cdbb in sasview for src/sas/sascalc/data_util
- Timestamp:
- Aug 1, 2017 12:02:35 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 511ccb2d
- Parents:
- 248ff73 (diff), bc04647 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sascalc/data_util
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/calcthread.py
r7432acb ra1b8fee 4 4 # \brief Abstract class for defining calculation threads. 5 5 # 6 from __future__ import print_function 6 7 7 8 import thread … … 295 296 """ 296 297 def __init__(self, n=20000): 297 print thread.get_ident()298 print(thread.get_ident()) 298 299 self.starttime = clock() 299 300 self.done = False … … 307 308 self.work2.queue(n) 308 309 self.work3.queue(n) 309 print "Expect updates from Main every second and from thread every 2.5 seconds"310 print ""310 print("Expect updates from Main every second and from thread every 2.5 seconds") 311 print("") 311 312 self.work.ready(.5) 312 313 while not self.done: 313 314 sleep(1) 314 print 315 clock() - self.starttime) 315 print("Main thread %d at %.2f" % (thread.get_ident(), 316 clock() - self.starttime)) 316 317 317 318 def update(self, i=0): 318 print 319 clock() - self.starttime) 319 print("Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 320 clock() - self.starttime)) 320 321 self.work.ready(2.5) 321 322 322 323 def complete(self, total=0.0): 323 print 324 print("Complete total=%g from thread %d at %.2f" % (total, 324 325 thread.get_ident(), 325 clock() - self.starttime) 326 clock() - self.starttime)) 326 327 self.done = True -
src/sas/sascalc/data_util/formatnum.py
r9a5097c ra1b8fee 37 37 formatter.compact flag. 38 38 """ 39 from __future__ import division 39 from __future__ import division, print_function 40 40 41 41 import math -
src/sas/sascalc/data_util/nxsunit.py
rb699768 r8e9536f 136 136 sld = { '10^-6 Angstrom^-2': 1e-6, 'Angstrom^-2': 1 } 137 137 Q = { 'invA': 1, 'invAng': 1, 'invAngstroms': 1, '1/A': 1, 138 '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8, 138 '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8, '1/m': 1e-10, 139 139 'nm^-1': 0.1, '1/nm': 0.1, 'n_m^-1': 0.1 } 140 140 … … 195 195 _check(1,Converter('n_m^-1')(10,'invA')) # 10 nm^-1 = 1 inv Angstroms 196 196 _check(2,Converter('mm')(2000,'m')) # 2000 mm -> 2 m 197 _check(2.011e10,Converter('1/A')(2.011,"1/m")) # 2.011 1/A -> 2.011 * 10^10 1/m 197 198 _check(0.003,Converter('microseconds')(3,units='ms')) # 3 us -> 0.003 ms 198 199 _check(45,Converter('nanokelvin')(45)) # 45 nK -> 45 nK -
src/sas/sascalc/data_util/qsmearing.py
r235f514 r8938502 65 65 raise ValueError('one or more of your dx values are negative, please check the data file!') 66 66 67 if _found_sesans == True: 68 #Pre-compute the Hankel matrix (H) 69 qmax, qunits = data.sample.zacceptance 67 if _found_sesans: 68 # Pre-compute the Hankel matrix (H) 70 69 SElength = Converter(data._xunit)(data.x, "A") 71 zaccept = Converter(qunits)(qmax, "1/A"), 70 71 theta_max = Converter("radians")(data.sample.zacceptance)[0] 72 q_max = 2 * np.pi / np.max(data.source.wavelength) * np.sin(theta_max) 73 zaccept = Converter("1/A")(q_max, "1/" + data.source.wavelength_unit), 74 72 75 Rmax = 10000000 73 hankel = SesansTransform(data.x, SElength, zaccept, Rmax) 76 hankel = SesansTransform(data.x, SElength, 77 data.source.wavelength, 78 zaccept, Rmax) 74 79 # Then return the actual transform, as if it were a smearing function 75 80 return PySmear(hankel, model, offset=0) -
src/sas/sascalc/data_util/registry.py
r3ece5dd r5a8cdbb 5 5 and registers the built-in file extensions. 6 6 """ 7 from __future__ import print_function 7 8 8 9 from sas.sascalc.dataloader.loader_exceptions import NoKnownLoaderException
Note: See TracChangeset
for help on using the changeset viewer.