MultiImage — Multiple image container base.

This module defines the MultiImage class for multiple Image instances.

class admit.util.MultiImage.MultiImage[source]

Class tha allows multiple image instances to be stored as one Image instance. There can be 0 to N different images (no limit) and the number does not need to be specified as they are allocated and removed dynamically.

Parameters:None

Attributes

mimages (dict) A dictionary for holding the Image instances. Each Image instance must have a unique name (the key).

Methods

addimage(image[, name]) Method to add a new image to the dictionary.
delete(basedir[, delfiles]) Method to delete all of the Images
deserialize(serial)
getimage(typ[, name]) Method to get the requested image from the named instance as an imagedescriptor.
getimageclass(name) Method to return the requested Image instance
getkey(key) Method to get a data member by name
removeimage(name) Method to remove an image from the dictionary
replaceimage(image[, name]) Method to replace an image in the dictionary.
serialize()
setkey([name, value]) set keys, two styles are possible:
addimage(image, name='')[source]

Method to add a new image to the dictionary. The image key must not already exist.

Parameters:

image : Image

The image instance to add

name : str

The unique name to use for the image Default : “”

Returns:

None

delete(basedir, delfiles=True)[source]

Method to delete all of the Images

Parameters:

basedir : str

The base directory where the image(s) are

delfiles : bool

Whether or not to delete the actual image files Default : True

Returns:

None

deserialize(serial)[source]
getimage(typ, name='')[source]

Method to get the requested image from the named instance as an imagedescriptor.

Parameters:

typ : string

Can be any of the following: bdp_types.AUX to retrieve the auxiliary file, bdp_types.THUMB to retrieve the thumbnail, or a file format (e.g. bdp_types.FITS) to retrieve the requested format of the main image. If the requested image does not exist then None is returned.

name : str

The name if the image instance to get. Default : “”

Returns:

ImageDescriptor

An imagedescriptor of the requested image or None if the image does not exist in the class.

getimageclass(name)[source]

Method to return the requested Image instance

Parameters:

name : str

The name of the Image instance to get

Returns:

Image class instance of the requested image

removeimage(name)[source]

Method to remove an image from the dictionary

Parameters:

name : str

The name of the image to remove

Returns:

None

replaceimage(image, name='')[source]

Method to replace an image in the dictionary. This will no throw an error if the image does not already exist.

Parameters:

image : Image

The image instance to insert

name : str

The name of the image to replace

Returns:

None

serialize()[source]