The New CCD Astronomy Home Page
<% if entryOK Then %> <% else %> <% end if %>

MaxIm DL Objects, Properties, and Methods

Application Object

Properties

AutoFocus

AutoFocusStatus

CCDCamera

CurrentDocument

FirstDocument

NextDocument

CalMedianDark [= boolean]

CalMedianFlat [= boolean]

CalScaleType [= long]

CalAutoFlat [= boolean]

LockApp [= boolean]

CalManualScale [= float]

Documents

CalMasterBias

CalMasterDark

CalMasterFlat

Methods

Blink (Interval [, Images])

CalAddBias(FilePath)

CalAddDark (FilePath)

CalAddFlat (FilePath)

CalClear()

CalSet()

CompareImages (LeftImage, RightImage)

SetCMYCoeffs (CR, CG, CB, MR, MG, MB, YR, YG, YB)

SetRGBCoeffs (RR, GG, BB)

TileHorizontal()

TileVertical()

Focuser Object

Properties

Absolute

IsMoving

Link [= Boolean]

MaxIncrement

MaxStep

Position

StepSize

TempComp [= Boolean]

TempCompAvailable

Temperature

Methods

Halt()

SetupDialog()

Move (Position)

 

Camera Object

Properties

AutoDownload (Boolean)

BinX [= Short]

BinY [= Short]

CameraName

Calibrate [= Boolean]

CameraXSize

CameraYSize

CanSetTemperature

CoolerOn [= Boolean]

DisableAutoShutdown [= Boolean]

Document

FastReadout [= Boolean]

Filter [= Short]

FilterNames

FilterName

FWHM

GuiderArray

GuiderAutoSelectStar [= Boolean]

GuiderDeclination

GuiderName

GuiderRunning

GuiderXError

GuiderXSize

GuiderXStarPosition

GuiderYError

GuiderYSize

GuiderYStarPosition

HalfFluxDiameter

HasFilterWheel

HasShutter

ImageArray

ImageReady

LinkEnabled [= Boolean]

MaxBinX

MaxBinY

MaxPixel

MaxPixelX

MaxPixelY

NumX [= Short]

NumY [= Short]

PixelSizeX

PixelSizeY

PowerOfTwoBinning

ReadyForDownload

ShutterOpen

StartX [= Short]

StartY [= Short]

Temperature

TemperatureSetpoint [= Double]

XYBinning

Methods

AbortExposure()

Calibrate()

Expose (Duration, Light [, Filter])

GuiderCalibrate (Duration)

GuiderExpose (Duration)

GuiderMoveStar (X, Y)

GuiderSetStarPosition (X, Y)

GuiderStop()

GuiderTrack (Duration)

Quit()

SaveImage (FilePath)

SetFITSKey (Key, Value)

SetFullFrame()

ShowWindow (Show)

StartDownload

Document Object

Properties

Color [= boolean]

DisplayName [= string]

DoNotClose [= boolean]

ImageArray [= array]

MouseAnnulusWidth

MouseDown

MouseGapWidth

MouseNewClick

MouseRadius

MouseUp

MouseX

MouseY

StretchMax [= float]

StretchMin [= float]

XSize [= short]

YSize [= short]

Methods

Add (OtherDocument)

AddConstant (Offset)

AddNoise (Type, Amplitude)

AdjustSaturation (Saturation)

AlignImages (Mode, Bicubic[, Images])

Calibrate()

ColorBalance (RScaling, GScaling, BScaling [, BgdR, BgdG, BgdB])

ColorSmooth (Type, Weight, Cutoff)

CombineColor (Method, BgdAutoEqualize, RDoc, GDoc, Bdoc [, LDoc, LWeight])

CombineFiles (FilePath, Mode, Bicubic, Output, Normalize)

CombineImages (Mode, Bicubic, Output, Normalize[, Images])

ConvertColor (CameraType, ScaleR, ScaleG, ScaleB, XOffset, YOffset [, BgdR, BgdG, BgdB])

ConvertToMono()

Crop (XOffset, YOffset, Width, Height)

DDP (Type, AutoBgd, AutoMidLevel, Bgd, MidLevel, Cutoff)

Divide (OtherDocument)

DoubleSize()

FFTFilter (Type, Cutoff, Weight)

FlattenBackground()

Flip()

GetFITSKey(Key)

HistogramSpec (Curve)

KernelFilter (Type [, ThresholdOrKernelSize])

LocalAdaptiveFilter (Radius, Contrast)

MakePixelsSquare()

Mirror()

Multiply (OtherDocument)

OpenFile (FilePath)

PseudoColor (Scheme, Cycles, ReverseMap, MapType)

RankFilter (Radius, Weight)

RemoveBadPixels (MapName, Noise)

RemoveGradient()

Resize (NewWidth, NewHeight)

Rotate (Angle, Bicubic)

RotateLeft()

RotateRight()

SaveFile (FilePath, FileFormat, AutoStretch[, SizeFormat, CompressionType])

ScaleConstant (Value)

SetFITSKey (Key, Value)

SplitTricolor()

Stretch (Type, Gamma, OutputRange, InputRange [, Min, Max])

Subtract (OtherImage

UnsharpMask (Type, MaskWeight, GeoMeanMask, Cutoff)

Application Object

Property

Description

AutoFocus

This method starts an autofocus cycle. A compatible focuser and camera must be present. Use AutofocusStatus to determine when the autofocus function completes, and to determine whether it suceeded or failed.

AutoFocusStatus

Returns the status of the current or previous autofocus operation started using the Autofocus method. A return value of 0 means the operation failed, 1 means the operation suceeded, and -1 means the operation is in progress.

CCDCamera

Returns the application's CCDCamera object.

CurrentDocument

Returns a Document object corresponding to the image window that currently has the focus.

FirstDocument

Used in conjunction with NextDocument to access currently-open documents.  Call FirstDocument to get the first document in the list, followed by NextDocument to get successive documents.

Note:  The preferred way of doing this is to use the Documents collection.

NextDocument

Used in conjunction with FirstDocument to access currently-open documents.  Call FirstDocument to get the first document in the list, followed by NextDocument to get successive documents.

CalMedianDark [= boolean]

Turns on or off the median combine mode for dark frames.

CalMedianFlat [= boolean]

Turns on or off the median combine mode for flat-field frames.  When median combine mode is on, flat-field frames are automatically normalized.

CalScaleType [= long]

Sets the calibration scaling type, as follows:  0 = no scaling, 1 = auto scale, 2 = auto optimize, 3 = manual.

CalAutoFlat [= boolean]

If CalScaleType = 1, then setting this true will cause the flat-field frames to be calibrated using scaled dark frames.  If CalScaleType <> 1, then this has no effect.

LockApp [= boolean]

Prevents the application from closing when all COM objects are closed.

CalManualScale [= float]

Sets the manual dark frame scale factor for calibration.

Documents

Returns a collection of all of the currently open documents.

CalMasterBias

Creates a master bias frame, and returns the result in a document.  The calibration must have been set up, but no calibrations performed.

CalMasterDark

Creates a master dark frame, and returns the result in a document.  The calibration must have been set up, but no calibrations performed.

CalMasterFlat

Creates a master flat-field frame, and returns the result in a document.  The calibration must have been set up, but no calibrations performed.

Method

Description

Blink (Interval [, Images])

·         Long Interval - Specifies the duration each image is displayed in milliseconds

·         Collection Images  - A collection of MaxIm image documents

This method is equivalent to the Blink command.  Each image will be displayed for Interval milliseconds.  If Images is present, it must be a collection of MaxIm documents; these are the images that will be blinked.  If Images is not present, then all open documents are blinked.

WARNING:  The blink command can only be stopped by user action; i.e. clicking the Close button on the Blink dialog box.  This method will not return until this is done, so calling this method will freeze the interface.

CalAddBias(FilePath)

·         VARIANT FilePath  - Path to file

Returns: Boolean - true if successful

This method adds one or more files to the list of images to be combined to construct a bias frame. The filename portion of FilePath may contain the wildcard characters ? and * in order to specify multiple files. See CalClear and CalSet for more information. Returns False if the file cannot be opened

CalAddDark (FilePath)

·         VARIANT FilePath  - Path to file

Returns:  Boolean

This method adds one or more files to the list of images to be combined to construct a dark frame. The filename portion of FilePath may contain the wildcard characters ? and * in order to specify multiple files. See CalClear and CalSet for more information. Returns False if the file cannot be opened.

CalAddFlat (FilePath)

·         VARIANT FilePath  - Path to file

Returns:  Boolean

This method adds one or more files to the list of images to be combined to construct a flat-field frame. The filename portion of FilePath may contain the wildcard characters ? and * in order to specify multiple files. See CalClear and CalSet for more information. Returns False if the file cannot be opened.

CalClear()

Clears any previous calibration settings, in preparation for the use of CalAddBias, CalAddDark, and CalAddFlat.  CalSet must be called after all frames have been added.  See CalSet for more information.

CalSet()

Returns: Boolean - true if successful

This method is equivalent to the Set Calibration command.  To set up calibration files, first call CalClear.  Then call CalAddBias, CalAddDark, and CalAddFlat as many times as required to pull in all the necessary calibration files.  Then call this method to create the master calibration frames.

CompareImages (LeftImage, RightImage)

·         VARIANT LeftImage - MaxIm document object for left pane

·         VARIANT RightImage - MaxIm document object for right pane

This method is unique to the scripting interface.  Two images must be specified, either by providing document objects, or by passing in strings representing their display names.  The images are then tiled side-by-side for visual comparison purposes.

SetCMYCoeffs (CR, CG, CB, MR, MG, MB, YR, YG, YB)

Initializes the CMY coefficient table used during CombineColor in CMY mode. The coefficient values correspond to the values entered in the Combine Color dialog box; e.g. CR is the scaling factor used when mapping from cyan to red.

SetRGBCoeffs (RR, GG, BB)

·         float RR - Red plane is multiplied by this factor during conversion

·         float GG - Green plane is multiplied by this factor during conversion

·         float BB - Blue plane is multiplied by this factor during conversion

Initializes the RGB coefficient table used during CombineColor in RGB mode.  The RR, GG, and BB values correspond to the values entered in the Combine Color dialog box.

TileHorizontal()

This method is equivalent to the Tile Horizontal command. All non-iconized windows are tiled.

TileVertical()

This method is equivalent to the Tile Vertical command. All non-iconized windows are tiled.

Camera Object

Property

Description

AutoDownload (Boolean)

Used in conjunction with ReadyForDownload and StartDownload. When AutoDownload is set to false, the camera will not read out automatically upon completion of the exposure. Instead, ReadyForDownload is set to true. During an exposure, the client should poll ReadyForDownload periodically, and when it is set to true, it can start the telescope slew to the next object. Once the slew is started, the client should call StartDownload to initiate the camera download process. The camera readout then proceeds normally, and the image can be retrieved once ImageReady is set to true.

AutoDownload defaults to false.

BinX [= Short]

Sets the binning factor for the X axis if XYBinning is True. Sets the binning factor for the X and Y axis if XYBinning is False. Also returns the current value.

BinY [= Short]

Sets the binning factor for the Y axis if XYBinning is True. Ignored if XYBinning is False. Also returns the current value.

CameraName

Returns the name of the selected camera, as it appears on the MaxIm CCD Setup tab.

Calibrate [= Boolean]

Performs a full calibration on the last image downloaded from the camera. The calibration files (bias, dark, and flat) must first be set up via the MaxIm DL application.

CameraXSize

Returns the width of the CCD camera chip in pixels.

CameraYSize

Returns the height of the CCD camera chip in pixels.

CanSetTemperature

If True, the camera’s cooler setpoint can be adjusted. If False, the camera either uses open-loop cooling or does not have the ability to adjust temperature from software, and setting the TemperatureSetpoint property has no effect.

CoolerOn [= Boolean]

Turns on and off the camera cooler, and returns the current on/off state. For most cameras it is recommended to set the cooler setpoint to a high temperature (say +20C) first, and wait a period of time before shutting off the cooler.

DisableAutoShutdown [= Boolean]

When true, the camera will not be automatically shut down when the object is destroyed (i.e. when the script exits). Default value is false.

Document

Returns the document object for the last CCD camera exposure.

FastReadout [= Boolean]

Determines whether the camera is read using the standard speed (low-noise) or high speed (higher noise) mode. Set True for high speed and False for normal speed. This is ignored if the camera does not support fast readout mode. Also returns the current value.

Filter [= Short]

Used to set the filter position to use on the next exposure (unless overridden in the Expose command). For most filter wheels, the wheel will rotate immediately upon the property being set. The first filter slot is zero.

FilterNames

Returns a zero-based array containing BSTR strings corresponding to each of the configured filter slots.

FilterName

Returns the name of the selected filter wheel, as it appears on the MaxIm CCD Setup tab.

FWHM

Returns the Full Width Half Maximum star diameter in pixels, for the brightest star in the current CCD image.

GuiderArray

Returns a safearray of Long of size GuiderXSize * GuiderYSize containing the pixel values from the last exposure. Note that this parameter is not compatible with VBScript or JScript due to the use of Long in the array values.

GuiderAutoSelectStar [= Boolean]

Set True to enable auto-selection of a guide star. The autoguider will automatically select the brightest star in the field prior to any calibration or track commands. If False, the guide star position must be set using GuiderSetStarPosition. This property also returns the current value.

GuiderDeclination

Sets the declination in degrees. The valid range is +90 to -90. This is used to adjust the calibration of the autoguider to compensate for different declinations without recalibrating. To use, set to the current declination before calibrating. Once calibration is complete, set to the current declination before starting autoguider tracking.

The value should be left as zero (0) if declination compensation is not to be used. This property also returns the current value.

GuiderName

Returns the name of the selected autoguider, as it appears on the MaxIm CCD Setup tab.

GuiderRunning

Returns True if the autoguider is currently running. Returns False if it is currently idle. Used to check for completion of a guider command such as GuiderCalibrate.

GuiderXError

Returns the current measured error in the autoguider tracking, in pixels.

GuiderXSize

Returns the width of the autoguider CCD array.

GuiderXStarPosition

Returns the X coordinate of the Guide star on the autoguider CCD array.

GuiderYError

Returns the current measured error in the autoguider tracking, in pixels.

GuiderYSize

Returns the width of the autoguider CCD array.

GuiderYStarPosition

Returns the Y coordinate of the Guide star on the autoguider CCD array.

HalfFluxDiameter

Returns the Half Flux Diameter in pixels, for the brightest star in the current CCD image.

HasFilterWheel

If a filter wheel is enabled and LinkEnabled is True, this property will be True. If not, the property will be False.

HasShutter

If True, the camera has a built-in shutter. If False, the camera does not have a shutter. If there is no shutter, the Expose command will ignore the Light parameter.

ImageArray

Returns a safearray of Long of size NumX * NumY containing the pixel values from the last exposure. Note: if NumX or NumY is changed after a call to Expose it will have no effect on the size of this array.

ImageReady

If True, there is an image buffer from the camera available. If False, no buffer is available and attempts to use the SaveImage method or ImageArray method will produce an error.

LinkEnabled [= Boolean]

Controls the link between MaxIm CCD and the camera. Set True to enable the link. The settings for the camera, autoguider, and filter wheel have previously been selected in the Settings tab (the settings are remembered between sessions).

After enabling the link, it is advisable to check the value. It will return True if the link-up was successful; False if not.

Set False to disable the link.

MaxBinX

If XYBinning = False, returns the maximum allowed binning factor. If XYBinning = True, returns the maximum allowed binning factor for the X axis.

MaxBinY

If XYBinning = False, equals MaxBinX. If XYBinning = True, returns the maximum allowed binning factor for the Y axis.

MaxPixel

Returns the value of the brightest pixel in the current CCD image.

MaxPixelX

Returns the X location of the brightest pixel in the current CCD image.

MaxPixelY

Returns the Y location of the brightest pixel in the current CCD image.

NumX [= Short]

Sets the subframe width. Also returns the current value.

NumY [= Short]

Sets the subframe height. Also returns the current value.

PixelSizeX

Returns the width of the CCD chip pixels in microns, as provided by the camera driver. If the driver does not report a value it will return 1.

PixelSizeY

Returns the height of the CCD chip pixels in microns, as provided by the camera driver. If the driver does not report a value it will return 1.

PowerOfTwoBinning

If True, the camera can only support the following binning factors: 1, 2, 4, 8, 16; subject to the limitation that the bin factor shall not be greater than MaxBinX or MaxBinY as appropriate. If False, any value between 1 and MaxBinX or MaxBinY will be allowed.

ReadyForDownload

Used in conjunction with AutoDownload and StartDownload. When AutoDownload is set to false, the camera will not read out automatically upon completion of the exposure. Instead, ReadyForDownload is set to true. During an exposure, the client should poll ReadyForDownload periodically, and when it is set to true, it can start the telescope slew to the next object. Once the slew is started, the client should call StartDownload to initiate the camera download process. The camera readout then proceeds normally, and the image can be retrieved once ImageReady is set to true.

ShutterOpen

If True, the camera shutter is currently open. If False, the shutter is currently closed.

StartX [= Short]

Sets the subframe start position for the X axis. Also returns the current value.

StartY [= Short]

Sets the subframe start position for the Y axis. Also returns the current value.

Temperature

Returns the current CCD temperature in degrees Celsius. Only valid if CanSetTemperature is True and CoolerOn is True.

TemperatureSetpoint [= Double]

Sets the camera cooler setpoint in degrees Celsius, and returns the current setpoint. The valid range is +100C to -100C. Attempts to change the temperature setpoint for cameras for which CanSetTemperature is False will be ignored.

XYBinning

If True, the camera can have different binning on the X and Y axes, as determined by BinX and BinY. If False, the binning must be equal on the X and Y axes, and is determined only by BinX.

Method

Description

AbortExposure()

Returns: Nothing.

Aborts the current exposure, if any, and returns the camera to Idle state.

Calibrate()

Returns: Nothing.

Calibrates the current CCD camera exposure using the current settings in the Set Calibration command (or as set via the Application object's CalSet method).

Expose (Duration, Light [, Filter])

·         Double Duration – Duration of exposure in seconds

·         Short Light – 1 for light frame, 0 for dark frame (ignored if no shutter)

·         Short Filter – (optional) Index of filter to use; first filter is 0 (ignored if no filter wheel)

Returns: Boolean – True if successful

Starts an exposure. Use ImageReady to check when the exposure is complete. An error occurs if the exposure cannot be started.

If no filter is specified, or if a negative number is specified, the filter wheel remains at its previous position.

GuiderCalibrate (Duration)

·         Double Duration – length of each exposure in seconds.

Returns: Boolean – True if successful.

Starts the calibration process, which requires a series of exposures. Use GuiderRunning to check when the exposure is complete.

GuiderExpose (Duration)

·         Double Duration – length of each exposure in seconds.

Returns: Boolean – True if successful.

Starts a single autoguider exposure. Use GuiderRunning to check when the exposure is complete.

GuiderMoveStar (X, Y)

·         Double X – new horizontal position of track point

·         Double Y – new vertical position of track point

Returns: Boolean – returns False if guider is not in Track mode

Used to modify the guide position while tracking. Typically used to track a moving object such as a comet or asteroid by moving the guide point in the opposite direction (offset tracking). The guide position may be set to a fractional pixel.

Returns False if the autoguider is not tracking.

GuiderSetStarPosition (X, Y)

·         Short X – X coordinate of guide star

·         Short Y – Y coordinate of guide star

Returns: Nothing.

Used to set the guide star coordinates prior to calibration or tracking. No effect if GuiderAutoSelectStar is True.

GuiderStop()

Returns: Boolean – True if successful.

Stops the current autoguider operation. Primarily used to terminate tracking after an exposure is complete.

GuiderTrack (Duration)

·         Double Duration – length of each exposure in seconds.

Returns: Boolean – True if successful.

Start the autoguider tracking. The autoguider will continue tracking until GuiderStop is called. Use GuiderRunning to check whether the guider is running.

Quit()

Aborts any current camera or autoguider operations, shuts down the link and closes all image windows. Deleting all object will have the same effect. Note that this command does not switch off the CCD cooler.

SaveImage (FilePath)

·         BSTR FilePath – path to save file in

Returns: Boolean – True if successful

Saves the current image buffer (last exposure) as a FITS file in the location specified by FilePath. If no image buffer is available or the file cannot be saved for any reason an error will occur. Returns True if successful.

SetFITSKey (Key, Value)

·         BSTR FilePath – key name

·         VARIANT Value – New value for the key

Returns: Boolean – True if successful

After an image has been taken, you can set various FITS header parameters using this method. The Key and Value entries must follow the FITS guidelines. The values can be integer, float, boolean, or string. Returns True if successful.

SetFullFrame()

Returns: Nothing.

If a link is enabled, resets the subframe and binning parameters to their defaults, as follows:

·         StartX 0

·         StartY 0

·         NumX CameraXSize

·         NumY CameraYSize

·         BinX 1

·         BinY

 

ShowWindow (Show)

·         Boolean Show - True to turn window on, False to turn window off

Returns: Nothing.

Controls whether the MaxIm CCD camera control window is visible on the screen.

StartDownload

Used in conjunction with ReadyForDownload and AutoDownload. When AutoDownload is set to false, the camera will not read out automatically upon completion of the exposure. Instead, ReadyForDownload is set to true. During an exposure, the client should poll ReadyForDownload periodically, and when it is set to true, it can start the telescope slew to the next object. Once the slew is started, the client should call StartDownload to initiate the camera download process. The camera readout then proceeds normally, and the image can be retrieved once ImageReady is set to true.

Document Object

Property

Description

Color [= boolean]

If True, the image is tricolor.  If False, it is monochrome.

The color depth of a document can be changed by modifying this property.  When a monochrome image is converted to color, the red, green, and blue planes are all set equal to the original monochrome data, with the result that the final image appears outwardly unchanged; it is however now a tricolor image.  When a color image is converted to monochrome, the red, blue, and green data for each pixel are averaged to compute the resultant monochrome plane.

DisplayName [= string]

Returns or changes the title of the window associated with this image in MaxIm DL.

NOTE: Changing this property does not affect the name of the file in which this image would be stored if a MaxIm DL Save command were issued.

DoNotClose [= boolean]

Determines whether the window associated with this image in MaxIm DL will be closed when the script containing the statement terminates.  By default, the DoNotClose property is False, so that a window associated with an Image object created by a script closes automatically when the script terminates.

Note in addition that if MaxIm DL had been started automatically by executing a script, it will exit automatically when the last image window opened by a script has been closed.  This occurs regardless of the setting of DoNotClose.

ImageArray [= array]

Returns a safearray of Floats giving the pixel data of the associated image.  If the image is monochrome, the array is of dimension XSize by YSize; if it is tricolor, the array is of dimension 3 by XSize by YSize, the three planes of the three-dimensional array being the red, green, and blue image planes.

ImageArray can also be assigned to, provided the item on the right-hand side of the assignment operator is an array of floats of the proper number of dimensions (XSize by YSize if monochrome, and 3 by XSize by YSize if tricolor) for the image.

NOTE: Windows Scripting Host does not support arrays of Floats, so this property is not directly useable by VBScript or JScript.  The array itself is retrievable, but any attempt to access an individual component (pixel value) will result in a "Type mismatch" error.  ImageArray is fully compatible with Visual Basic.

MouseAnnulusWidth

Returns the current width of the annulus, that is, the thickness of the outermost ring of the mouse cursor displayed when MaxIm DL's Information window is in Aperture, Region, or Astrometric mode.  The annulus width cannot be changed by a script, only by commands in the context (right-click pop-up) menu of MaxIm DL.

MouseDown

Returns True if the left mouse button was pressed when the most recent mouse event occurred, or False if it was released.

MouseGapWidth

Returns the current width of the gap, the distance between the central and middle rings of the mouse cursor displayed when MaxIm DL's Information window is in Aperture, Region, or Astrometric mode.  The gap width cannot be changed by a script, only by commands in the context (right-click pop-up) menu of MaxIm DL.

MouseNewClick

Returns a nonzero value if the user has clicked or released the left mouse button on the associated image in MaxIm DL since the last time this property was accessed.  Reading this property causes it to be reset to zero; it will be set nonzero again the next time the left mouse button is clicked or released in the client area of the window.  Clicking on the title bars, borders, or scroll bars does not affect MouseNewClick.

Any pending unreported mouse click is lost the next time a reportable mouse event occurs; a script may not be able to capture every click.

MouseRadius

Returns the current radius of the aperture, the innermost ring associated with the mouse cursor when MaxIm DL's Information window is in Aperture, Region, or Astrometric mode.  The aperture radius cannot be changed by a script, only by commands in the context (right-click pop-up) menu of MaxIm DL.

MouseUp

Returns False if the left mouse button was pressed when the most recent mouse event occurred, or True if it was released.

MouseX

Returns the X pixel coordinate within the image where the most recent mouse event occurred.  This value is normalized by the zoom factor of the window, so will always be within the range 0 to XSize - 1.

MouseY

Returns the Y pixel coordinate within the image where the most recent mouse event occurred.  This value is normalized by the zoom factor of the window, so will always be within the range 0 to YSize - 1

StretchMax [= float]

Returns or sets the maximum Screen Stretch value for the window associated with this image.  This affects only the way the image is displayed, not the actual values of the pixel data.  When StretchMax is changed by a script, the Screen Stretch window is automatically put into Manual mode.

StretchMin [= float]

Returns or sets the minimum Screen Stretch value for the window associated with this image.  This affects only the way the image is displayed, not the actual values of the pixel data.  When StretchMin is changed by a script, the Screen Stretch window is automatically put into Manual mode.

XSize [= short]

Returns or sets the width of the image.  If this property is changed, the image is stretched or shrunk horizontally.

YSize [= short]

Returns or sets the height of the image.  If this property is changed, the image is stretched or shrunk vertically.

Method

Description

Add (OtherDocument)

·         Document OtherDocument - another document object accessible to the script

or

·         String OtherDocument   - the DisplayName associated with another document

Returns: Boolean

Adds OtherDocument to this image on a pixel-by-pixel basis.  For color images, each plane of OtherDocument is added to the corresponding plane of this document.  Both images must be the same type (monochrome or color).  If the images are of different sizes, only the region of their intersection, starting at the top left corner, is affected.

OtherDocument can be specified either as a Document object, or as a string giving the display name (window title) of a document already open in MaxIm DL.

This method is equivalent to the Add operation in the Pixel Math command.

AddConstant (Offset)

·         Float Offset - Value to be added to every pixel of Document

Returns: Nothing

Adds the constant Offset to every pixel of this document.  If the image is tricolor, Offset is added to each of the Red, Blue, and Green planes.  Offset can be negative, but the resulting values are clipped at zero; pixel values are never allowed to be negative.

This method is equivalent to the Add Constant edit box in the Pixel Math command used with Operation None.

AddNoise (Type, Amplitude)

·         NoiseType Type - specifies the type of noise to be added:

mxUniformNoise (0)  : uniformly distributed

mxGaussianNoise (1) : gaussian distribution

Returns: Nothing

Modifies every pixel of this document by adding a random number drawn from a distribution characterized by Type and Amplitude.  If the image is tricolor, the same random value is added to each of the Red, Blue, and Green planes.  In this way only the chroma of the pixel is not affected, not its brightness.

For uniform noise, each pixel can change by a value from -Amplitude to +Amplitude.  For gaussian noise, 68% of the pixels change by not more than Amplitude (positive or negative), 27% more change by up two times Amplitude, and 4.3% change by up to three times Amplitude.  In no case is a pixel allowed to be negative; instead, it is clipped at zero.

This method is equivalent to the Add Noise command.

AdjustSaturation (Saturation)

·         Float Saturation - specifies the desired saturation as a percentage of the existing level

Returns: Nothing

Changes the color saturation of the image.  Values of Saturation greater than 100 increase the strength of the color, while values less than 100 reduce it.  A saturation of 0 is effectively equivalent to conversion to monochrome, except that the image remains tricolor.

This method is equivalent to the Adjust Saturation command.

AlignImages (Mode, Bicubic[, Images])

·         AlignType Mode   - specifies method used to align images

mxAutocorrelation (0) : autocorrelation

mxAutoStarMatch (1)  : automatic matching of star brightnesses and separations

·         Boolean Bicubic  - specifies whether bicubic interpolation will be performed

·         Collection Images- [optional] a Collection object whose members are the images to be aligned

Returns: Nothing

Adjusts all documents in the collection Images so that the their image stars coincide with those in this document.  The optimal positional adjustments required for each image are automatically determined using the algorithm specified by Mode.  Autocorrelation is a mathematical procedure which determines the optimum amount of image shift for each image, while star matching compares the relative intensities and separations of up to 100 of the brightest point sources in each image and computes both shift and rotation factors.  If Bicubic is True, the source images are interpolated to determine nominal values at the fractional pixel coordinates required; this can give smoother results. The set of images to be aligned is specified by the Images parameter, a Collection object to which has previously been added all the Documents which are to be aligned.  Alternatively this parameter can be omitted, in which case all open images are aligned.

This method is equivalent to the Align Images command

Calibrate()

Calibrates the document using bias, dark, and flat frames previously specified in calls to the CalAddBias, CalAddDark, CalAddFlat and CalSet methods of Application.

It is equivalent to the Calibrate command.

ColorBalance (RScaling, GScaling, BScaling [, BgdR, BgdG, BgdB])

·         Float RScaling  - specifies the desired Red channel strength as a percentage of the existing level

·         Float GScaling  - specifies the desired Green channel strength as a percentage of the existing level

·         Float BScaling  - specifies the desired Blue channel strength as a percentage of the existing level

·         Float BgdR  - [optional] background level in Red channel

·         Float BgdG  - [optional] background level in Green channel

·         Float BgdB  - [optional] background level in Blue channel

Returns

Nothing

Scales the three color planes of a tricolor image by different amounts, affecting the overall color balance of the image.  The background level may be specified for each of Red, Green, and Blue; if they are omitted, they will be determined automatically.

This method is equivalent to the Color Balance command.

ColorSmooth (Type, Weight, Cutoff)

·         LowpassFilterType Type   - type of low-pass filter to be used in color smoothing

mxFFTLowPass (0): Fast Fourier Transform low pass filter

mxKernelLowPass (1): Kernel low pass filter using 3x3 neighbourhoods

mxKernelLowPassMore (2): Kernel low pass filter using 5x5 neighbourhoods

·         Float Weight - weight (0 to 100%) applied to filter output when mixing  with original input data to produce the final result

·         Float Cutoff - radius of filter cutoff as percentage of image size for FFT filter; has no effect on kernel filters

Returns: Nothing

Smooths color variations in an image without reducing image sharpness.  Type specifies which of MaxIm DL's low pass filter methods is applied to the color information in the image.  When using the FFT filter, the Cutoff parameter controls its strength; 5% corresponds to a mild filter, 2.5% to medium, and 1.5% to hard.  (These values are for illustration: any desired values can be used.)  Cutoff is ignored when using a Kernel low pass filter.  The output image is a weighted average of the filter output and the input image, controlled by the parameter Weight.

This method is equivalent to the Color Smoothing command.

CombineColor (Method, BgdAutoEqualize, RDoc, GDoc, Bdoc [, LDoc, LWeight])

·         CombineColorType Method  - specifies the type of the input images

mxRGB (0)  : Red, Green, and Blue

mxLRGB (1) : Red, Green, Blue, and Luminance

mxCMY (2)  : Cyan, Magenta, and Yellow

mxLCMY (3) : Cyan, Magenta, Yellow, and Luminance

·         Boolean BgdAutoEqualize  - controls whether automatic background equalization is performed

·         Document Rdoc- the document containing the image taken through the red (RGB and LRGB modes) or cyan (CMY and LCMY modes) filter

or:

·         String Rdoc  - alternatively, a document can be identified by DisplayName

·         Document Gdoc - the document containing the image taken through the green (RGB and LRGB modes) or magenta (CMY and LCMY modes) filter

or:

·         String Gdoc  - alternatively, a document can be identified by DisplayName

·         Document Bdoc - the document containing the image taken through the blue (RGB and LRGB modes) or yellow (CMY and LCMY modes) filter

or:

·         String Bdoc  - alternatively, a document can be identified by DisplayName

·         Document LDoc  - [optional] the monochrome document containing the luminance data

or:

·         String Ldoc - alternatively, a document can be identified by DisplayName

·         Float LWeight - [optional] weight applied to the luminance data (0-100%)

Returns: Nothing

Combines three (RGB, CMY) or four (LRGB, LCMY) monochrome images, taken through different color filters, into a single tricolor image.  The images can be specified either as Document objects, or as strings giving the display name (window title) of documents already open in MaxIm DL; they must have been previously aligned (see AlignImages).  When separate luminance data is provided, the parameter LWeight specifies the proportion of the final image luminance taken from that source, as opposed to derived from the color images. Background equalization adjusts the images to compensate for any differences in the average background level.

This method is equivalent to the Combine Color command.

CombineFiles (FilePath, Mode, Bicubic, Output, Normalize)

·         String FilePath  - path and filename containing wildcards, specifying the image files to be combined

·         AlignType Mode  - specifies method used to align images

mxAutocorrelation (0) : autocorrelation

mxAutoStarMatch (1)  : automatic matching of star brightnesses and separations

mxNoAlignment (2) : perform no alignment

·         Boolean Bicubic - specifies whether bicubic interpolation will be performed

·         CombineType Output  - specifies how images are combined

mxSumCombine (0)  : take sum of corresponding pixels in all images

mxAvgCombine (1)  : take average of corresponding pixels in all images

mxMedianCombine (2) : take median of corresponding pixels in all images

·         Boolean Normalize - prenormalizes images so that medians are comparable (ignored if output is calculated by sum or average methods)

Returns: Nothing

Combines two or more files from disk into a single image.  The source files must be described by a single file specification containing wildcards.  The optimal positional adjustments required for each image are automatically determined using the algorithm specified by Mode.  Autocorrelation is a mathematical procedure which determines the optimum amount of image shift for each image, while star matching compares the relative intensities and separations of up to 100 of the brightest point sources in each image and computes both shift and rotation factors.  If Bicubic is True, the source images are interpolated to determine nominal values at the fractional pixel coordinates required; this can give smoother results.

The aligned images are then combined using the method specified by Output.  Sum simply adds the pixels at each coordinate; Average adds them and divides by the number of images; Median sets the pixel in the resulting image to the median value across the input images. When the Median combination method, it is generally desirable to set Normalize to True to eliminate differences in scaling across the various input images.

This method is equivalent to the Combine Files command.

CombineImages (Mode, Bicubic, Output, Normalize[, Images])

·         AlignType Mode  - specifies method used to align images

mxAutocorrelation (0) : autocorrelation

mxAutoStarMatch (1) : automatic matching of star brightnessesand separations

mxNoAlignment (2) : perform no alignment

·         Boolean Bicubic - specifies whether bicubic interpolation will be performed

·         CombineType Output - specifies how images are combined

mxSumCombine (0) : take sum of corresponding pixels in all images

mxAvgCombine (1) : take average of corresponding pixels in all images

mxMedianCombine (2) : take median of corresponding pixels in all images

·         Boolean Normalize - prenormalizes images so that medians are comparable (ignored if output is calculated by sum or average methods)

·         Collection Images - [optional] a Collection object whose members are the images to be aligned

Returns: Nothing

Combines two or more open images into a single image.  The optimal positional adjustments required for each image are automatically determined using the algorithm specified by Mode.  Autocorrelation is a mathematical procedure which determines the optimum amount of image shift for each image, while star matching compares the relative intensities and separations of up to 100 of the brightest point sources in each image and computes both shift and rotation factors.  If Bicubic is True, the source images are interpolated to determine nominal values at the fractional pixel coordinates required; this can give smoother results.The aligned images are then combined using the method specified by Output.  Sum simply adds the pixels at each coordinate; Average adds them and divides by the number of images; Median sets the pixel in the resulting image to the median value across the input images. When the Median combination method, it is generally desirable to set Normalize to True to eliminate differences in scaling across the various input images.

The set of images to be combined is specified by the Images parameter, a Collection object to which has previously been added all the Documents which are to be aligned.  Alternatively this parameter can be omitted, in which case all open images are aligned. Unlike the AlignImages method, this method does not affect images other than the one for which it is called.

This method is equivalent to the Combine command.

ConvertColor (CameraType, ScaleR, ScaleG, ScaleB, XOffset, YOffset [, BgdR, BgdG, BgdB])

·         ColorCameraType CameraType - type of camera which acquired the image being converted

mxLISAA (0) : Apogee LISAA and LISAA Megapixel cameras

mxMX5C (1) : Starlight XPress MX5C

mxMX7CFast (2) : Starlight XPress MX7C operated in "fast" mode

mxMX7CInterlaced (3) : Starlight XPress MX7C operated in "interlaced" mode

·         Float ScaleR - scale factor to be applied to Red plane, in percent

·         Float ScaleG - scale factor to be applied to Green plane, in percent

·         Float ScaleB - scale factor to be applied to Blue plane, in percent

·         Boolean XOffset - X-axis offset flag (may be required by some cameras)

·         Boolean YOffset - Y-axis offset flag (may be required by some cameras)

·         Float BgdR - [optional] background level in Red channel

·         Float BgdG - [optional] background level in Green channel

·         Float BgdB - [optional] background level in Blue channel

Returns: Nothing

Converts a raw (monochrome) image taken by a "one-shot" color camera into a color image. One-shot cameras have an internal mask of pixel-sized filters of alternating colors as part of the CCD sensor; this method is used to convert the color information image into the standard RGB color plane format. The parameter CameraType must be set to indicate the type of camera that produced the image, and, in the case of the MX7C, the mode in which it was operating.

The three parameters ScaleR, ScaleG, and ScaleB are used to compensate for differing sensitivities in the three color bands. The nominal value for each is 100.0; adjust these if necessary to correct any consistent color cast in your camera's images. The XOffset and YOffset flags correct for possible misalignment of the camera's filter mask and may also have to be experimented with to achieve correct color rendition for your camera.

In most cases, the background level parameters BgdR, BgdG, and BgdB can be omitted, in which case MaxIm DL will determine their proper values automatically. Supplying values for these will suppress the automatic computation.

This method is equivalent to the Convert LISAA and Convert MX commands.

ConvertToMono()

Removes all color information from an image, converting it to a gray-scale image.  The Red, Green, and Blue pixels at each coordinate are averaged. This command is applicable only to tricolor images.

This method is equivalent to the Convert To Mono command.

Crop (XOffset, YOffset, Width, Height)

·         Short XOffset - horizontal coordinate of left edge of the cropping rectangle  (zero represents the existing left edge of the image)

·         Short YOffset - vertical coordinate of top edge of the cropping rectangle  (zero represents the existing top edge of the image)

·         Short Width - width of the cropping rectangle, i.e., the resulting image

·         Short Height - height of the cropping rectangle, i.e., the resulting image

Returns: Nothing

Reduces the size of an image by discarding the area outside the cropping rectangle. All parameters are expressed in pixels. The sum of XOffset and Width may not exceed the width of the image, and the sum of YOffset and Height may not exceed its height.

This method is equivalent to the Crop command.

DDP (Type, AutoBgd, AutoMidLevel, Bgd, MidLevel, Cutoff)

·         LowpassFilterType Type - type of low-pass filter to be used by Digital Development

mxFFTLowPass (0) : Fast Fourier Transform low pass filter

mxKernelLowPass (1) : Kernel low pass filter using 3x3 neighbourhoods

mxKernelLowPassMore (2) : Kernel low pass filter using 5x5 neighbourhoods

·         Boolean AutoBgd - enables automatic determination of image background level

·         Boolean AutoMidLevel - enables automatic determination of image mid-gray level

·         Float Bgd - image background level setting when AutoBgd is false

·         Float MidLevel - image mid-gray level setting when AutoMidLevel is false

·         Float Cutoff - radius of filter cutoff as percentage of image size for FFT filter; has no effect on kernel filters

Returns: Nothing

Implements the Digital Development Processing algorithm, modelling the characteristics of conventional development of photographic emulsions. Type specifies which of MaxIm DL's low pass filter methods is used to perform the unsharp masking part of DDP. When using the FFT filter, the Cutoff parameter controls its strength. A setting of 5% corresponds to a mild filter, which emphasizes fine detail; 2.5% is a medium filter; and 1.5% is strong, removing large-scale brightness variations. (These values are for illustration: any desired values can be used.) Cutoff is ignored when using a Kernel low pass filter. If AutoBgd is True, MaxIm DL determines the average background level of the image automatically. Otherwise the average background value must be passed in via the parameter Bgd. Similarly, if AutoMidLevel is True, MaxIm DL attempts to determine a suitable level to use as inflection point of the gamma curve; the caller may override this by setting AutoMidLevel to False and passing the desired value in MidLevel.

This method is equivalent to the Digital Development command

Divide (OtherDocument)

·         Document OtherDocument - another document object accessible to the script

or:

String OtherDocument - the DisplayName associated with another document

Returns: Nothing

Divides this image by OtherDocument on a pixel-by-pixel basis. Pixels in OtherDocument which have the value zero (0) are treated as if they were one (1), that is, the corresponding pixel in this document is left unchanged. For color images, each plane of this document is divided by the corresponding plane of OtherDocument. Both images must be the same type (monochrome or color). If the images are of different sizes, only the region of their intersection, starting at the top left corner, is affected. OtherDocument can be specified either as a Document object, or as a string giving the display name (window title) of a document already open in MaxIm DL.

This method is equivalent to the Divide operation in the Pixel Math command.

DoubleSize()

Doubles the size of this document horizontally and vertically. The result occupies four times as much memory as the original. DoubleSize uses a specialized interpolation algorithm which delivers superior results compared to Resize or doubling the XSize and YSize properties.

This method is equivalent to the Double Size command.

FFTFilter (Type, Cutoff, Weight)

·         FFTFilterType Type - type of filter applied to the intermediate spatial frequency information

mxHighPassFF (0) : High pass filter, sharpening image

mxLowPassFF (1) : Low pass filter, smoothing image

·         Float Cutoff - radius of filter cutoff as percentage of image size

·         Float Weight - weight (0 to 100%) applied to filter output when mixing with original input data to produce the final result

Returns: Nothing

Transforms image to spatial frequency domain using a Fast Fourier Transform algorithm, applies a high- or low-pass filter with a specified roll-off point, and transforms the result back using an inverse FFT and mixes it with the original. The Cutoff parameter determines the radius within which (for high pass) or outside which (for low pass) spatial frequencies are suppressed. For a high pass filter, 50% corresponds to a mild filter, 25% to medium, and 10% to hard. For a low pass filter, 5% corresponds to a mild filter, 2.5% to medium, and 1.5% to hard. (These values are for illustration: any desired values can be used.) The Weight parameter is used in the final mixing staging to moderate the amount of filtering; typical values range from 30% for restrained filtering to 80% for strong effects.

This method is equivalent to the FFT Filters command.

FlattenBackground()

Removes or reduces variability in the background level across the image, such as is caused by moonlight, light pollution, or vignetting in the optical system. FlattenBackground works by estimating the background level at different points in the image, fitting a two-dimensional polynomial to those values, and evaluating and subtracting the polynomial from every pixel.

FlattenBackground can be misled by large nebulae, galaxies, etc., which occupy a significant part of the image. It is best applied to star fields. RemoveGradient will often handle linear gradients better in the presence of foreground objects.

This method is equivalent to the Flatten Background command.

Flip()

Reverses the image top to bottom.

This method is equivalent to the Flip command

GetFITSKey(Key)

·         String Key - the FITS keyword whose value is to be retrieved

Returns: Variant - Value associated with keyword

Retrieves the value associated with the keyword specified by the parameter Key from the document's FITS header. A FITS keyword consists of up to eight uppercase letters and digits, and begins with a letter. GetFITSKey will convert lower case letters a-z to their corresponding uppercase equivalents A-Z. The type of the returned value is Variant because FITS keywords are associated with data of different types. For example, OBJECT (the name of the object in an image) is a String, but EXPOSURE (the duration of the exposure) is Double. If the Key specifies a keyword not present in the image header, GetFITSKey returns Empty.

This method provides part of the functionality of MaxIm DL's FITS Header command. See also SetFITSKey.

HistogramSpec (Curve)

·         HistogramType Curve - specifies the desired shape of the image's histogram after equalization

mxUniformHS (0) : Uniform, i.e. the same number of pixels in each bin

mxExponentialHS (1) : Exponential

mxLogNormalHS (2) : LogNormal

mxGaussianHS (3) : Gaussian

mxRayleighHS (4) : Rayleigh

mxStraightLineHS (5) : Linearly decreasing numbers of pixels in each successively higher bin

Returns: Nothing

Provides a generalized form of histogram equalization, that is, applying a non-linear transfer function to the image so that a histogram of the resulting image will exhibit a particular shape, specified by the parameter Curve. This can be used to enhance subtle features in an image without completely driving other parts of the image to black or white.

This method is equivalent to the Histogram Specification command.

KernelFilter (Type [, ThresholdOrKernelSize])

·         KernelFilterType Type - specifies the type of kernel filter to be applied

mxHighPassKF (0) : standard low pass filter fot a 3x3 neighbourhood

mxHighPassMoreKF (1) : standard low pass filter for a 5x5 neighbourhood

mxLowPassKF (2) : standard high pass filter for a 3x3 neighbourhood

mxLowPassMoreKF (3) : standard high pass filter for a 5x5 neighbourhood

mxDeadPixelKF (4) : dead pixel filter: replaces every pixel darker by Threshold than its darkest neighbour with the median of its surrounding pixels

mxHotPixelKF (5) : hot pixel filter: replaces every pixel brighter by Threshold than its brightest neighbour with the median of its surrounding pixels

mxAverageKF (6) : "boxcar" lowpass filter, replaces every pixel by the neigbbourhood average

mxMedianKF (7) : replaces every pixel by the neigbbourhood median

mxDilationKF (8) : replaces every pixel by the neigbbourhood maximum

mxErosionKF (9) : replaces every pixel by the neigbbourhood minimum

·         VARIANT ThresholdOrKernelSize - [optional] specifies the Threshold percentage for identifying Dead or Hot pxiels, and the neighbourhood size (3, 5, or 7) for Average, Median, Dilation and Erosion filters

Returns: Nothing

Applies a selected kernel filter to the image. A kernel filter is one which replaces every pixel with a function of its own value and those of the pixels in a fixed-size, symmetrical neighbourhood (or "kernel") surrounding it. Ten different kernel filters are provided, selected by the value of parameter Type. Four of these, called Low Pass, Low Pass More, High Pass, and High Pass More, use no other control parameters; two, the Dead Pixel and Hot Pixel filters, use a threshold to restrict which pixels are affected; and the remaining four, the Average, Median, Dilation, and Erosion filters, accept a variable kernel size. The threshold or kernel size are never both required and are therefore passed through the same argument, ThresholdOrKernelSize. This parameter can be omitted when using one of the Low or High pass filters.

This method is equivalent to the Kernel Filters command.

LocalAdaptiveFilter (Radius, Contrast)

·         Short Radius - specifies the radius of the area over which contrast is measured

·         Float Contrast - specifies the percentage increase in contrast to be applied

Returns: Nothing

Sharpens low-contrast fine detail. This method can enhance faint details in planetary images, but must be used with care to avoid amplifying image noise. The Radius parameter specifies the region around each pixel (actually a square of side 2*Radius+1) over which the ratio between the average value and the standard deviation is calculated. This quantity is an inverse measure of contrast, and is multiplied by the Contrast parameter and added to the pixel.

This method is equivalent to the Local Adaptive Filter command.

MakePixelsSquare()

Resizes the image so that the resultant pixels have the same size horizontally and vertically. If the original image has pixels which are wider than they are tall, the image will be expanded horizontally (since the new square pixels are narrower than before, and it therefore requires more of them). Similarly, an image taken with a camera with tall narrow pixels will expand vertically when this method is invoked.

MakePixelsSquare is a convenience function in that the same result can be achieved using GetFITSKey (to retrieve the pixel dimensions), followed by changing XSize or YSize to the correct value.

This method provides part of the functionality of MaxIm DL's Resize command.

Mirror()

Reverses the image left to right.

This method is equivalent to the Mirror command.

Multiply (OtherDocument)

·         Document OtherDocument - another document object accessible to the script

or:

·         String OtherDocument - the DisplayName associated with another document

Returns: Nothing

Multiplies this image by OtherDocument on a pixel-by-pixel basis. For color images, each plane of this document is multiplied by the corresponding plane of OtherDocument. Both images must be the same type (monochrome or color). If the images are of different sizes, only the region of their intersection, starting at the top left corner, is affected. OtherDocument can be specified either as a Document object, or as a string giving the display name (window title) of a document already open in MaxIm DL.

This method is equivalent to the Multiply operation in the Pixel Math command.

OpenFile (FilePath)

·         String FilePath - specifies the name of the image file to be opened

Returns: Nothing

Loads an image file into the buffer associated with Document, and initializes all related properties such as XSize, YSize and Color. The file to be loaded is specified by the string FilePath. This parameter should include the complete path (drive letter and directory) specification, as well as the filename and its extension. The extension is used to infer the file format and instructs MaxIm DL how to interpret the file contents. All types of files supported by the Open command are accessible except RAW, which requires image dimension and pixel size data not available to this method.

This method is equivalent to the Open command.

PseudoColor (Scheme, Cycles, ReverseMap, MapType)

·         String Scheme - specifies the name of the color map to be used

·         Short Cycles - specifies the number of repetitions of the color map

·         Boolean ReverseMap - reverses order of color map

·         ColorMapType MapType - selects style of color map to use

mxLinearCM (0) : color changes linearly along each line segment in the map

mxLogarithmicCM (1) : color changes logarithmically along each line segment in the map

Returns: Nothing

Converts a monochrome image to color by mapping gray levels into colors according to the previously-defined color map identified by parameter Schema. (Color maps are editable and can be named using the Pseudo Color command, but not directly by the scripting interface.) The map is repeated the number of times specified by Cycles, and can be reversed by setting ReverseMap to True. Two ways of interpolating colors are available, selected by MapType.

This method is equivalent to the Pseudo Color command.

RankFilter (Radius, Weight)

·         Short Radius - specifies the radius of the area within which pixels are ranked

·         Float Weight - specifies the degree to which a pixel's rank will be permitted to alter its value (0 to 100%)

Returns: Nothing

Performs a rank filter, preferentially amplifying faint detail in the image. A raw rank filter replaces each pixel by its rank among the neighbouring pixels, scaled to the original range of the input data. This generally produces too extreme an effect, so the result is mixed with the original image in a weighted average according to Weight. The Radius parameter specifies the size of the neighbourhood, which is actually a square of side 2*Radius+1) centered on the pixel being ranked.

This method is equivalent to the Rank Filter command.

RemoveBadPixels (MapName, Noise)

·         String MapName - specifies the bad pixel map to be used

·         Float Noise - specifies the level of Gaussian noise which is added to the nominal interpolated values of any bad pixels being replaced

Returns: Nothing

Corrects for known bad pixels, columns, and rows in an image according to the previously-defined bad pixel map identified by parameter MapName. (Bad pixel maps are editable and can be named using the Remove Bad Pixels command, but not directly by the scripting interface.) Bad pixels defined in the map are replaced by a value interpolated from the surrounding pixels, augmented by Gaussian noise having standard deviation given by the parameter Noise.

This method is equivalent to the Remove Bad Pixels command.

RemoveGradient()

Removes a linear gradient in the background level of the image, typically caused by moonlight or light pollution. This is similar to the FlattenBackground method, but often gives better results when the gradient truly is linear.

This method is equivalent to the Remove Gradient command.

Resize (NewWidth, NewHeight)

·         Short NewWidth - specifies the desired width of the image is pixels

·         Short NewHeight - specifies the desired height of the image is pixels

Returns: Boolean

Changes the width and height of the image. The aspect ratio of the image will change if the new width and height are not in the same proportion to their previous values. This method is equivalent to, but more efficient than, changing the XSize and YSize properties.

See also DoubleSize and MakePixelsSquare for other resizing methods with special characteristics.

This method is equivalent to the Resize command.

Rotate (Angle, Bicubic)

·         Float Angle - specifies rotation angle in degrees, positive values being clockwise, negative counter-clockwise

·         Boolean Bicubic - enables bicubic resampling

Returns: Nothing

Rotates the image by the number of degrees specified by the parameter Angle. Positive values indicate clockwise rotation, negative values counter-clockwise.  If the angle is not a multiple of 90°, the rotation requires resampling (pixel interpolation), which can be either bilinear or bicubic, according to the parameter Bicubic.

RotateLeft()

Rotates the image 90° to the left (counter-clockwise).

RotateRight()

Rotates the image 90° to the right (clockwise).

SaveFile (FilePath, FileFormat, AutoStretch[, SizeFormat, CompressionType])

·         String FilePath - specifies the name of the image file to be written

·         ImageFormatType FileFormat - specifies the format of the file to be written

mxSBIGType3 (0) : "Type 3" format used by most SBIG cameras

mxSBIGST4 (1) : data format used by the SBIG ST4 camera

mxPCLynxx (2) : data format used by the PC-Lynxx camera

mxFITS (3) : FITS (Flexible Image Transport System), the format adopted by the astronomical community for data interchange and archival storage

mxRAW (4) : "Raw" format, a simple array of XSize by YSize pixels stored in row-major order with no header

mxTIFF (5) : TIFF (Tagged Image File Format), commonly used by scanners and raster image manipulation ("paint") progams

mxJPEG (6) : JPEG (named for the Joint Photographic Experts Group comittee which formulated this standard), a ubiquitous lossy image compression format

mxPNG (7) : PNG (Portable Network Graphics), a portable, patent-free, lossless compressed image format

mxBMP (8) : BMP, a standard format used by Windows to store device- and application-independent images

·         Boolean AutoStretch - specifies whether an automatic stretch of the image can occur during the save operation

·         PixelDataFormatType SizeFormat - [optional] specifies how pixels are represented

mx8BitPF (0) : each pixel occupies 8 bits (1 byte, 256 levels)

mx16BitPF (1) : each pixel occupies 16 bits (2 bytes, 65536 levels)

mx32BitPF (2) : each pixel occupies 32 bits (4 bytes, more than four billion levels)

mxFloatPF (3) : each pixel is stored in four bytes in IEEE floating point format

·         Short CompressionType - [optional] specifies whether the image should be compressed or not

Returns: Nothing

Remarks

Saves an image into the file specified by the string FilePath. This parameter should include the complete path (drive letter and directory) specification, as well as the filename and its extension. The file format used is set by parameter FileFormat, not by the file extension. For the FITS, RAW, and TIFF formats, parameter SizeFormat must specify the desired pixel data format; this parameter is ignored and may be omitted for other file formats.

If any pixel in the image exceeds the range that the format is capable of storing, and the AutoStretch parameter is True, MaxIm DL will automatically scale the entire image using the current screen stretch settings before writing the file. Images which do not exceed the file format's maximum pixel value are not subject to AutoStretch.

SBIG Type 3, FITS, TIFF, and JPEG formats provide for image compression in various ways. For these formats, compression can be requested by setting CompressionType to a nonzero value. In MaxIm DL:

·         FITS compression saves disk space but is not standard and should not be used if  the file must be accessed using software other than MaxIm DL.

·         TIFF uses only the PackBits compression method (LZW is patented)

·         JPEG files are written at one of only two compression levels, 85% (if CompressionType is zero) or 25% (if it is nonzero).

Note that although SaveFile will write RAW format, the OpenFile method cannot read these. (Raw files can be read by MaxIm DL's Open command.)

This method is equivalent to the Save As command.

ScaleConstant (Value)

·         Float Value - scaling factor

Returns: Nothing

Multiplies each pixel of this image by Value. For color images, every plane of the document is affected.

This method is equivalent to the Image A Scale Factor edit box in the Pixel Math command, used with Operation None.

SetFITSKey (Key, Value)

·         String Key - the FITS keyword whose value is to be changed

·         VARIANT Value - value to write for the FITS keyword

Returns: Boolean

Assigns a value to a new or existing keyword in the document's FITS header. A FITS keyword consists of up to eight uppercase letters and digits, and begins with a letter. SetFITSKey will convert lower case letters a-z in the name specified by the parameter Key to their corresponding uppercase equivalents A-Z. This affects only the keyword; Value (assuming it is a String) is not changed.

Parameter Value is Variant because FITS keywords are associated with data of different types. For example, OBJECT (the name of the object in an image) is a String, but EXPOSURE (the duration of the exposure) is Double. If the Key specifies a keyword not currently present in the image header, SetFITSKey creates it.

This method provides part of the functionality of MaxIm DL's FITS Header command and can also be used to replace the Setup Header command. See also GetFITSKey.

SplitTricolor()

Creates three new open Documents whose associated images correspond to the red, green, and blue image planes of this Document. The DisplayName properties of the new Documents are formed by appending -R, -G, and -B to the DisplayName of this document. SplitTricolor() works only on color images.

This method is equivalent to the Split Tricolor command.

Stretch (Type, Gamma, OutputRange, InputRange [, Min, Max])

·         StretchType Type - specifies the type of image stretch to be performed

mxLinearStretch (0) : Linear, useful for matching the image to a specific numerical range, e.g., for a particular file format

mxLogarithmicStretch (1) : Logarithmic, compressing the images's dynamic range

mxGammaStretch (2) : Gamma, selectively emphasizing faint or bright details

·         Float Gamma - specifies how Gamma Stretching will affect the image

·         StretchOutputType OutputRange - specifies the numerical range of the stretch image

mx8BitOR (0) : scale to fit in 1 byte/pixel (256 levels)

mx12BitOR (1) : scale to fit in 12 bits/pixel (4096 levels)

mx16BitOR (2) : scale to fit in 2 bytes/pixel (65536 levels)

mxUnlimitedOR (3) : no scaling is applied after the stretch, so that image pixels can have any non-negative value

StretchInputType InputRange - specifies how the minimum and maximum input pixel values for the stretch operation are established

mxMaxPixelIR (0) : the faintest and brightest pixel in the image

mxScreenIR (1) : the current Minimum and Maximum settings in the Screen Stretch window

mxManualIR (2) : from parameters Min and Max

·         Float Min - [optional] the minimum pixel value to be stretched

·         Float Max - [optional] the maximum pixel value to be stretched

Returns: Nothing

Modifies pixel values in the image according to one of three types of scaling. Linear stretching transforms the "minimum" pixel to zero, the "maximum" pixel to the greatest value representable in the selected output range, and intermediate pixels to intermediate values in a linear fashion. Logarithmic stretching greatly exaggerates differences at the dark end of the image. Gamma stretching is another non-linear stretch that allows control over whether faint (parameter Gamma < 1) or bright (Gamma > 1) details are enhanced.

The desired range of the stretched image is specified using OutputRange. The range of pixels to be stretched is specified using InputRange and, if "manual" mode is selected, the parameters Min and Max. Pixels fainter than the minimum (whether this value is copied from the Screen Stretch window or given explicitly) become zero in the resulting image. Pixels brighter than the maximum are mapped to the same value as the maximum.

Subtract (OtherImage

·         Document OtherDocument - another document object accessible to the script

or:

·         String OtherDocument - the DisplayName associated with another document

Returns: Nothing

Subtracts OtherDocument from this image on a pixel-by-pixel basis. The resulting values are clipped at zero; pixel values are never allowed to be negative. For color images, each plane of OtherDocument is subtracted from the corresponding plane of this document. Both images must be the same type (monochrome or color).  If the images are of different sizes, only the region of their intersection, starting at the top left corner, is affected.

OtherDocument can be specified either as a Document object, or as a string giving the display name (window title) of a document already open in MaxIm DL.

UnsharpMask (Type, MaskWeight, GeoMeanMask, Cutoff)

·         LowpassFilterType Type - type of low-pass filter to be used in color smoothing

mxFFTLowPass (0) : Fast Fourier Transform low pass filter

mxKernelLowPass (1) : Kernel low pass filter using 3x3 neighbourhoods

mxKernelLowPassMore (2) : Kernel low pass filter using 5x5 neighbourhoods

·         Float MaskWeight - specifies percentage of low pass filtered image to subtract

·         Boolean GeoMeanMask - specifies use of a geometric, rather than arithmetic, mean

·         Float Cutoff - radius of filter cutoff as percentage of image size for FFT filter; has no effect on kernel filters

Returns: Nothing

Sharpens the image using an unsharp mask which involves subtracting some fraction of a low-pass filtered version of the image from the image itself. Type specifies which of MaxIm DL's low pass filter methods is applied to the image. When using the FFT filter, the Cutoff parameter controls its strength; 5% corresponds to a mild filter, 2.5% to medium, and 1.5% to hard. (These values are for illustration: any desired values can be used.) Cutoff is ignored when using a Kernel low pass filter. The low pass filtered image is reduced to Weight percent and subtracted from the original.

Focuser Object

Property

Description

Absolute

Returns true if the focuser is capable of absolute position; that is, being commanded to a specific step location.

IsMoving

Returns true if the focuser is currently moving to a new position. Returns False if the focuser is stationary.

Link [= Boolean]

Set true to start the link to the focuser; set False to terminate the link. The current link status can also be read back. An exception will be raised if the link fails to change state for any reason.

MaxIncrement

Returns the maximum increment size allowed by the focuser; i.e. the maximum number of steps allowed in one move operation. For most focusers this is the same as MaxStep. This limits the Increment display in MaxIm DL.

MaxStep

Returns the maximum step position permitted. The focuser can step between 0 and MaxStep. If an attempt is made to move the focuser beyond these limits, it will automatically stop at the limit.

Position

Returns the current focuser position, in steps. Valid only for Absolute positioning focusers. An exception will be thrown for relative positioning focusers.

StepSize

Returns the step size in Microns for the focuser. Throws an exception if the focuser does not intrinsically know what the step size is.

TempComp [= Boolean]

If TempCompAvailable is True, then setting TempComp to True puts the focuser into temperature tracking mode. While in temperature tracking mode, Move commands will be rejected by the focuser. Set to False to turn off temperature tracking. An exception will be raised if TempCompAvailable is False and an attempt is made to set TempComp to true.

TempCompAvailable

Returns True if the focuser has a built-in temperature compensation mode that can be activated by TempComp. Returns False if such a mode is not available.

Temperature

Returns the current ambient temperature as measured by the focuser. Throws an exception if ambient temperature is not available. Commonly available on focusers with a built-in temperature compensation mode.

Method

Description

Halt()

Immediately stops any focuser motion due to a previous Move command. Some focusers may not support this function, in which case an exception will be thrown. (MaxIm DL tries this method when a focuser is linked; if it fails, it disables the Stop button).

SetupDialog()

Brings up a dialog box for the user to enter in custom setup parameters, such as a COM port selection. If no dialog is required or supported, the function returns immediately.

Move (Position)

·         Long Position - Step distance or absolute position, depending on Focuser.Absolute

Returns: Nothing.

If Absolute is True, then this is an absolute positioning focuser. The Move command tells the focuser to move to an exact step position, and Position is an integer between 0 and MaxStep.

If Absolute is False, then this is a relative positioning focuser. The Move command tells the focuser to move in a relative direction, and Position is an integer between -MaxIncrement and +MaxIncrement.

 

 

The object, property, and method names, and all descriptions, are copyright © 2002 Diffraction Limited


Copyright © 2000,2001 by Ron Wodaski. All rights reserved. Material may not be used without permission. If you provide a link to these pages, please send me an email message at about the link, and I will add a reciprocal link to my site.