Mira Pro Script
Contents
Tech Support
About this Document
Working with Scripts in Mira
Overview
Working with Scripts
Running Scripts from the User's Guide
Editing Scripts
Running Scripts
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
Script Classes
Master list of script classes
Format of Reference Pages
CApphot
Class Description
Data Members
Initialization
new
delete
Copy
Operations
GetImageParams
Measure
SetBgMethod
Fetching Results
X position
Y position
GetErrMsg
GetStatusCode
BgValue
BgValueErr
Mag
MagError
MagErrorT
NetCount
NetCountErr
NetCountErrT
SNR
SNRT
CArray
Class Description
Construction
new
delete
Copy
Operations
Count
Dot
Empty
Exists
Get
Init
MaxIndex
Remove
Set
CCentroid
Class Description
Construction
new
delete
Accessors
GetSample
SetSample
GetSign
SetSign
GetTracking
SetTracking
X
Y
Operations
Calc
CColorRef
Class Description
Construction
new
delete
Accessors
Get
Operations
Choose
ChoosePal
Invert
ToGray
Set
Other Topics
Visual Response Weighted Intensity
CFile
Class Description
Construction
new
delete
Operations
Read
ReadBswap
Write
WriteBswap
Close
FilePos
Flush
GetPath
Open
Printf
Seek
File Access Modes
Construction
new
delete
Operations
Open
Save
Start
Next
CFileDlg Class Description
Class properties
CFindFiles
Class Description
FindFiles function
Construction
new
delete
Operations
Open
Start
Next
Close
GetTable
GetPath
CFwhm
Class Description
Construction
new
delete
Accessors
Bg
Peak
Fwhm
X
Y
GetAutoCentroid
SetAutoCentroid
GetMaxRadius
SetMaxRadius
GetSample
SetSample
GetSign
SetSign
GetTracking
SetTracking
Operations
Calc
CHistogram
CHistogram:Class Description
Construction
new
delete
Operations
Calc
SetBinAuto
SetBinCount
SetBinWidth
SetCorrelated
Retrieving Binning Values
GetBinCount
GetBinWidth
GetMax
GetMin
CImage
Class Description
Construction
new
delete
Attach
AttachFromList
Copy
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
Object
Path
PixelBytes
Pixels
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
Log
Log10
Mod
Modx
Mul
Mulx
PolyFitDiv
PolyFitSub
PolyFitImage
Pow
Powa
Powab
Recip
RgbExtract
ScaleLinVal
ScalePolyVal
SetDatatype
SetRegionVal
SetVal
Sqrt
Sub
Subx
Val
ValStr
Xdiv
Xsub
Coordinates
GetAxisLabel
GetImageScale
GetImageScaleXy
PtInside
WcsIsEq
WcsToXy
XyToWcs
XyToWcsStr
Image Geometry
Affine
Crop
Expand
Hflip
Imbed
Reorient
Rot90
Rot180
Rot270
Rotate
RotatePt
Scale
ScaleXy
Shift
Transpose
Vflip
Filtering Methods
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 Description
Construction
new
delete
Copy
Accessors
Count
GetImage
Operations
Append
Insert
Remove
RemoveAt
RemoveFirst
RemoveLast
CImageView
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 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
SigmaClip
Other Methods
Max
Min
MmClipRange
Range
RgbMerge
Sdev
CLabels
Class Description
Construction
new
delete
Attach
Methods
Add
Preferences
CLsqFit
Class Description
CLsqFit Class Topics
Overview of linear least squares estimation
Basis functions
Working with multiple independent variable
Working with RGB data
Rejecting outliers from the fit
Forcing coefficient values
Example: Using CLsqFit with Image Pixels
Construction
new
delete
Configuring the Fit
Setting the basis function
Getting the basis function
Setting the number of coefficients
Getting the number of coefficients
Setting the number of data channels
Getting the number of data channels
Getting the number of basis dimensions
Computing the Fit
Executing the fit
Enabling bad data rejection
Getting the error message
Getting the error channel
Using Data Rejection
Setting default rejection parameters
Setting the high sigma threshold
Getting the high sigma threshold
Setting the low sigma threshold
Getting the low sigma threshold
Setting the number of rejection cycles
Getting the number of rejection cycles
Getting the number of points used
Getting the number of points rejected
Getting the number of points deleted
Working with Fit Results
Gettng the fit standard deviation
Evaluating new points using the fit results
Getting the point residuals of the fit
Getting covariance matrix values
Getting the range of X values
Getting the range of Y values
Getting the sample means
Getting the total number of points
Getting the number of points used
Getting the number of points deleted
Getting the number of points rejected
Coefficients of the Fit
Getting the coefficient values
Getting the coefficient errors
Converting polynomial indices to one index
Forcing Coefficients
Forcing a coefficient to a value
Restoring a forced coefficient
Restoring all forced coefficients
Determining if a coefficient is forced
Working with Data points
Adding a point
Adding a weighted point
Deleting a point
Restoring a deleted point
Finding a point from its coordinates
Resetting the point sample
Getting the total number of points
Point properties
Getting the independent variables
Setting the independent variables
Getting the observed value
Setting the observed value
Getting the point weight
Setting the point weight
Getting the point status
Setting the point status
Retrieving Table Data
Getting an array of observation values
Getting an array of x values
Getting an array of weight values
CMatrix
Class Description
Construction
new
delete
Copy
Operations
Cols
ColsUsed
Count
Dump
Empty
Exists
Get
GetRow
Init
Members
Remove
RemoveRow
RowExists
Rows
RowsUsed
Set
Math Operations
Normalize
Volume
Other Topics
Working with Matrices
CPlotView
Class Description
Example: Plotting a Least Squares Fit
Construction
new
delete
Attach
GetViewPtr
Plot Series Methods
GetIndex
SetIndex
CountSeries
CountSeriesPoints
Getting the series display mode
Getting the series caption
Setting the series description
Getting the series description
Data Array Methods
Add
Count
Empty
FindPoint
GetX
GetY
GetErrX
GetErrY
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
CPolynomial
Class Description
Construction
new
delete
Copy
Operations
Count
Empty
Exists
Get
Init
MaxOrder
Remove
Set
CRect
Class Description
Construction
new
delete
Accessors
Get
Set
SetToImage
Xmin
Xmax
SetXmin
Xmax
SetXmax
Ymin
SetYmin
Ymax
SetYmax
Height
Size
Width
Operations
Floor
Inflate
Intersection
Normalize
Offset
PtInside
PtInsideInt
RectInside
Round
Union
CRegistry
Class Description
Construction
Open
Close
new
delete
Operations
GetBool
GetInt
GetNum
GetStr
GetRgb
SetBool
SetInt
SetNum
SetStr
SetRgb
CSplitpath
Class Description
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
CSet
Class Definition
Construction
new
delete
Copy
Operations
Append
Insert
Remove
RemoveFirst
RemoveLast
RemoveMember
Accessors
Count
GetIndex
GetMember
CStats
Class Description
Construction
new
delete
Initialization
Init
SetImage
SetRect
Accessors
GetErrMsg
GetStatus
Operations
AlphaClipMean
ContraMean
GeomMean
Kurtosis
Max
MaxPix
MaxClipMean
Mean
Median
Min
MinPix
MinClipMean
MinMaxClipMean
MtmSigmaClipMean
Rank
RankClipMean
Sdev
SigmaClipMean
Skewness
YpMean
CStrTok
Class Description
Construction
new
delete
Operations
Init
SetDelimiter
Next
CTextView
Class Description
Construction
new
delete
GetViewPtr
Operations
GetWordwrap
Printf
SetWordwrap
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
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
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
Examples
Listing Image Information
User-Defined Filter Kernel
An Improved Filter Kernel Script