Mira Product Brief

Home
Products
Product Briefs
Tech Notes
Tech Support
Purchase
Dealers
Press & News
General Info
Web Tools
Contact

Class and Function Reference for the Mira Pro Script Module

In addition to the standard math, string, file I/O and other functions provided with the Lua language, the classes and function groups listed below are provided with the Pro Script Module.

Classes

CApphot

Used for performing aperture photometry measurements on images.

CArray

Used for working with indexed arrays, such as vectors of numbers. However, members can be numbers, strings, or other types of objects.

CCentroid

Used for measuring centroid positions. Holds data that controls centroid measurement and provides methods for computing the centroid.

CColorRef

Used for working with colors. Holds color data members and provides methods for working with the colors.

CFile

Used for working with text files (not usually for image files).

CFindFiles

Searches for files in a folder having names that match a template.

CFwhm

Used for computing the FWHM and related parameters in images.

CImage

Used for working with images. Interfaces to the Mira image object and provides a large number of methods for processing, measuring, and interrogating images.

CImageSet

Maintains a list of images, used by some methods or classes that work with a list of images rather than a single image.

CImageView

Used for displaying images in a MIRA image view window. This class also access the CImageSet of the window, which maintains multiple images in the window. The class also provides access to Image window components such as the image cursor and display tools.

CImCombine

Performs image combining, or merging procedures on the images of a CImageSet.

CLabels

Adds markers and labels to displayed images.

CMatrix

Used for working with 2-dimensional indexed arrays as a sparse matrix. Matrix elements may be numbers, strings, or other types of values.

CPlotView

Used for plotting 1-dimensional data from images, displayed images, matrices, and data sets.

CPolynomial

Manages a set of polynomial coefficients.

CRect

Used for working with rectangles. Includes descriptive data and numerous methods for creating, interrogating, and doing math on rectangles.

CRegistry

Methods for saving and retrieving values from the Windows Registry.

CSplitpath

Used for working with path components such as the file name, folder, extension, etc.

CSet

Used for working with lists using insertion and removal to manipulate the set. Members can be numbers, strings, or other types of objects.

CStats

Used for measuring statistics inside a rectangular region of an image. Includes methods for many types of statistics.

CStrTok

Parses strings into shorter strings (tokens) based on separator characters.

CTextView

Manages Mira Text Editor windows used for displaying text output and messages.

Functions

Text Formatting Functions These functions format text to strings and windows.
Dialog Functions These functions use pop-up dialogs to display messages and input data into a script.
Miscellaneous Functions These functions set global parameters, and various other things.

 

Class & Function Descriptions

The tables below describe the classes and global functions available from the Pro Script Module. Class methods and global functions are colored blue whereas class data members are shown in black. Most data members use "Hungarian Notation" to reveal their data type using a prefix character; for example, a number value begins with n, a string value begins with s, and a Boolean choice begins with b. Number values are inherently 64-bit real quantities.

 

CApphot Class

The CApphot class measures the brightness of objects or sources in images using the aperture photometry method. The aperture may be a circle or an ellipse and the background is computed locally around the source. The class uses many data members to provide flexibility and to control how the measurements are made.

Data Members Set by the Script

bVerbose

Controls whether the measurement is silent or lists verbose information. Defaults to false (silent).

bRemoveBg

Controls whether the background value is removed from the raw measurement. This value defaults to true. The background parameters are set using the SetBgMethod method.

bCalcMag

Controls whether the instrumental magnitude is calculated from the net count. If this parameter is set to false, the Measure method sets returns a value in nNetCount but does not set nMag. This member defaults to true.

bApplyZeroPt

Controls whether the photometric zero point (the nZeroPt member) is used to return an instrumental magnitude in the nMag member. The default setting is true, which applies the zero point.

bUseZeroPtErr

If set to true, the photometric zero point error in nZeroPtErr is applied to the values of nMagError and nMagErrorT. The default is false.

nGain

The camera gain, measured in electrons per Count, or electrons per ADU (default 1.0). This value may be retrieved from the image using CImage:Gain method, or it can be automatically set using the GetImageParams method.

nReadNoise

The image readout noise, measured in electrons (default 1.0). This value may be retrieved from the image using CImage:KwdGetNum("RDNOISE") or CImage:KwdGetNumEx("RDNOISE"), or it can be automatically set using the GetImageParams method.

nExptime

The image exposure time, measured in seconds (default 1.0). This value may be retrieved from the image using the CImage:Exptime method, or it can be automatically set using the GetImageParams method.

nZeroPt

The photometric zero point for the image, measured in magnitudes (default 0.0). This value may be retrieved from the image using CImage:KwdGetNum("ZERO-PT") or CImage:KwdGetNumEx("ZERO-PT"), or it can be automatically set using the GetImageParams method.

nZeroPtErr

The uncertainty of the photometric zero point for the image, measured in magnitudes (default 0.0). This value may be retrieved from the image using CImage:KwdGetNum("ZERPTERR") or CImage:KwdGetNumEx("ZERPTERR"), or it can be automatically set using the GetImageParams method.

nRadius1

The radius of the object measuring aperture, measured in pixels (default 3).

nRadius2

The radius of the inner background measuring aperture, measured in pixels (default 10).

nRadius3

The radius of the outer background measuring aperture, measured in pixels (default 16).

nEllipticity

The ellipticity of the aperture set (default 0, or circular). This measures the value of (1 - b/a), where a is the semimajor axis and b is the semiminor axis of an ellipse. A circle has a = b.

nTheta

The angle of the semimajor axis of the aperture set (default 0). This is relevant only when elliptical apertures are used by setting a value of nEllipticity > 0.

Data Members Returned to the Script

The data members below are returned to the script by the CApphot measurement method, such as Measure or GetImageParams.

nStatusCode

An integer number indicating the status returned by a photometry method. Usually, a value of 1 indicates that the method succeeded, and 0 indicates that it failed (see GetImageParams for an exception).

sErrMsg

A string indicating "Success" or an error message returned by the photometry method.

nNetCount

The net count for the object, measured in counts (or "ADU" or "DN"). If the bRemoveBg flag is true, this is the net count above the background. Otherwise, it is the total count above zero.

nBgValue

The background value per pixel, measured in counts (or "ADU" or "DN"). If the bRemoveBg flag is true, this value was subtracted from the total to calculate nNetCount.

nBgValueErr

The error in the background value (per pixel). This is a 1-sigma mean error, not the error of the mean background. The value is measured in units of counts (or "ADU" or "DN"). If the bRemoveBg flag is true, this value was subtracted from the total count to calculate nNetCount.

nMag

The measured magnitude of the object. If the bApplyZeroPt flag was true, then this includes the photometric zero point set in the nZeroPt value.

nMagError

The random error in the value of nMag as calculated from the noise measured in the background sample. If the bApplyZeroPtErr flag was true, then this includes the photometric zero point error set in the nZeroPtErr value.

nMagErrorT

The random error in the value of nMag as calculated using only the instrumental values but not the actual noise measured in the background sample. If the bApplyZeroPtErr flag was true, then this includes the photometric zero point error set in the nZeroPtErr value.

nSnRatio

The Signal to Noise Ratio of the signal measured inside the object aperture of radius nRadius1. This value is computed from the total signal and the signal error included in nMagError.

nSnRatioT

The Signal to Noise Ratio of the signal measured inside the object aperture of radius nRadius1. This value is computed from the total signal and the theoretical signal error included in nMagErrorT.

Photometry Methods

new Creates a new instance of the CApphot class. There are 3 constructor formats.
delete Deletes the instance of the CApphot object.
Copy Copies the data members of this CApphot object to a new CApphot object.
GetImageParams Reads the image header and fetches the values of camera gain, readout noise, exposure time, and the photometric zero point and its error. These values are returned as class data members.
Measure Performs an aperture photometry measurement at a (column,row) coordinate in an image.
SetBgMethod Sets the method used to evaluate the background in the Measure method. Four options are provided: mean, median, mode, and value.

 

CArray Class

The CArray class manages a 1-dimensional array of values. The class implements a vector as a Lua table of (index, value) pairs. The values may be any supported type of thing (number, string, object) and indexing starts at 1. The CArray is sparse, so that an array can stretch from index 1 to index 10000 by holding just 1 member with index 10000. See also the CMatrix class and the CSet class.

new

Creates a new instance of the CArray class. There are 3 constructor formats.

delete

Deletes the instance of the CArray object.

Copy

Copies this CArray to a new CArray

Count

Returns the number of members actually initialized.

Dot

Returns the dot product with another CArray.

Empty

Empties the contents of the CArray but does not delete it.

Exists

Returns true if a member exists at the index.

Get

Returns the member value at an array index.

Init

Initializes all members to a value.

MaxIndex

Returns the maximum member index.

Remove

Removes the member at an index.

Set

Sets the member value at an index.

CCentroid Class

The CCentroid class encapsulates functionality for computing accurate centroid coordinates in an image. The centroid position is a refined coordinate based upon higher order moments of the pixel value distribution. This class provides methods for calculating the centroid position and for working with control parameters. The pixel coordinates may be converted to world coordinates using one of the CImage class methods such as XyToWcs.

radiusX

The pixel radius for computing the centroid position in the x direction.

radiusY

The pixel radius for computing the centroid position in the y direction.

trackX

The pixel radius for tracking the peak or valley in the x direction from the initial position to the centroid position.

trackY

The pixel radius for tracking the peak or valley in the y direction from the initial position to the centroid position.

bPositive

True if centroids are computed for peaks, or false if computed for valleys.

new

Creates a new instance of a CCentroid object. Various constructors are available

delete

Deletes the instance of the CCentroid object.

GetSign

Returns a boolean flag for the direction used to compute centroid positions. The value true means that centroid are computed for peaks, rather than for valleys.

GetSample

Returns the centroid sample radius in x and y directions.

GetTracking

Sets the centroid tracking radius in x and y directions.

SetSign

Sets the centroid calculation to use peaks (true) or valleys (false).

SetSample

Sets the sample radius in x and y directions to the specified number of pixels.

SetTracking

Sets the tracking radius in x and y directions to the specified number of pixels.

Calc

Calculates the centroid position for the image near starting coordinate x,y.

X

Returns the computed x coordinate of the centroid position.

Y

Returns the computed y coordinate of the centroid position.

 

CColorRef Class

The CColorRef class encapsulates an RGB color triplet and provides methods for manipulating the values.

R

The red channel value in the range 0 through 255.

G

The green channel value in the range 0 through 255.

B

The blue channel value in the range 0 through 255.

new

Creates a new instance of a CColorRef object. Various constructors are available.

delete

Deletes the instance of the CColorRef object.

Choose

Opens the Windows ChooseColor tool for changing the color value.

ChoosePal

Opens the Windows ChooseColor tool in "open" mode showing the color palette.

Invert

Inverts the R, G, and B values to form a complementary color.

ToGray

Converts the RGB triplet to a single gray value.

Get

Returns the R, G, and B values.

Set

Assigns values to the R, G, and B members.

 

CFile Class

The CFile class encapsulates file operations. This class wraps several C functions for working with text and binary files.

sPath

The path name for the file.

sAccess

The file access mode string

new

Creates a new instance of a CFile object.

delete

Deletes the instance of the CFile object.

Close

Closes the file.

FilePos

Returns the current file position.

Flush

Commits data in the operating system buffer to the file.

Open

Opens the file.

Printf

Writes formatted text to the file.

Seek

Resets the file position to a given location.

GetPath

Returns the name of the file.

 

CFindFiles Class

The CFindFiles class provides file searching capability. This class iterates through the files in a folder using a filename template for file selection.

new

Creates a new instance of a CFindFiles object. Various constructors are available.

delete

Deletes the instance of the CFindFiles object.

GetPath

Returns the current path saved by the last call to Next().

Open

Opens access to file searching using a specified folder and filename template.

Next

Iterates to the next matching file.

Close

Closes the current object's access to the file system, but does not delete the CFileFind object.

 

CFwhm Class

The CFwhm class encapsulates functionality for computing the Full Width at Half Maximum values in an image. This class provides methods for calculating the FWHM and for working with control parameters. The centroid computation collects points around a central position, then fits a Gaussian + Constant model to the data. The fit parameters lead to the FWHM value, the background value, and the peak value of the point spread function. Both peaks and valleys can be measured. The Calc method usually uses a centroid position as the center point of the FWHM calculation.

radiusX

The pixel radius for computing the centroid position in the x direction.

radiusY

The pixel radius for computing the centroid position in the y direction.

trackX

The pixel radius for tracking the peak or valley in the x direction from the initial position to the centroid position.

trackY

The pixel radius for tracking the peak or valley in the y direction from the initial position to the centroid position.

bPositive

True if centroids are computed for peaks, or false if computed for valleys.

nMinIter

The minimum number of iterations used in fitting the radial intensity profile.

bSnWeighting

True to weight the data by signal to noise ratio when computing the fit.

bAutoCentroid

True computes the centroid before fitting the radial profile data.

nInitialFwhm

The trial value, in pixels, of the FWHM used in the iterative solution.

nMaxRadius

The maximum radius in pixels, of the radial profile sample.

new

Creates a new instance of a CFwhm object. Various constructors are available

delete

Deletes the instance of the CFwhm object.

GetSign

Returns true if the FWHM and centroid are being computed for peaks, rather than for valleys.

GetSample

Returns the centroid sample radius in x and y directions.

GetTracking

Returns the centroid tracking radius in x and y directions.

SetSign

Sets the centroid calculation to use peaks (true) or valleys (false).

SetSample

Sets the centroid sample radius in x and y directions to the specified number of pixels.

SetTracking

Sets the centroid tracking radius in x and y directions to the specified number of pixels.

GetAutoCentroid

Returns true if the auto-centroid flag is set and the FWHM uses a centroid position.

SetAutoCentroid

Sets the auto-centroid flag true or false.

GetMaxRadius

Returns the maximum profile sampling radius, in pixels.

SetMaxRadius

Sets the maximum profile sample radius.

Calc

Calculates the Fwhm and, optionally, the centroid position near the starting coordinate x,y.

Fwhm

Returns the computed FWHM value.

Peak

Returns the computed peak value.

Bg

Returns the computed background value.

X

Returns the computed x coordinate of the centroid position.

Y

Returns the computed y coordinate of the centroid position.

 

CImage Class

The CImage class encapsulates functionality for working with images. Included in this huge class are tools for working with image files, doing image math operations, changing image geometry, making measurements, and working with header data. Additional methods for combining and merging images are found in the CImCombine class.

new

Creates a new instance of the CImage class. Various constructors are available.

delete

Deletes the instance of the CImage object and deletes its image from memory.

Copy

Copies the image to a new image.

Attach

Attaches the pointer from an image in a CImageView.

AttachFromList

Creates a new CImage and attaches an image selected from the list of images in a CImageView.

General Methods

Close

Closes the image and deletes it from memory.

Create

Creates a new image of specified size and data type.

Display

Displays an image in a new image view window.

GetImagePtr

Returns a pointer to the Mira image object.

Open

Opens an image from a file into memory.

Save

Saves the image to its file.

SaveAs

Saves the image to a file with a different name.

Image Property Methods

Axes

Returns the number of image axes.

Bytes

Returns the number of bytes in the image pixel data.

Cols

Returns the number of image columns.

Darktime

Returns the dark integration time for the image.

Date

Returns the date the image was acquired, in days.

DateStr

Returns the date of image acquisition as a string.

DatatypeStr

Returns the image data type as a string.

Datatype

Returns the image data type as a numeric index.

Exptime

Returns the image exposure time in seconds.

Filter

Returns the name of the filter used for image acquisition.

Gain

Returns the inverse gain in electrons per ADU.

ImageType

Returns the type of image, usually the value of the IMAGETYP keyword.

IsColor

Returns true if the image is a color data type.

IsInteger

Returns true if the image is an integer data type.

IsNumeric

Returns true if the image is a numeric data type.

IsReal

Returns true if the image is a real (floating point) data type.

Object

Returns the object description.

Path

Returns the image file path.

PixelBytes

Returns the number of bytes per pixel.

Pixels

Returns the number of pixels in the image.

Rows

Returns the number of image rows.

Time

Returns the time of image acquisition as a number of seconds.

TimeStr

Returns the time of image acquisition as a string.

Measurement Methods

Angle

Returns the angle formed by the line between 2 pixel coordinates.

AngleWcs

Returns the angle formed by the line between 2 world coordinates.

AreaUnits

Returns the world coordinate units for area measurements.

DistanceWcs

Returns the distance between 2 world coordinates.

Distance

Returns the distance between 2 pixel coordinates.

DistanceUnits

Returns the world coordinate units for distance measurements.

DistanceWcsStr

Returns as a string the distance between 2 world coordinates.

Val

Returns the pixel value at a pixel coordinate in the form of a number.

ValStr

Returns the image value at a pixel coordinate in the form of a string.

Coordinate Methods

CoordUnits

Returns the coordinate units for an image axis.

GetAxisLabel

Returns the coordinate label for an image axis.

GetImageScale

Returns the image scale in world coordinates per pixel.

GetImageScaleXy

Returns the x and y axis image scale of the x and y axis in world coordinates per pixel.

PtInside

Returns true if a pixel coordinate is inside the image.

WcsToXy

For a world coordinate, returns the pixel coordinate.

WcsIsEq

Returns true if the image has an equatorial world coordinate calibration.

XyToWcs

For a pixel coordinate, returns the world coordinate in numeric form.

XyToWcsStr

For a pixel coordinate, returns the world coordinate in string form.

Math Methods

These methods work with image data in all supported data types, including 8, 16, and 32 bit integer, 32 and 64 bit real, 16 bit unsigned, and 24 bit color. Some operations also support 48 bit color.

Abs

Computes the absolute value of the image pixels.

Add

Adds an operand image.

AddNoise

Adds Gaussian random noise to a region.

Addx

Adds a numeric value.

Blend

Blends the values of the image with an operand image.

Blendx

Blends the image values with a numeric value.

Byteswap

Swaps the byte order of the pixels.

Chs

Changes the sign of the image values.

Div

Divides by an operand image.

Divx

Divides by a numeric value.

Exp

Raises base e to powers specified by the image pixels.

ExtractByte

Extracts an image consisting of a specific byte plane.

Log

Computes the base-e logarithm of the pixel values.

Log10

Computes the base-10 logarithm of the pixel values.

Mod

Calculates the remainder of division by an operand image.

Modx

Computes the remainder of division by a numeric value.

Mul

Multiplies by an operand image.

Mulx

Multiplies by a numeric value.

PixGE

Returns the coordinate of the first pixel value >= target value.

PixGELE

Returns the coordinate of the first pixel value >= target 1 or <= target 2.

PolyFitSub

Fits and subtracts a polynomial from the image.

PolyFitDiv

Fits and divides a polynomial into the image.

PolyFitImage

Fits a polynomial and evaluates it to replace the image.

Pow

Raises the image values to a power.

Powa

Raises a base value to powers specified by the image pixels.

Powab

Raises the image pixels to the power defined by the pixels of an operand image.

Recip

Computes the reciprocal of the pixel values.

RgbExtract

Creates an image consisting of a color channel from an RGB image.

ScaleLinVal

Applies a linear scaling to the pixel values.

ScalePolyVal

Applies a polynomial intensity correction.

SetDatatype

Changes the image Data type specified by an index value.

SetRegionVal

Sets the values of pixels inside a rectangular region.

SetVal

Sets the pixel value at a pixel coordinate.

Sqrt

Computes the square root of the image values.

Sub

Subtracts an operand image.

Subx

Subtracts a numeric value.

Xdiv

Divides the image values into a numeric value.

Xsub

Subtracts the image values from a numeric value.

Image Geometry Methods

Affine

Applies an affine transformation of shift, scale, and rotation.

BlockAvg

Averages pixel values into m x n super-pixels.

BlockSum

Sums pixel values into m x n super-pixels.

Crop

Crops a smaller piece from the image.

DimEq

Tests whether 2 images have the same dimensions.

Expand

Expands the image into a larger canvas, optionally with a specified border value and/or random noise.

Hflip

Flips the image horizontally.

Imbed

Imbeds the image at a specific location in another image.

Reorient

Reorients the image in various quadrant transformations.

Rot180

Rotates the image 180 degrees.

Rot270

Rotates the image 270 degrees.

Rot90

Rotates the image 90 degrees.

Rotate

Rotates the image by an angle about its center.

RotatePt

Rotates the image by an angle about a given point.

Scale

Scales the image by a magnification factor.

ScaleXy

Scales the image independently by magnification factors in the x and y directions.

Shift

Shifts the image by whole or fractional pixel amounts

Transpose

Flips the image about its main diagonal.

Vflip

Flips the image vertically.

Keyword Methods

KwdDelete

Deletes a keyword from the image header.

KwdExists

Returns true if the named keyword exists in the image header.

KwdGetNum

Returns a numeric value keyword.

KwdGetNumEx

Returns a numeric value keyword plus a boolean flag indicating that the keyword is in the image header.

KwdGetSect

Returns the 4 column and row limits stored in a region section keyword, like BIASSEC.

KwdGetSectEx

Returns the 4 column and row limits stored in a region section keyword (e.g., BIASSEC), plus a boolean flag indicating that the keyword is in the image header.

KwdGetStr

Returns a string value keyword.

KwdGetStrEx

Returns a string value keyword plus a boolean flag indicating that the keyword is in the image header.

KwdGetVal

Returns the value of a keyword in any format (string, number, etc.) as a string.

KwdGetValEx

Returns the value of a keyword in any format (string, number, etc.) as a string and also a boolean flag indicating that the keyword is in the header.

KwdSetBlank

Adds a blank keyword to the image header.

KwdSetBlankStr

Adds a blank keyword with string value to the image header.

KwdSetBool

Sets the value of a boolean T/F keyword or adds the keyword to the image header.

KwdSetComment

Adds a comment keyword to the image header.

KwdSetDate

Sets the value of a date keyword or adds the keyword to the image header.

KwdSetHistory

Adds a history keyword to the image header.

KwdSetNum

Sets the value of a numeric keyword or adds the keyword to the image header.

KwdSetSect

Sets a region section keyword (e.g., BIASSEC) using the 4 column and row limits passed as numbers

KwdSetStr

Sets the value of a string keyword or adds the keyword to the image header.

KwdSetTime

Sets the value of a time keyword or adds the keyword to the image header.

KwdSetVal

Sets the value of a keyword or adds the keyword to the image header.

Image Processing Methods

ApplyPixelMask

Applies a pixel mask to repair image blemishes.

CreatePixelMask

Creates a mask file for pixels above or below threshold values.

CreatePixelMaskHigh

Creates a mask file for pixels above a threshold value.

CreatePixelMaskLow

Creates a mask file for pixels below a threshold value.

SetMaskedValue

Sets pixel values at coordinates identified in a pixel mask.

SubBiasFrame

Subtract a bias frame from the image.

SubBiasVal

Subtract a bias value from the image.

SubBiasRef

Subtract a reference bias value stored in a header keyword.

SubBiasCol

Compute and apply a column bias correction.

SubBiasRow

Compute and apply a row bias correction.

SubDarkFrame

Subtracts a dark frame from the image.

SubDarkScaled

Subtracts a time-scaled dark frame from the image.

SubDarkOpt

Subtracts a statistically optimized dark frame from the image.

DivFlatFrame

Divides the image by a flat field frame.

DivFlatNorm

Divides the image by a flat field frame while normalizing the flat during the calculation.

Filtering Methods

FiltBinomial

Smooths the image using a binomial weight rectangular kernel.

FiltClipHigh

Replaces pixel values above a threshold value.

FiltClipLow

Replaces pixel values below a threshold value.

FiltEllipse

Smooths the image using an equal weight elliptical kernel.

FiltGaussian

Smooths the image using a Gaussian weight elliptical kernel.

FiltGradient

Applies a directional derivative gradient filter.

FiltKernel

Applies a user-defined kernel.

FiltLaplacian

Applies a Laplacian filter, usually for edge detection.

FiltLine

Applies a directional line selection kernel.

FiltMax

Applies a maximum value filter.

FiltMedian

Applies a median filter.

FiltMin

Applies a minimum value filter.

FiltPrewitt

Applies a Prewitt directional gradient mask.

FiltRank

Applies a rank value filter.

FiltRect

Smooths the image using an equal weight rectangular kernel.

FiltRotGrad

Applies a rotational gradient filter to enhance rotational or "spoked" features.

FiltSharpen

Sharpens the image using a crispening filter.

FiltSobel

Applies a Sobel edge filter.

FiltUnsharpMask

Sharpens the image using unsharp masking.

 

CImageSet Class

The CImageSet class manages a list of CImage objects. The class contains methods for working with Mira Image Sets.

Set

Use this method for indexing the CImageSet using the [] array syntax. For example, S.Set[3] returns a pointer to image 3 in the CImageSet object S.

new

Creates a new instance of the CImageSet class

delete

Deletes the instance of the CImageSet object.

Copy

Copies the CImageSet to a new CImageSet

Append

Appends a CImage at the end of the set.

Count

Returns the number of CImage objects in the set.

GetImage

Returns the CImage from the specified set index.

Insert

Inserts a CImage at a specified set index.

RemoveAt

Removes the CImage at a specified set index.

RemoveFirst

Removes the CImage from the head of the set.

RemoveLast

Removes the CImage from the tail of the set.

Remove

Removes the CImage object from the set.

 

CImageView Class

The CImageView class works with a Mira image window that displays images. The Image View window uses an image set to work with a group of images. This class encloses a pointer to the view window and provides methods for displaying and adjusting images and for working with the image cursor.

new

Creates a new CImageView object. This is the global script counterpart of the GetParent method.

delete

Deletes the CImageView object.

Attach

Attaches a Mira image view window to this CImageView object.

AttachFromList

Creates a new CImageView and attaches the image window selected from a list of all open image windows.

GetParent

Creates a new instance of a CImageView and attaches the calling image window to it. This is the class script counterpart of the new method.

GetViewPtr

Returns a pointer to the Mira image view window attached to the CImageView object.

Image Display Methods

Append

Appends the CImage object to the image view window's image set, making it the last image in the image set. Creates a new image view window if necessary.

Display

Creates a new image view window and displays a CImage object in it.

Insert

Inserts the CImage object into the image set at a specified index and displays the image. Creates a new window if necessary.

Image Set Methods

Count

Returns the number of images in the image set used by the image view window.

First

Indexes the image set to the first image.

GetImage

Creates and returns a CImage object for the view image at a specified index.

GetImagePtr

Returns a pointer to the image at a specified index of the image set. May also return the current image.

GetImageSet

Returns a copy of the CImageView's image set as a new CImageSet.

GetIndex

Returns the image set index of the CImage object in the image set of the image view window.

Last

Indexes the image set to the last image.

Next

Indexes the image set to the next image.

Prev

Indexes the image set to the previous image.

Remove

Removes the CImage from the image set and deletes it from memory.

SetIndex

Indexes the image set to a specified position.

SwapNext

Swaps the CImage object with the next image in the image set of the view window.

SwapPrev

Swaps the CImage object with the previous image in the image set of the view window.

Image Cursor Methods

GetCursorPos

Returns the cursor center position in pixel coordinates.

GetCursorRect

Returns a CRect object that describes the image cursor.

SetCursorExtent

Sets the image cursor rectangle using (left, top, right, bottom) in pixel coordinates.

SetCursorHeight

Sets the height of the image cursor, in pixels.

SetCursorPos

Centers the image cursor to pixel coordinate x,y.

SetCursorPosWcs

Centers the image cursor at world coordinate x,y.

SetCursorRect

Sets the image cursor using a CRect object in pixel coordinates.

SetCursorStyle

Sets the image cursor style.

SetCursorWidth

Sets the width of the image cursor, in pixels.

Window Methods

CenterAt

Centers the image at pixel coordinate x,y.

CenterAtWcs

Centers the image at world coordinate x,y.

GetGraphSet

Returns the graph one/all flag for the image set of the image view window.

GetMeasureSet

Returns the measure one/all flag for the image set of the image view window.

GetProcessSet

Returns the process one/all flag for the image set of the image view window.

GetZoom

Returns the image zoom value.

GraphSet

Sets the graph one/all flag for the image set in the image view window.

MeasureSet

Sets the measure one/all flag for the image set in the image view window.

ProcessSet

Sets the process one/all flag for the image set in the image view window.

SetZoom

Sets the image zoom value.

Update

update the display after changing an image.

UpdateAll

update the display of all images in the window.

SetFlipFITS

Sets the option for flipping FITS image display.

GetFlipFITS

Gets the current state of the FITS flip flag.

GetPlotAvgModeSet

Returns the column/row averaging flag for making cursor plots.

SetPlotAvgMode

Sets the cursor plot averaging mode to mean, median, or sum.

 

CImCombine Class

The CImCombine class contains methods for combining images in various ways. The processing methods take their images from a CImageSet collection of images

The combining methods operate in the "depth" direction through the image set. Each pixel location is considered in turn, and all values in the images at that single location are combining using the specified method. This procedure is repeated for each pixel location in the image.

The available combining methods fall into 2 groups: The first group of methods merge individual images into a single, higher quality image according to the mean, median, or other statistical averaging process applied at each pixel location. The second group produces an image showing the properties of the image collection at each location, such as the range of pixel values or the standard deviation among the images. Methods in the first group are further split into two subgroups: those that compute means and weighted means and those that perform some type of bad data rejection, or "clipping".

new

Creates a new instance of the CImCombine class. A default constructor and a copy constructor are available.

delete

Deletes the instance of the CImCombine object.

Copy

Copies the CImCombine to a new CImCombine

SaveState

Saves the current class member data so they can be restored later.

RestoreState

Restores all class members to their last saved state.

Weighted Means and Related Procedures

These methods combine all pixels of all images using some form of weighting scheme

ContraMean

Merges images using contra-harmonic mean weighting at each location. The exponent is a required parameter.

GeometricMean

Merges images by the geometric mean at each pixel location.

Mean

Merges images by the mean value using equal weight at each pixel location.

Median

Merges images using the median value at each pixel location.

Rank

Merges images by choosing the pixel at a given rank at each location. The rank percentile is a parameter.

Sum

Merges images using the sum of values at each pixel location.

YpMean

Merges images using power law weighting at each location. The exponent, Yp, is a required parameter.

Rejection Methods

These methods discard the pixels from some of the images if they do not meet some criterion for inclusion. These methods differ on the type of criterion they use. All use parameters to control the rejection criterion, although the parameters may be "hard-wired", such as the min/max clipping which always rejects both the highest and the lowest pixel values from the mean.

AlphaClip

Merges images after clipping a selected number high and low outlying pixel values at each pixel location.

KwdWeightedMean

Merge images using a weighted mean based on the value of a header keyword.

MaskedMean

Merges images by the mean value after excluding 0-value pixels at each location.

MaxClip

Merges images after clipping the maximum pixel value at each location.

MmClip

Merges images after excluding the minimum and maximum values at each location.

MtmSigmaClip

Merges images using a modified trimmed mean by clipping high and low outlying values based on the standard deviation at each location.

RankClip

Merges images by the mean value after excluding values outside upper and lower rank percentiles at each location.

SigmaClip

Merges images using the mean value after clipping high and low outlying values based on the standard deviation at each location.

WeightedMean

Merge images using a weighted mean based on an array of weight values.

Other Merging Methods

Max

Merges images using the maximum value at each pixel location.

Min

Merges images using the minimum value at each pixel location.

MmClipRange

Creates an image showing the range of pixel values excluding the highest and lowest values at each location.

Range

Creates an image consisting of the range of values within the image set.

Sdev

Creates an image consisting of the standard deviation among pixels at each location.

Normalization Methods

These methods control the image normalization procedure

SetNormMethod

Sets the arithmetic method used to correct images to common statistical level. The options are scale, offset, and none.

SetNormStat

Sets the normalization statistic used for adjusting images to similar signal levels before combining.

SetRect

Sets the rectangle used for computing the normalization statistic.

SetRelRect

Sets a fractional rectangle for computing the normalization statistic.

Other Methods

GetErrorMsg

Returns the error message when combining fails.

SetVerbose

Sets verbose method on or off.

SetRefImage

Sets the index of the reference image in the image set.

SetTitle

Sets the title of the message window used in verbose mode.

SetAdjustExptime

Sets the state of the exposure time adjustment flag.

RGB Combining Methods

RgbMerge

Merge color channel images into an RGB image.

 

CLabels Class

The CLabels class applies labels to displayed images. This class works with the CImageView class, which itself manages the displayed images

new

Creates a new instance of the CLabels class. Various constructors are available.

delete

Deletes the instance of the CLabels object.

Add

Adds a label to the specified image.

Attach

Attaches the CLabels class to a CImageView.

Preferences

Opens the Labels Preferences dialog for setting all label preferences.

 

CMatrix Class

The CMatrix class manages a 2-dimensional matrix. The members (or elements) of the matrix are usually numbers but may be any type of value, such as strings or references to other types. The class implements a matrix as a Lua table of (row, CArray) pairs, with each row being a CArray of (column, value) pairs. See the detailed description of the CMatrix class in "Working with Matrices".

new

Creates a new instance of the CMatrix class. Various constructors are available.

delete

Deletes the instance of the CMatrix object.

Empty

Empties the contents of the CMatrix but does not delete it.

Copy

Copies this CMatrix to a new CMatrix

Dump

Lists all matrix elements in a text window.

GetRow

Returns the CArray used for a row.

Get

Returns the value at a (row, column) position in the matrix.

RowExists

Returns true if a specified row exists.

Exists

Returns true if a value exists at the (row, column) index.

Set

Sets the value at a row, column index.

RemoveRow

Deletes an entire row from the matrix.

Remove

Removes the value at a (row,column) index.

Init

Initializes all row x column entries to a value.

Members

Returns a count of total defined members.

Rows

Returns the number the maximum row index used.

RowsUsed

Returns the number of rows actually initialized.

Cols

Returns the maximum column index used in any row.

ColsUsed

Returns the number of columns initialized in any row.

Count

Returns the number of rows actually initialized.

Math Methods

Normalize

Normalizes to a volume of 1.0.

Volume

Returns the sum of all matrix members.

 

CPlotView Class

The CPlotView class displays 1-dimensional data in a Mira Plot Window. This class can plot data from the following sources:

  • An internal data matrix belonging to the class. The matr