Mira Pro x64 Script User's Guide
Contents
New Features
Mira Support
About this Document
Working with Scripts in Mira
Overview
Working with Scripts
Script Editor Window
Running Scripts shown in the User's Guide
Using the Script Manager
Benchmarks
The Mira Pro Script Language
Creating a Simple Script
Comparison with C and C++
Using Classes in your Scripts
Creating Classes
Master list of Script Classes
Tables and Arrays in Mira Pro Script
Going Further with Lua
Script Classes
Master list of script classes
CApphot
Class Description
Data Members
Non-class Creator Function
new_apphot
Construction and Destruction
new
delete
Operations
Copy
GetImageParams
Measure
SetBgMethod
Getting Results and Properties
X position
Y position
GetErrMsg
GetStatusCode
BgValue
BgValueErr
Mag
MagErr
MagErrT
NetCount
NetCountErr
NetCountErrT
SNR
SNRT
CArray
Class Description
Non-class Creator Function
new_array
Construction and Destruction
new
delete
Operations
Copy
Count
Dot
Empty
Exists
Get
Init
MaxIndex
Remove
Set
CCentroid
Class Description
Non-class Creator Function
new_centroid
Construction and Destruction
new
delete
Getting Results and Properties
GetSample
SetSample
GetSign
SetSign
GetTracking
SetTracking
X
Y
Operations
Calc
CColorRef
Class Description
Non-class Creator Function
new_colorref
Construction and Destruction
new
delete
Getting Properties
Get
Operations
Choose
ChoosePal
Invert
ToGray
Set
Other Topics
Visual Response Weighted Intensity
CFile
Class Description
Non-class Creator Function
new_file
Construction and Destruction
new
delete
Operations
Read
ReadBswap
Write
WriteBswap
Close
FilePos
Flush
GetPath
Open
Printf
Seek
File Access Modes
CFileDlg
Class Description
Class Properties
Non-class Creator Function
new_filedlg
Construction and Destruction
new
delete
Operations
Open
Save
Start
Next
CFileList
Class Description
Non-class Creator Function
new_filelist
Construction
new
delete
Operations
Close
Count
Next
Open
Start
CFindFiles
Class Description
Non-class Creator Function
new_findfiles
Construction and Destruction
new
delete
Operations
Close
GetPath
Next
Open
Start
CFwhm
Class Description
Non-class Creator Function
new_fwhm
Construction and Destruction
new
delete
Getting Results and Properties
Bg
Peak
Fwhm
X
Y
GetAutoCentroid
SetAutoCentroid
GetMaxRadius
SetMaxRadius
GetSample
SetSample
GetSign
SetSign
GetTracking
SetTracking
Operations
Calc
CGrid
Class Description
GridParams Table
Non-class Creator Functions
new_grid
new_griddlg
new_griddlgmodal
Construction and Destruction
new
delete
Methods
Menus
AddMenu
AddMenuExecute
DeleteMenus
Getting and Setting Cell Contents
Get
Set
SetSH_Title
SetSH_Titles
SetTH_Title
SetTH_Titles
Selecting Cells
FindCell
GotoCell
SH_FindRow
TH_FindCol
Getting and Setting Grid Properties
GetNumCols
GetNumRows
BestFit
JoinCells
Optimize
OptimizeRange
SetBkColor
SetHorzAlign
SetColWidth
SetSH_HorzAlign
SetSH_Width
SetFontColor
SetVertAlign
SetRowStretch
SetTH_RowStretch
SetTH_VertAlign
UnJoinCells
CGridView
Class Description
GridParams Table
Non-class Creator Functions
new_gridview
attach_gridview
attachlist_gridview
Construction and Destruction
new
delete
Attach
AttachFromList
Close
Methods
Class Description
Getting Cell Contents
FindCol
FromTable
GetCol
GetNum
GetRect
GetRow
GetStr
GetType
GetVal
Setting Cell Contents
SetCol
SetNum
SetRect
SetRow
SetStr
SetType
SetVal
ToTable
Selecting Cells
FindCol
FindRow
GotoCell
GetCellStart
GetCellEnd
GetCellDblClick
Getting Grid Properties
GetMaxCol
GetMaxRow
GetNumCols
GetNumRows
GetNumSheets
GetSheet
GetTitle
Setting Grid Properties
AddSheet
BestFit
JoinCells
Optimize
Refresh
SetBkColor
SetHorzAlign
SetFontColor
SetNumCols
SetNumRows
SetVertAlign
SetTitle
UnJoinCells
Sheet Properties
AddSheet
GetNumSheets
GetSheet
SelectSheet
SetTab
CHistogram
Class Description
Non-class Creator Function
new_histogram
Construction and Destruction
new
delete
Operations
Calc
SetBinAuto
SetBinCount
SetBinWidth
SetCorrelated
Getting Binning Properties
GetBinCount
GetBinWidth
GetMax
GetMin
CImage
Class Description
Math operators
Non-class Creator Functions
arraytoimage
attachlist_image
new_image
Construction and Destruction
new
delete
Copy
AttachFromList
Array Operations
ColToTable
RowToTable
RectToTable
ToTable
TableToRect
ExtractByte
ExtractChan
Pixel Operations
GetVal
GetValStr
SetVal
SetRegionVal
SetRegionValExclude
PixGE
PixGELE
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
PixelType
PixelTypeStr
Date
DateStr
DimEq
Exptime
Filter
Gain
ImageType
IsColor
IsInteger
IsNumeric
IsReal
Object
Path
PixelBytes
PixelType
PixelTypeStr
Pixels
Rows
Time
TimeStr
General Methods
Close
Create
Display
Open
Save
SaveAs
SaveTo
Image Math
Abs
Add
AddNoise
Addx
Blend
Blendx
Byteswap
Chs
Div
Divx
Exp
Log
Log10
Mod
Modx
Mul
Mulx
PolyFitDiv
PolyFitSub
PolyFitImage
Pow
Powa
Powab
Recip
RgbExtract
ScaleLinVal
ScalePolyVal
SetPixelType
Sqrt
Sub
Subx
Xdiv
Xsub
Coordinates
GetAxisLabel
GetImageScale
GetImageScaleXy
PtInside
GetWcsType
WcsIsEq
WcsToXy
WcsStrToXy
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
Image Calibration
ApplyPixelMask
CreatePixelMask
CreatePixelMaskHigh
CreatePixelMaskLow
DivFlatFrame
DivFlatNorm
SetMaskedValue
SubBiasFrame
SubBiasRef
SubBiasVal
SubBiasCol
SubBiasRow
SubDarkFrame
SubDarkOpt
SubDarkScaled
CImageSet
Class Description
Non-class Creator Function
new_imageset
Construction
new
delete
Getting Class Properties
Count
GetImage
Operations
Append
Copy
Insert
Remove
RemoveAt
RemoveFirst
RemoveLast
CImageView
Class Description
Non-Class Creator Functions
new_imageview
attach_imageview
attachlist_imageview
Construction and Destruction
new
delete
Attach
AttachFromList
Close
Image Display Methods
Append
Display
Insert
SaveUndo
Undo
SaveUndoAll
UndoAll
Update
UpdateAll
Image Set Operations
Count
First
GetImage
GetImageSet
GetIndex
Last
Next
Prev
Remove
SetIndex
SwapNext
SwapPrev
Image Cursor
GetCursorPos
SetCursorPos
GetCursorRect
SetCursorRect
SetCursorExtent
SetCursorWidth
SetCursorHeight
GetCursorStyle
SetCursorStyle
SetCursorPosWcs
Settings
GetFlipFITS
SetFlipFITS
GetGraphSet
GraphSet
GetMeasureSet
MeasureSet
GetPlotAvgMode
SetPlotAvgMode
GetProcessSet
ProcessSet
Window Operations
CenterAt
CenterAtWcs
GetZoom
SetZoom
CImCombine
Class Definition
Combining Images using Criteria
Non-class Creator Function
new_imcombine
Construction and Destruction
new
delete
Operations
Copy
RestoreState
SaveState
Weighted Means
ContraMean
GeometricMean
KwdWeightedMean
MaskedMean
Mean
Median
Rank
Sum
WeightedMean
YpMean
Rejection Means
AlphaClip
MaxClip
MmClip
MtmSigmaClip
RankClip
SigmaClip
Alignment
AlignWcs
AlignWcs2
AlignWcs3
Other Combining Methods
Max
Min
MmClipRange
Range
RgbMerge
Sdev
Normalization
SetRelRect
SetNormMethod
SetNormStat
SetRect
Miscellaneous Methods
GetErrorMsg
SetAdjustExptime
SetRefImage
SetTitle
SetVerbose
CImExtract
Class Description
ImExtractParams Table
Source Properties Table
Non-class Creator Function
new_mextract
Construction and Destruction
new
delete
Methods
Copy
Count
Extract
GetObject
SetParams
CLabels
Class Description
LabelParams table
Non-class Creator Function
new_labels
Construction and Destruction
new
delete
Methods
Add
Attach
SetParams
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
Non-class Creator Function
new_lsqfit
Construction and Destruction
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
Getting the point status as a string
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
Working with Matrices
Non-class Creator Function
new_matrix
Construction and Destruction
new
delete
Operations
Cols
ColsUsed
Copy
Count
Dump
Empty
Exists
Get
GetRow
Init
Members
Remove
RemoveRow
RowExists
Rows
RowsUsed
Set
Math Operations
Normalize
Volume
CMeasureAngles
Class Description
AngleParams table
Non-class Creator Function
new_measureangles
Construction and Destruction
new
delete
Methods
Add
Attach
SetParams
CMeasureLines
Class Description
LineParams table
Non-class Creator Function
new_measurelines
Construction and Destruction
new
delete
Methods
Add
Attach
SetParams
CMeasurePoints
Class Description
PointParams table
Non-class Creator Function
new_measurepoints
Construction and Destruction
new
delete
Methods
Add
Attach
SetParams
CMeasureRegions
Class Description
RegionParams table
Non-class Creator Function
new_measureregions
Construction and Destruction
new
delete
Methods
Add
Attach
SetParams
CPlot
Class Description
PlotPoint table
Non-class Creator Function
new_plot
Construction and Destruction
new
delete
Methods
Count
FindNearestX
FindNearestY
GetPt
GetX
GetXY
GetY
ToTable
CPlotView
Class Description
Example: Plotting a Least Squares Fit
Comparison of non-Class Plotting Functions
Non-class Creator Functions
new_plotview
attach_plotview
attachlist_plotview
Construction and Destruction
new
delete
Attach
AttachFromList
Close
GetTitle
Plot Series Methods
GetPlot
GetIndex
SetIndex
CountSeries
CountSeriesPoints
Setting the series description
Getting the series description
Data Array Methods
Add
Count
Empty
FindPoint
GetX
GetY
GetErrX
GetErrY
Remove
Point Methods
Count
FindNearestX
FindNearestY
GetPt
GetX
GetXY
GetY
ToTable
Data Plotting Methods
Connect
PlotConnected
Line
PlotLine
Scatter
PlotScatter
StepLine
PlotStepLine
PlotPoints
AddPoints
AddSeries
Image Plotting Methods
PlotImageCol
PlotImageRow
PlotCursorCol
PlotCursorColAvg
PlotCursorColRange
PlotCursorRow
PlotCursorRowAvg
PlotCursorRowRange
Matrix Plotting Methods
PlotMatrix
PlotMatrixRange
AddMatrixRange
PlotMatrixLine
PlotMatrixRangeLine
AddMatrixRangeLine
CPoint
Class Description
Non-class Creator Function
new_point
Construction and Destruction
new
delete
Math Operators
Math Operators
Operations
Ceil
Floor
Offset
Round
Set
CPolynomial
Class Description
Construction and Destruction
new
delete
Copy
Operations
Count
Empty
Exists
Get
Init
MaxOrder
Remove
Set
CRect
Class Description
Non-class Creator Function
new_rect
Construction and Destruction
new
delete
Getting and Setting Properties
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
Non-class Creator Function
new_registry
Construction and Destruction
new
delete
Operations
Open
Close
GetBool
GetInt
GetNum
GetStr
GetRgb
SetBool
SetInt
SetNum
SetStr
SetRgb
CSet
Class Definition
Non-class Creator Function
new_set
Construction and Destruction
new
delete
Operations
Append
Copy
Insert
Remove
RemoveFirst
RemoveLast
RemoveMember
Getting Properties
Count
GetIndex
GetMember
CSplitpath
Class Description
Non-class Creator Function
new_splitpath
Construction and Destruction
new
delete
Getting Path Components
GetDir
GetDrive
GetExt
GetExt2
GetFilename
GetFilenameExt
GetFolder
GetFolder2
GetName
Operations
Merge
SetDir
SetDrive
SetExt
SetFilename
SetFilenameExt
SetFolder
SetName
SetPath
SetSubdir
Split
CStats
Class Description
Non-class Creator Function
new_stats
Construction and Destruction
new
delete
Operations
AlphaClipMean
AlphaClipMeanSdev
ContraMean
ContraMeanSdev
GeomMean
GeomMeanSdev
Kurtosis
Max
MaxXY
MaxPix
MaxClipMean
MaxClipMeanSdev
Mean
MeanSdev
Median
MedianSdev
Min
MinXY
MinPix
MinClipMean
MinClipMeanSdev
MinMaxClipMean
MinMaxClipMeanSdev
MtmSigmaClipMean
MtmSigmaClipMeanSdev
Rank
RankSdev
RankClipMean
RankClipMeanSdev
Sdev
SdevValue
SigmaClipMean
SigmaClipMeanSdev
Stats - returns an indexed table
StatsStr - returns a member table
Skewness
Sum
YpMean
YpMeanSdev
Getting Messages
GetErrMsg
GetStatus
CStrTok
Class Description
Non-class Creator Function
new_strtok
Construction and Destruction
new
delete
Operations
Init
SetDelimiter
Next
CTextView
Class Description
Non-Class Creator Function
new_textview
attach_textview
attachlist_textview
Construction and Destruction
new_textview function
new
delete
Attach
AttachFromList
Close
Operations
Clear
GetTitle
GetWordwrap
Printf
Save
SaveAs
SetWordwrap
CValueSet
Class Description
Non-class Creator Function
new_valueset
Construction and Destruction
new
delete
Operations
Add
Copy
Count
Empty
Get
GetAt
GetKeyAt
GetType
GetValueAt
InsertAt
List
Remove
RemoveAt
Set
SetAt
SetType
Sort
SortKey
ToTable
Table and Array Functions
Overview
Tables and arrays in Mira Pro Script
Array Functions
Overview
add
arraytoimage
div
dot
gaussdev
hist
list
max
maxxy
mean
meansdev
median
mediansdev
min
minxy
mul
norm
random
reverse
sdev
series
sort
sortr
stats
sub
sum
Table Functions
Overview
addn
divn
flatten
flattenn
harmeann
harmeansdevn
ismultidim
list
maxn
maxx
maxxy
meann
meansdev
meansdevn
mediann
mediansdev
mediansdevn
minn
minxy
muln
normn
rankn
sdevn
sdevxn
subn
sumn
tcountn
xdivn
Non-Class Creator Functions
Overview
attach_gridview
attach_imageview
attach_plotview
attach_textview
attachlist_gridview
attachlist_image
attachlist_imageview
attachlist_plotview
attachlist_textview
new_apphot
new_array
new_centroid
new_colorref
new_file
new_filedlg
new_filelist
new_findfiles
new_fwhm
new_grid
new_griddlg
new_griddlgmodal
new_gridview
new_histogram
new_image
new_imageset
new_imageview
new_imcombine
new_imextract
new_labels
new_lsqfit
new_matrix
new_measureangles
new_measurelines
new_measurepoints
new_measureregions
new_plot
new_plotview
new_point
new_rect
new_registry
new_set
new_splitpath
new_stats
new_strtok
new_textview
new_valueset
Plotting Functions
Overview of Plotting Functions
Comparison of non-Class Plotting Functions
CPlotView class
CPlot class
histplot
connect
connecterr
line
lineerr
scatter
scattererr
stepline
steplineerr
plot (alias for connected plot)
Date, Time, and Angle Functions
Overview of date, time, and angle functions
Date functions
CalcHJD
CalcJD
CalcMJD
FormatDate
FormatYmdStr
ParseYmd
ParseJD
JDtoDateTime
DateToYmd
Time functions
DegToHms
HrToHms
HmsToDeg
HmsToHr
FormatTime
FormatHmsStr
ParseHours
ParseHms
Angle functions
DegToDms
DmsToDeg
FormatAngle
FormatDmsStr
ParseDegrees
ParseDms
Calculations
CalcAirmass
CalcHJD
CalcJD
CalcLST
CalcMJD
CalcSphAngle
DayOfWeek
Text Formatting Functions
Overview of text formatting functions
CreateTextWindow
MsgBox
Msg
Msg2
Printf
Sprintf
Wprintf
PixelTypeToStr
StrToPixelType
Directory Functions
Overview of directory functions
GetFileList
GetFileName
GetFolder
change_dir
change_dir_up
get_dir
is_dir
is_file
make_dir
make_file
remove_dir
remove_file
rename_file
Dialog Functions
Overview of dialog functions
GetAbortRetryIgnore
GetChoice
GetFileName
GetFolder
GetItem
GetItemStr
GetNumber
GetRetryCancel
GetString
GetText
GetTrueFalse
GetValue
GetYesNo
GetYesNoCancel
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
Miscellaneous Functions
Overview
AbbrevPath
Assert
Beep
booltostr
Exit
FileOpen
GetFileList
GetFileName
GetFolder
GetFileOpenDlgTitle
GetFileSaveDlgTitle
GetKeyState
GetMathErrVal
GetMathErrValStr
GetViewportSize
Include
PixelTypeToStr
round
SetFileOpenDlgTitle
SetFileSaveDlgTitle
SetMathErrVal
SetResampleParams
StrToPixelType
Data Structures
AngleParams Table
ClassLibInfo Table
GridParams Table
ImExtractParams Table
LabelParams Table
LineParams Table
PointParams Table
RegionParams Table
ResampleParams Table
Coordinate Systems
Image Coordinate System
Pixel Coordinate Definition
Subpixel Coordinate Definition
World Coordinate System
Angle Measurement Definition
Image Display Orientation
FITS Image Orientation
Special Values
nil
true
false
Interface to Mira
Mira Data Types
Image Sets
Image Cursor
Pixel Mask File
Glossary of Terms
Sample Scripts
Examples
Listing Image Information
User-Defined Filter Kernel
An Improved Filter Kernel Script
Error Messages
Compiler Error Messages
Typical Compiler Messages