Mira MX Script
Contents
Tech Support
About this Document
Working with Scripts in Mira
Overview
Working with scripts
Editing scripts
Running scripts
Running scripts listed in this document
Listing error messages
Benchmarks
Using the Script Manager
The Scripting Language
Creating a Simple Script
Comparison with C and C++
Naming Conventions
Protocol for Using Classes
Creating Classes
Master list of Script Classes
Going Further with Lua
Error Messages
Compiler Error Messages
Typical Compiler Messages
Script Classes
Master list of script classes
Format of class reference pages
CApphot Class
Class Description
Class Properties
Initialization
new
delete
Copy
Operations
GetImageParams
Measure
SetBgMethod
Accessing Results
X position
Y position
GetErrMsg
GetStatusCode
BgValue
BgValueErr
Mag
MagError
MagErrorT
NetCount
NetCountErr
NetCountErrT
SNR
SNRT
CArray class
Class Description
Construction
new
delete
Copy
Operations
Count
Dot
Empty
Exists
Get
Init
MaxIndex
Remove
Set
CCentroid class
Class Description
Class Properties
Construction
new
delete
Operations
Calc
X
Y
GetStartingPos
CColorRef
Class Description
Class Properties
Construction
new
delete
Operations
Choose
ChoosePal
Get
Invert
ToGray
Set
Other Topics
Visual Response Weighted Intensity
CFile class
Class Description
Class Properties
File Access Modes
Construction
new
delete
Operations
Read
ReadBswap
Write
WriteBswap
Close
FilePos
Flush
GetPath
Open
Printf
Seek
CFileDlg class
CFileDlg Class Description
Class properties
Construction
new
delete
Operations
Open
Save
Start
Next
CFindFiles class
Class Description
FindFiles function
Construction
new
delete
Operations
Open
Start
Next
Close
GetTable
GetPath
CFwhm class
Class Description
Class Properties
Construction
new
delete
Operations
Calc
Bg
Peak
Fwhm
X
Y
SetCentroid
CGrid class
Class Definition
DefGrid global function
NewGrid global function
Construction
new
delete
AttachGrid
Attach
Grid Configuration
SetDim
SetNumCols
SetNumRows
SetNumSheets
GetNumCols
GetNumRows
GetNumSheets
SelectSheet
DeleteSheet
Columns, Rows, and Cells
Get
GetCol
GetRow
Set
SetCol
SetRow
CGridView class
Class Description
Construction
new
delete
Attach
AttachFromList
GetViewPtr
Operations
AttachHandle
GetHandle
CHistogram class
Class Description
Construction
new
delete
Operations
Calc
SetBinAuto
SetBinCount
SetBinWidth
SetCorrelated
Retrieving Binning Values
GetBinCount
GetBinWidth
GetMax
GetMin
CImage class
Class Description
Class Operators
Deprecated Methods
Construction
newarray
new
delete
Attach
AttachFromList
Copy
Dup
Array (create from array)
Synthetic Images
CreateSynth
SynthGetStar
SynthStarCount
Getting and setting pixel values
Getr
Setr
Getn
Setn
Gets
Get
Set
Working with image regions
SetRegion
SetRegionVal
SetColumn
SetColumnPart
SetRow
SetRowPart
CompareEQ
CompareLE
CompareLT
Headers and Keywords
KwdDelete
KwdExists
KwdGetDms
KwdGetDmsEx
KwdGetHms
KwdGetHmsEx
KwdGetNum
KwdGetNumEx
KwdGetSect
KwdGetSectEx
KwdGetStr
KwdGetStrEx
KwdGetVal
KwdGetValEx
KwdSetStr
KwdSetBlank
KwdSetBlankStr
KwdSetBool
KwdSetComment
KwdSetDate
KwdSetHistory
KwdSetNum
KwdSetSect
KwdSetTime
KwdSetVal
Image Properties
Axes
Bytes
Cols
Darktime
Datatype
DatatypeStr
Date
DateStr
DimEq
Exptime
Filter
Gain
ImageType
IsColor
IsInteger
IsNumeric
IsReal
Len
Object
Path
PixelBytes
Pixels
Planes
Rows
Time
TimeStr
General Methods
Close
Create
Display
GetImagePtr
Open
Save
SaveAs
SaveTo
Image Math
Abs
Add
AddNoise
Addx
Blend
Blendx
Byteswap
Chs
Div
Divx
Exp
ExtractByte
Interp
Log
Log10
Mod
Modx
Mul
Mulx
PolyFitDiv
PolyFitSub
PolyFitImage
Pow
Powa
Powab
Recip
RgbExtract
ScaleLinVal
ScalePolyVal
SetDatatype
Sqrt
Sub
Subx
Xdiv
Xsub
Coordinates
CoordOf
GetAxisLabel
GetImageScale
GetImageScaleXy
Pos
FindFirst
PtInside
WcsIsEq
WcsToXy
XyToWcs
XyToWcsStr
Image Geometry
Affine
Crop
Expand
Expand1d
Expand2d
ExpandOffset
Hflip
Imbed
Mirror
Offset
Offset1d
Offset2d
Reorient
Rot90
Rot180
Rot270
Rotate
RotatePt
Scale
ScaleXy
Shift
Transpose
Vflip
Filtering Methods
Filt Kernel
FiltBinomial
FiltBlockAvg
FiltBlockSum
FiltClipHigh
FiltClipLow
FiltEllipse
FiltGaussian
FiltGradient
FiltKernel
FiltLaplacian
FiltLine
FiltMax
FiltMedian
FiltMin
FiltPrewitt
FiltRank
FiltRotGrad
FiltRect
FiltSharpen
FiltSobel
FiltUnsharpMask
Measurements
Angle
AngleWcs
AreaUnits
CoordUnits
Distance
DistanceWcs
DistanceWcsStr
DistanceUnits
PixGELE
PixGE
Image Calibration
ApplyPixelMask
CreatePixelMask
CreatePixelMaskHigh
CreatePixelMaskLow
DivFlatFrame
DivFlatNorm
SetMaskedValue
SubBiasFrame
SubBiasRef
SubBiasVal
SubBiasCol
SubBiasRow
SubDarkFrame
SubDarkOpt
SubDarkScaled
CImageSet class
Class Description
Operations
Append
Insert
Remove
RemoveAt
RemoveFirst
RemoveLast
Accessors
Count
GetImage
Construction
new
delete
Copy
CImageView class
Class Description
Construction
new
delete
Attach
AttachFromList
GetViewPtr
Image Display Methods
Append
Display
Insert
Image Set Operations
Count
First
GetImage
GetImagePtr
GetImageSet
GetIndex
Last
Next
Prev
Remove
SetIndex
SwapNext
SwapPrev
Image Cursor
GetCursorPos
GetCursorRect
GetCursorStyle
SetCursorExtent
SetCursorHeight
SetCursorPos
SetCursorPosWcs
SetCursorRect
SetCursorStyle
SetCursorWidth
Settings
GetFlipFITS
SetFlipFITS
GetGraphSet
GraphSet
GetMeasureSet
MeasureSet
GetPlotAvgMode
SetPlotAvgMode
GetProcessSet
ProcessSet
Window Operations
CenterAt
CenterAtWcs
GetZoom
SetZoom
Update
UpdateAll
CImCombine class
Class Definition
Combining Images using Criteria
Construction
new
delete
Copy
RestoreState
SaveState
Normalization
SetRelRect
SetNormMethod
SetNormStat
SetRect
Control Options
GetErrorMsg
SetAdjustExptime
SetRefImage
SetTitle
SetVerbose
Weighted Means
ContraMean
GeometricMean
KwdWeightedMean
MaskedMean
Mean
Median
Rank
Sum
WeightedMean
YpMean
Rejection Means
AlphaClip
MaxClip
MmClip
MtmSigmaClip
RankClip
SDevClip
SigmaClip
Other Methods
Max
Min
MmClipRange
Range
RgbMerge
Sdev
CImSynthInfo class
Class Description
Class Properties
Construction
new
delete
Methods
Open
Save
CLabels class
Class Description
Construction
new
delete
Attach
Methods
Add
Preferences
CLsqFit class
Class Description
Quick Fitting functions
FitLine function
FitPoly function
FitPoly2d function
Least Squares Topics
Using the CLsqFit Class
Overview of Least Squares Estimation
Basis functions
Using multiple independent variables
Working with RGB data
Rejecting outliers from the fit
Forcing coefficient values
Using CLsqFit with Image Pixels
Construction
new
delete
Configuring the Fit
SetBasisFunc
GetBasisFunc
SetNumCoefs
GetNumCoefs
SetNumChannels
GetNumChannels
GetBasisDim
Computing the Fit
Fit
DoRejection
GetStatus
GetErrMsg
GetErrChan
Using Data Rejection
SetRejDefault
SetRejSigmaHigh
GetRejSigmaHigh
SetRejSigmaLow
GetRejSigmaLow
SetRejCycles
GetRejCycles
GetNumPtsUsed
GetNumPtsRejected
GetNumPtsDeleted
Working with Fit Results
GetSigmaFit
Eval
GetResid
GetCovar
GetRangeX
GetRangeObs
GetSampleMean
GetNumPts
GetNumPtsUsed
GetNumPtsDeleted
GetNumPtsRejected
Coefficients of the Fit
GetCoef
GetCoefErr
GetPolyCoefIndex
Forcing Coefficients
ForceCoef
UnforceCoef
ResetForcedCoefs
IsCoefForced
Working with Data points
AddPt
AddPtWt
DeletePt
UndeletePt
FindPt
ResetPoints
GetNumPts
Point properties
GePtX
SetPtX
GetPtObs
SetPtObs
GetPtWt
SetPtWt
GetPtStatus
SetPtStatus
Retrieving Table Data
GetObs
GetX
GetWt
CMatrix class
Class Description
Working with Matrices
Construction
new
delete
Copy
Dup
Operations
Cols
Count
Dump
Empty
Exists
Get
GetRow
Init
MaxColsUsed
Members
Remove
RemoveRow
RowExists
Rows
RowsUsed
Set
Math Operations
Normalize
Volume
CMatrixRow
Class Description
Construction
new
delete
Copy
Operations
Count
Dot
Empty
Exists
Get
Init
MaxIndex
Remove
Set
CPlotView class
Class Description
Example: Plotting a Least Squares Fit
Plot Series Modes
Plot Attributes
SetWindowTitle
SetAutoscaleX
SetLabelX
SetMinX
SetMaxX
SetPosX
SetAutoscaleY
SetLabelY
SetMaxY
SetMinY
SetPosY
Construction
new
delete
Attach
GetViewPtr
AttachHandle
GetHandle
Plot Series Methods
GetIndex
SetIndex
CountSeries
CountSeriesPoints
SetSeriesMode
GetSeriesMode
SetCaption
GetCaption
SetDescription
GetDescription
Data Array Methods
Add
Count
Empty
FindPoint
GetX
GetY
GetErrX
GetErrY
LineTo
LineToMarker
Marker
MoveTo
Remove
Point Plotting Methods
PlotPoints
AddPoints
AddSeries
Matrix Plotting Methods
PlotMatrix
PlotMatrixRange
AddMatrixRange
PlotMatrixLine
PlotMatrixRangeLine
AddMatrixRangeLine
Image Plotting Methods
PlotImageCol
PlotImageRow
PlotCursorCol
PlotCursorColAvg
PlotCursorColRange
PlotCursorRow
PlotCursorRowAvg
PlotCursorRowRange
Plot Legends
SetLegendStyle
GetLegendStyle
SetLegendBoxEnable
GetLegendBoxEnable
SetLegendColor
GetLegendColor
SetLegendBoxColor
GetLegendBoxColor
SetLegendText
GeLegendText
SetLegendEnable
GetLegendEnable
CPlot3dView class
Class Description
CPoint class
Class Description
Class Properties
Class Operators
Construction
NewPoint global function
new
delete
Operations
Ceil
Floor
Get
Offset
Round
Set
CPolygon
Class Description
Class Properties
Class Operators
Construction
NewPolygon global function
new
delete
Copy
Standard Configurations
Circle
Ellipse
Rect
Calculated Properties
Area
CalcCenter
CalcRect
Distance
PathLen
Perimeter
PtInside
Mathematical Operations
Rotate
Scale
Shift
Skew
Operations
Add
CopyPts
Count
GetPt
GetRect
DeletePt
Empty
InsertPt
SetPt
CRect class
Class Description
Class Properties
Class Operators
Construction
NewRect global function
new
delete
Accessors
Get
Set
SetToImage
Height
Size
Width
Operations
Ceil
Floor
Inflate
Intersection
Normalize
Offset
PtInside
PtInsideInt
RectInside
Round
Union
CRegistry class
Class Description
Construction
Open
Close
new
delete
Operations
GetBool
GetInt
GetNum
GetStr
GetRgb
GetWnd
SetBool
SetInt
SetNum
SetStr
SetRgb
SetWnd
DeleteKey
CSet class
Class Definition
Construction
new
delete
Copy
Operations
Add
Insert
Remove
RemoveFirst
RemoveLast
RemoveMember
Accessors
Count
GetIndex
GetMember
CSplitpath class
Class Description
Overview of Path Names
Construction
new
delete
Accessors
GetDir
GetDrive
GetExt
GetExt2
GetFilename
GetFilenameExt
GetFolder
GetFolder2
GetName
Operations
Merge
SetDir
SetDrive
SetExt
SetFilename
SetFilenameExt
SetFolder
SetName
SetPath
SetSubdir
Split
CStats class
Class Description
Construction
new
delete
Standard Estimators
ContraMean
Mean
Median
GeomMean
YpMean
Data Rejection Estimators
AlphaClipMean
MaxClipMean
MinClipMean
MinMaxClipMean
MtmSigmaClipMean
RankClipMean
SigmaClipMean
Characterizing Distributions
Max
MaxPix
Median
Min
MinPix
Kurtosis
Moment
Rank
Skewness
Sdev
SdevClip
SdevValue
SdevClipValue
Initialization and status
GetErrMsg
GetStatus
SetImage (deprecated)
CStrTok class
Class Description
Construction
new
delete
Operations
Init
SetDelimiter
Next
CTextView class
Class Description
Construction
new
delete
GetHandle
AttachHandle
Operations
Printf
GetWordwrap
SetWordwrap
Table Functions
Overview
Count
TGaussDev
THist
TList
TMax
TMean
TMedian
TMin
TNorm
TRand
TReverse
TSdev
TSeries
TSort
TSortR
TSum
Variable Argument List Functions
Overview of functions
Count
VMax
VMean
VMin
VSum
Plotting Functions
Global Plotting Functions
Comparison of Global Plotting Functions
PlotLine
PlotConnect
Plot
PlotStep
Global Functions
AttachView
AttachViewFromList
FindFiles
FileOpen
GaussDev
GetFileNameOpen
GetFileNameSave
GetFileNameOpen
Date, Time, and Angle Functions
Angles (degrees)
DegToDms
DmsToDeg
FormatAngle
FormatDmsStr
ParseDegrees
ParseDms
Time (hours)
HrToHms
HmsToHr
FormatTime
FormatHmsStr
ParseHours
ParseHms
Dates
CalcHJD
CalcJD
CalcMJD
FormatDate
FormatYmdStr
ParseYmd
ParseJD
JDtoDateTime
DateToYmd
Calculations
CalcAirmass
CalcHJD
CalcJD
CalcLST
CalcMJD
CalcSphAngle
DayOfWeek
Boolean Math Functions
Overview
Operations
AND
OR
XOR
NOT
NAND
NOR
BitTest
Conversions
Decimal to Hexadecimal
Hexadecimal to Decimal
Hexadecimal to Binary
Binary to Hexadeximal
Decimal to Binary
Binary to Decimal
Trim leading 0's
Dialog Functions
GetAbortRetryIgnore
GetChoice
GetFileName
GetItem
GetItemStr
GetNumber
GetRetryCancel
GetString
GetText
GetTrueFalse
GetValue
GetYesNo
GetYesNoCancel
Text Formatting Functions
List
CreateTextWindow
ErrorMsg
MsgBox
Msg
Msg2
Printf
Sprintf
Wprintf
Miscellaneous Functions
AbbrevPath
Assert
Beep
DatatypeToStr
Exit
GetFileList
GetFileOpenDlgTitle
GetFileSaveDlgTitle
GetFolder
GetKeyState
GetMathErrVal
GetMathErrValStr
GetViewportSize
Include
Round
SetFileOpenDlgTitle
SetFileSaveDlgTitle
SetMathErrVal
SetResampleParams
StrToDatatype
StrToRgb
Data Structures
CSet class
CArray class
CMatrix class
Working with Matrices
ClassLibInfo
ResampleParams
Special Values
nil
true
false
Interface to Mira
Mira Data Types
Image Sets
Image Cursor
Pixel Mask File
Glossary of Terms
Coordinate Systems
Image Coordinate System
Pixel Coordinate Definition
Subpixel Coordinate Definition
World Coordinate System
Angle Measurement Definition
Image Display Orientation
FITS Image Orientation
Sample Scripts
Script Examples
Listing Image Information
User-Defined Filter Kernel
An Improved Filter Kernel Script