funclp.Airy module

class funclp.Airy(**kwargs)[source]

Bases: Function

property Abbe
property Abbe_z
property FWHM
property NA
NA0 = None
NA_fit = False
NA_max = np.float32(inf)
NA_min = np.float32(-inf)
property Rayleigh
property Sparrow
property amp
static amp0(res, *args)
amp_fit = True
amp_max = np.float32(inf)
amp_min = np.float32(-inf)
property constants
property cpu_d_NA
property cpu_d_amp
property cpu_d_mu
property cpu_d_offset
property cpu_d_tol
property cpu_d_wl
property cpu_function
property cpukernel_d_NA
property cpukernel_d_amp
property cpukernel_d_mu
property cpukernel_d_offset
property cpukernel_d_tol
property cpukernel_d_wl
property cpukernel_function
d_NA

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

d_amp

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

d_mu

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

d_offset

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

d_tol

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

d_wl

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

data = []
property diameter
function

Decorator class defining universal function factory object from python kernel function, will create kernels, vectorized functions, jitted functions, stack functions, all on CPU / Parallel CPU / GPU.

Examples

>>> from funclp import Parameter, ufunc
>>> import numpy as np
...
>>> class MyClass() :
...     @ufunc(variables=['x', 'y'], data=['constant'], parameters=[Parameter('a', 1), Parameter('b', 0)])
...     def myfunc(x, y, constant, /, a, b) :
...         return a * x + b * y + constant
...     cuda = False
...
>>> instance = MyClass()
...
>>> x = np.arange(20).reshape((1, 20)) # Example of variables that can be broadcasted together
>>> y = np.arange(20).reshape((20, 1)) # Example of variables that can be broadcasted together
>>> constant = np.ones((5, 20, 20)) # Example of data with full shape
>>> a = np.arange(5) # Example of parameter vector
>>> b = 0.5 # Example of scalar use
>>> cpu_out = instance.myfunc(x, y, constant, a=a, b=b)
>>> instance.cuda = True
>>> gpu_out = instance.myfunc(x, y, constant, a=a, b=b)

property gpu_d_NA
property gpu_d_amp
property gpu_d_mu
property gpu_d_offset
property gpu_d_tol
property gpu_d_wl
property gpu_function
property gpukernel_d_NA
property gpukernel_d_amp
property gpukernel_d_mu
property gpukernel_d_offset
property gpukernel_d_tol
property gpukernel_d_wl
property gpukernel_function
property mu
static mu0(res, *args)
mu_fit = True
mu_max = np.float32(inf)
mu_min = np.float32(-inf)
n = 1.33
property offset
static offset0(res, *args)
offset_fit = True
offset_max = np.float32(inf)
offset_min = np.float32(-inf)
property parameters
psf(*args, **kwargs)[source]
python_d_NA(mu, amp, offset, wl, NA, tol)
python_d_amp(mu, amp, offset, wl, NA, tol)
python_d_mu(mu, amp, offset, wl, NA, tol)
python_d_offset(mu, amp, offset, wl, NA, tol)
python_d_tol(mu, amp, offset, wl, NA, tol)
python_d_wl(mu, amp, offset, wl, NA, tol)
python_function(mu=0.0, amp=1.0, offset=0.0, wl=550.0, NA=1.5, tol=1.0)
property radius
property sigma
property tol
tol0 = None
tol_fit = False
tol_max = np.float32(inf)
tol_min = np.float32(-inf)
variables = ['x']
property wl
wl0 = None
wl_fit = False
wl_max = np.float32(inf)
wl_min = np.float32(-inf)