Changeset b297ba9 in sasmodels for sasmodels/multiscat.py
- Timestamp:
- Mar 20, 2019 7:03:50 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 4e28511
- Parents:
- 0d362b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/multiscat.py
r2c4a190 rb297ba9 103 103 USE_FAST = True # OpenCL faster, less accurate math 104 104 105 class ICalculator :105 class ICalculator(object): 106 106 """ 107 107 Multiple scattering calculator … … 113 113 raise NotImplementedError() 114 114 115 def ifft(self, Iq):115 def ifft(self, fourier_frame): 116 116 """ 117 117 Compute the inverse FFT for an image, complex -> complex. … … 119 119 raise NotImplementedError() 120 120 121 def mul itple_scattering(self, Iq):121 def multiple_scattering(self, Iq, p, coverage=0.99): 122 122 r""" 123 123 Compute multiple scattering for I(q) given scattering probability p. … … 250 250 gpu_poly = cl_array.to_device(self.queue, poly) 251 251 self.plan.execute(gpu_data.data) 252 degree, data_size = poly.shape[0], frame.shape[0]*frame.shape[1]252 degree, data_size = poly.shape[0], frame.shape[0]*frame.shape[1] 253 253 self.polyval1( 254 254 self.queue, [data_size], None, … … 575 575 576 576 def main(): 577 """Command line interface to multiple scattering calculator.""" 577 578 parser = argparse.ArgumentParser( 578 579 description="Compute multiple scattering", … … 612 613 theory = call_kernel(kernel, pars) 613 614 Iq = res.apply(theory) + bg 614 plot_and_save_powers(res, theory, Iq, outfile=opts.outfile, background=bg) 615 616 def plot_and_save_powers(res, theory, result, plot=True, outfile="", background=0.): 615 _plot_and_save_powers(res, theory, Iq, outfile=opts.outfile, background=bg) 616 617 def _plot_and_save_powers(res, theory, result, plot=True, 618 outfile="", background=0.): 617 619 import pylab 618 620 probability, coverage = res.probability, res.coverage … … 678 680 679 681 def plotxy(q, Iq): 682 """Plot q, Iq or (qx, qy), Iqxy.""" 680 683 import pylab 681 684 # q is a tuple of (q,) or (qx, qy)
Note: See TracChangeset
for help on using the changeset viewer.