Changeset b297ba9 in sasmodels for sasmodels/multiscat.py


Ignore:
Timestamp:
Mar 20, 2019 7:03:50 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

lint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/multiscat.py

    r2c4a190 rb297ba9  
    103103USE_FAST = True  # OpenCL faster, less accurate math 
    104104 
    105 class ICalculator: 
     105class ICalculator(object): 
    106106    """ 
    107107    Multiple scattering calculator 
     
    113113        raise NotImplementedError() 
    114114 
    115     def ifft(self, Iq): 
     115    def ifft(self, fourier_frame): 
    116116        """ 
    117117        Compute the inverse FFT for an image, complex -> complex. 
     
    119119        raise NotImplementedError() 
    120120 
    121     def mulitple_scattering(self, Iq): 
     121    def multiple_scattering(self, Iq, p, coverage=0.99): 
    122122        r""" 
    123123        Compute multiple scattering for I(q) given scattering probability p. 
     
    250250        gpu_poly = cl_array.to_device(self.queue, poly) 
    251251        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] 
    253253        self.polyval1( 
    254254            self.queue, [data_size], None, 
     
    575575 
    576576def main(): 
     577    """Command line interface to multiple scattering calculator.""" 
    577578    parser = argparse.ArgumentParser( 
    578579        description="Compute multiple scattering", 
     
    612613    theory = call_kernel(kernel, pars) 
    613614    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 
     617def _plot_and_save_powers(res, theory, result, plot=True, 
     618                          outfile="", background=0.): 
    617619    import pylab 
    618620    probability, coverage = res.probability, res.coverage 
     
    678680 
    679681def plotxy(q, Iq): 
     682    """Plot q, Iq or (qx, qy), Iqxy.""" 
    680683    import pylab 
    681684    # q is a tuple of (q,) or (qx, qy) 
Note: See TracChangeset for help on using the changeset viewer.