예제 #1
0
 def call_ocl(self, x, dtype, platform='ocl'):
     """
     Calculation using sasmodels ocl libraries.
     """
     x = np.asarray(x, dtype)
     model = core.build_model(self.ocl_function, dtype=dtype)
     calculator = direct_model.DirectModel(data.empty_data1D(x), model)
     return calculator(background=0)
예제 #2
0
def sasmodels_fn(x, dtype, platform='ocl'):
    """
    Calculation using pade approximant.
    """
    from sasmodels import core, data, direct_model
    model = core.load_model('bessel', dtype=dtype)
    calculator = direct_model.DirectModel(data.empty_data1D(x), model)
    return calculator(background=0)