codedapertures documentation
- class codedapertures.codedaperture(type)
Bases:
objectCoded Aperture
- Parameters:
- typestr
“1d”, “rectangular”, or “hexagonal”
- Attributes:
- basearray_like
the “base” pattern; for rectangular arrays, this is the base pattern prior to tiling; for non-random hexagonal arrays, this is the rhombus
- aperturearray_like
the physical coded aperture pattern; 1=open, 0=closed
- decoderarray_like
the decoding matrix
- densityfloat
ratio of closed to total number of pixels
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
post_plot
pre_plot
- property aperture
- gen_decoder(method='matched')
Generate decoder matrix
- Parameters:
- methodstr
“matched” or “balanced”
- gen_psf()
Generate Point Spread Function
- post_plot(axis='on', title=None)
- pre_plot(size=None)
- property type
- class codedapertures.fzp(radius=4, resolution=10, transmission='theoretical', quiet=False)
Bases:
codedapertureFresnel Zone Plate
- Parameters:
- radiusint
radius of the aperture to build
- resolutionint
number of pixels per radius
- transmissionstr
“theoretical”: transmission is floating point number “practical”: transmission is 1/open or 0/closed
- quietbool
if True, will not print information about the array upon creation
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([border, axis, size])Plots the coded aperture to the screen
report()Report the array info
post_plot
pre_plot
- plot(border=0, axis='on', size=None)
Plots the coded aperture to the screen
- Parameters:
- borderint
width of border
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report the array info
- class codedapertures.hura(rank=4, radius=5, quiet=False)
Bases:
codedapertureHexagonal Uniformly Redundant Array
- Parameters:
- rankint
determines the order, v, a prime of the form 3 or 12n+7 radius
- quietbool
if True, will not print information about the array upon creation
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([labels, labelsize, axis, size])Plot the aperture
plot_rhombus([labels, labelsize, axis, size])Plot the mask rhombus
report()Report the array info
post_plot
pre_plot
- plot(labels=False, labelsize=8, axis=True, size=None)
Plot the aperture
- Parameters:
- labelsbool
if True, will show the labels on top of each pixel
- labelsizeint
fontsize for labels
- axisbool
if False, will not plot axis
- sizeint
size of the plot
- plot_rhombus(labels=False, labelsize=8, axis=True, size=None)
Plot the mask rhombus
- Parameters:
- labelsbool
if True, will show the labels on top of each pixel
- labelsizeint
fontsize for labels
- axisbool
if False, will not plot axis
- sizeint
size of the plot
- report()
Report the array info
- class codedapertures.mura(rank=5, quiet=False, tile=None, center=False)
Bases:
codedapertureModified Uniformly Redundant Array
- Parameters:
- rankint
the rank of prime to use
- tileNone or int or tuple of ints
how to tile the pattern
- quietbool
if True, will print information about the array upon creation
- center: bool
if True, will center the base pattern in the array
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([border, axis, size])Plots the coded aperture to the screen
report()Report on the mask information
post_plot
pre_plot
- plot(border=0, axis='on', size=None)
Plots the coded aperture to the screen
- Parameters:
- borderint
width of border
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report on the mask information
- class codedapertures.pnp(m=10, n=10, quiet=False, tile=None, center=False)
Bases:
codedaperturePseudo-Noise Product Array
- Parameters:
- mint
degree of a_i
- nint
degree of b_i
- tileNone or int or tuple of ints
how to tile the pattern
- quietbool
if True, will print information about the array upon creation
- center: bool
if True, will center the base pattern in the array
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([border, axis, size])Plots the coded aperture to the screen
report()Report the array info
post_plot
pre_plot
- plot(border=0, axis='on', size=None)
Plots the coded aperture to the screen
- Parameters:
- borderint
width of border
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report the array info
- class codedapertures.randa1d(length=30, density=0.5, quiet=False)
Bases:
codedapertureRandom Array 1-Dimensional
- Parameters:
- lengthint
number of elements in the array
- densityfloat
fill factor fraction
- quietbool
if True, will print mask info upon creation
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([height, size, axis])Plot the coded aperture to the screen
report()Report on the mask information
post_plot
pre_plot
- plot(height=10, size=None, axis='on')
Plot the coded aperture to the screen
- Parameters:
- inversebool, optional
if True, will invert the array before plotting
- sizeint, optional
size of the plot (default 8)
- axisstr
“on” or “off
- report()
Report on the mask information
- class codedapertures.randa2d(width=10, height=10, density=0.5, quiet=False)
Bases:
codedapertureRandom Array 2-Dimensional
- Parameters:
- widthint
width in elements
- heightint
height in elements
- densityfloat
fill factor fraction
- quietbool
if True, will print mask info upon creation
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([axis, size])Plots the mask to the screen
report()Report on the mask information
post_plot
pre_plot
- plot(axis='on', size=None)
Plots the mask to the screen
- Parameters:
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report on the mask information
- class codedapertures.randahex(radius=3, density=0.5, quiet=False)
Bases:
codedapertureRandom Array Hexagonal
- Parameters:
- radiusint
vertex-to-vertex radius of the array, minus half the pixel width
- densityfloat
fraction fill
- quietbool
if True, will print information about the array upon creation
- Attributes:
- diameterint
due to the nature of hexagonal arrays, this is 2*radius+1
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([axis, size])Plots the coded aperture to the screen
report()Report the array info
post_plot
pre_plot
- plot(axis='on', size=None)
Plots the coded aperture to the screen
- Parameters:
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report the array info
- class codedapertures.shura(rank=4, r=5, radius=5, quiet=False)
Bases:
codedapertureSkew-Hadamard Uniformly Redundant Array
- Parameters:
- rankint
determines the order, v, a prime of the form v=4n-1 (default 6)
- rint
feeds into pattern (default 5)
- quietbool
if True, will not print information about the array upon creation
- Attributes:
- diameterint
due to the nature of hexagonal arrays, this is 2*radius+1
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([labels, labelsize, axis, size])Plot the aperture
plot_rhombus([labels, labelsize, axis, size])Plot the mask rhombus
report()Report the array info
post_plot
pre_plot
- plot(labels=False, labelsize=8, axis=True, size=None)
Plot the aperture
- Parameters:
- labelsbool
if True, will show the labels on top of each pixel
- labelsizeint
fontsize for labels
- axisbool
if False, will not plot axis
- sizeint
size of the plot
- plot_rhombus(labels=False, labelsize=8, axis=True, size=None)
Plot the mask rhombus
- Parameters:
- labelsbool
if True, will show the labels on top of each pixel
- labelsizeint
fontsize for labels
- axisbool
if False, will not plot axis
- sizeint
size of the plot
- report()
Report the array info
- class codedapertures.ura(rank=4, tile=None, quiet=False, center=False)
Bases:
codedapertureUniformly Redundant Array
- Parameters:
- rankint
the rank of prime pairs to use (0 -> [5,3] 1 -> [13,11], etc.)
- tileNone or int or tuple of ints
how to tile the pattern
- quietbool
if True, will print information about the array upon creation
- center: bool
if True, will center the base pattern in the array
- Attributes:
- aperture
- type
Methods
gen_decoder([method])Generate decoder matrix
gen_psf()Generate Point Spread Function
plot([border, axis, size])Plots the mask to the screen
report()Report the array info
post_plot
pre_plot
- plot(border=0, axis='on', size=None)
Plots the mask to the screen
- Parameters:
- borderint
width of border
- axisstr
“on” or “off”
- sizeint
size of the plot (default 8)
- report()
Report the array info