This module defines the class for IMAGE entries in BDP’s
Defines the basic Image structure used in ADMIT.
The class can store multiple types of the same image (e.g. png, jpg, CASA), however no check is made that they are the same image, this must be ensured by the AT using the class. A thumbnail, description/caption, and auxiliary file (for e.g. a histogram) are also included.
Parameters: | keyvals : dictionary of new values for the keywords, optional.
|
---|
Attributes
images | (dictionary) Dictionary containing the image data, one entry per format type |
thumbnail | (string) File name of the thumbnail image |
thumbnailtype | (string) The format of the thumbnail, see bdp_types for a list of available formats |
auxiliary | (string) The name of the auxiliary file. |
auxtype | (string) The format of the auxiliary file, see bdp_types for a list of available formats |
description | (string) A description or caption for the image. |
Methods
addfile(image) | Method to add a file to the class, it should not be called directly, |
addimage(image) | Method to add an image to the class |
delete([basedir, delfile]) | Method to delete everything |
getaux() | Method to get the auxiliary file name |
getimage(type) | Method which returns the requested image from the class as an imagedescriptor. |
getthumbnail() | Method to get the thumbnail image file name |
isequal(img) | Method to determine if two images are equivalent |
removeimage(typ[, basedir, delete]) | Method to remove a specific image from the class, including from disk if requested. |
setkey([name, value]) | set keys, two styles are possible: |
write(root, name) | Method to write an xml entry for the Image class |
Method to add a file to the class, it should not be called directly, instead addimage should be called
Parameters: | image : ImageDescriptor
|
---|---|
Returns: | None |
Method to add an image to the class
Parameters: | image : List/ImageDescriptor
|
---|---|
Returns: | None |
Method to delete everything
Parameters: | delfile : Boolean
|
---|---|
Returns: | None |
Method to get the auxiliary file name
Returns: | string
|
---|
Method which returns the requested image from the class as an imagedescriptor.
Parameters: | type : string
Returns ——- ImageDescriptor
|
---|
Method to get the thumbnail image file name
Returns: | string
|
---|
Method to determine if two images are equivalent
Parameters: | img : Image
|
---|---|
Returns: | Boolean
|
Notes
Useful for testing purposes, still experimental
Method to remove a specific image from the class, including from disk if requested.
Parameters: | type : string
delete : Boolean
|
---|---|
Returns: | None |
set keys, two styles are possible:
This method checks the type of the keyword value, as it must remain the same. Also new keywords cannot be added.
Parameters: | name : dictionary or string
value : any
|
---|---|
Returns: | None |
Method to write an xml entry for the Image class
Parameters: | root : elementtree node
name : string
|
---|---|
Returns: | None |
A lightweight class for transporting an image, its format and type. This class has three and only three data members, and no added methods. The members are file for the image file name on disk, format for the image format (e.g. bdp_types.FITS), and type (one of bdp_types.THUMB, bdp_types.AUX, or bdp_types.DATA) specifying what type of image this is.
Parameters: | file : string
format : string
type : string
|
---|
Attributes
Same as Parameters |