Image

Images of spectral values, such as the received power in a frame buffer, a spectral texture, or a measured PSF. Each spectral submodule has its own: huira.rgb.Image, huira.visible8.Image and so on. Their arrays are (height, width, bins), and they are copied to and from numpy arrays as other images are, with the array’s row order given as origin: see Image.

class huira.visible8.Image

An image, stored with its top row first: pixel (x, y) is in column x and row y, counted down from the top.

Arrays: Image(array, origin=…) copies a numpy array in, and to_numpy(origin=…) copies one out, of shape (height, width) for one channel and (height, width, channels) for more. origin says which row of the array is the top of the image: PixelOrigin.TopLeft if its first row is the top, as most image libraries and matplotlib have it, or PixelOrigin.BottomLeft if its first row is the bottom, as in FITS files (and the arrays astropy reads from them). An array doesn’t record which, so origin must be given.

For convenience, an image is also an array in its own layout, top row first: np.asarray(image) is a view of it, without copying (writing to the view changes the image), and numpy and matplotlib take it directly (plt.imshow(image) draws it the right way up). Nothing checks that layout against where the array goes next: to write an image with astropy, whose FITS files have their first row at the bottom, use to_numpy(origin=PixelOrigin.BottomLeft), or huira’s write_fits(), which flips it.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: huira._huira.visible8.Image) -> None

  2. __init__(self: huira._huira.visible8.Image, width: int, height: int) -> None

  3. __init__(self: huira._huira.visible8.Image, width: int, height: int, fill_value: huira._huira.visible8.SpectralBins) -> None

  4. __init__(self: huira._huira.visible8.Image, array: numpy.ndarray[numpy.float32], *, origin: huira._huira.PixelOrigin) -> None

Copy a numpy array into a new image: (height, width) for one channel, (height, width, channels) for more. origin says which row of the array is the top of the image: PixelOrigin.TopLeft if its first row is, PixelOrigin.BottomLeft if its first row is the bottom (as in FITS files, and the arrays astropy reads from them).

property channels
clear(self: huira._huira.visible8.Image) → None
property empty
fill(self: huira._huira.visible8.Image, value: huira._huira.visible8.SpectralBins) → None
get_channel(self: huira._huira.visible8.Image, channel: int) → huira._huira.Image_f32

Extract a single channel as an Image_f32 (0-indexed).

property height
property resolution
property sensor_bit_depth
property shape
to_numpy(self: huira._huira.visible8.Image, *, origin: huira._huira.PixelOrigin) → numpy.ndarray[numpy.float32]

Copy the image into a new numpy array: (height, width) for one channel, (height, width, channels) for more. origin says which row of the array is to be the top of the image: PixelOrigin.TopLeft for the first row, as np.asarray(image) has it, or PixelOrigin.BottomLeft for the last, as FITS files have it (and astropy writes them).

property width
class huira.visible8.ImageBundle
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: huira._huira.visible8.ImageBundle, image: huira._huira.visible8.Image) -> None

  2. __init__(self: huira._huira.visible8.ImageBundle, image: huira._huira.visible8.Image, alpha: huira._huira.Image_f32) -> None

property alpha
property bit_depth
property color_space
property gamma_value
property image
property scaling