The Plan editor provides advanced control over the imaging session. It is possible to execute internal APT commands or external scripts and programs after exposure end. Enter the command that you want to be executed in the field “Script”. If you check the box “Wait script to end” the execution of the script/program will be synchronous and APT will not continue with the next exposure until the end of the external operation. Leaving it unchecked APT will execute the command asynchronously and will continue with the plan as soon as the script/program is started. The internal APT commands are executed always synchronously.
In order easily to see which lines in a imaging plan has advanced behavior, they are marked with apostrophe (') character. You can see this in both
Plan Editor and in
Camera Tab.
You can combine the scripts/commands with 0s exposures. This allows executing a script/program or command without taking an image for example - to rotate to dome or to close the roof in the plan end.
In this example the lines 2 and 4 are set to execute internal commands without making exposures:
APT has a dedicated editor for Scripts and Commands which saves the need to format manually the required parameters. It also gives a short information about every command. To open this editor click on the button "Script or Command" in
Plan Editor. The screenshot below shows a formatted command for GoTo with Ra/Dec populated using the
Object Browser.
Here is the list of the supported internal APT commands and their parameters. Note that hash (#) is required in order to determine that you want to execute internal command
-
#CCDGain - changes the CCD
/CMOS Gain to a new integer value.
Syntax: #CCDGain Number
-
#CCDCool - Cools the CCD
/CMOS camera. Without parameter or with Auto uses the settings set in Cooling Aid. XX.X sets the target cooling temperature. The parameter A-XX.X will sets cooling to XX.X below the ambient temperature. Requires a
temperature sensor to determine the ambient temperature.
Syntax: #CCDCool XX.X/auto/A-XX.X
-
#CCDPower - Enables or disables CCD
/CMOS camera cooling power
Syntax: #CCDPower On/Off
-
Syntax: #CCDWarm XX.X/auto
-
#CCDOffset - changes the CCD
/CMOS Offset or Black Level to a new integer value. Works only when native ZWO or AltairAstro connection is used.
Syntax: #CCDOffset Number
-
#ConditionalStop - stops the execution of the current plan when condition is met. Once the command is used in a plan the condition will be evaluated after every exposure no matter if there other commands are used. If other #ConditionalStop is used then it will become the active condition. There are many parameters that can be used. The Script Editor makes the usage much easier!
Syntax: #ConditionalStop EndDSD PlanName - will stop the plan on Deep Sky Darkness end and will execute the imaging plan with the defined name (if plan name is given)
Syntax: #ConditionalStop EndAN PlanName - will stop the plan on Astro Night end and will execute the imaging plan with the defined name (if plan name is given)
Syntax: #ConditionalStop EndN PlanName - will stop the plan on Night end and will execute the imaging plan with the defined name (if plan name is given)
Syntax: #ConditionalStop Alt XX.XX PlanName - will stop the plan when object's Altitude goes bellow the given number and will execute the imaging plan with the defined name (if plan name is given)
Syntax: #ConditionalStop Time XX:XX PlanName - will stop the plan when the defined time is passed and will execute the imaging plan with the defined name (if plan name is given)
Syntax: #ConditionalStop BeforeMeridian XX PlanName - will stop the plan if the object is less than XX minutes from the meridian passing and will execute the imaging plan with the defined name (if plan name is given)
-
#CoverState - changes the state of the connected
Cover to opened or closed.
Syntax: #CoverState Opened/Closed
-
#DataTransfer - Starts the transfer of the queued files in
DataCraft.
Syntax: #DataTransfer
-
Syntax: #DitherN Number
-
#FocuserGoTo - moves the focuser to given position or the string @1 or @2 or @3 which corresponds to the stored positions in
Gear tab
Syntax: #FocuserGoTo Number
-
#FocuserMove - moves the focuser with the defined step. Negative number is inward move, positive number is outward move
Syntax: #FocuserMove Number
-
#GoTo++ - Goes to the given coordinates using
PointCraft and GoTo++. If
Guide Control is enabled will command completion the guiding will be re-engaged. The first parameter defines how many seconds to be the exposures for the GoTo++. Auto will use the exposure defined in the
Camera Tab or the default exposure set in
PointCraft settings. The second parameter defines what solving to use for the first exposure. If the scope is not aligned you can select Blind solving for the first step of GoTo++, next steps will use Near solving. Follows the RA and Dec which can be in any valid format (XX.X or hh:mm:ss/dd:mm:ss). The parameter FastCheck will use the current image on the screen as first step of the GoTo++ process. It is handy if you use the #GoTo++ for periodically re-centering the target during the image plan. the last take image will be used instead of taking dedicated image. If there are letters after Dec or FastCheck it will be used as Object Name and will be used for file naming, folders and etc.
Syntax: #GoTo++ XX/Auto Blind/Near RA Dec FastCheck ObjectName
-
#GoTo - Goes to the given coordinates. RA and Dec can be in any valid format (XX.X or hh:mm:ss/dd:mm:ss). If
Guide Control is enabled will command completion the guiding will be re-engaged.
Syntax: #GoTo RA Dec
-
#GoToOffset - Goes to an offset from current position. The offset is in arc-minutes from current RA/Dec position. If
Guide Control is enabled will command completion the guiding will be re-engaged.
Syntax: #GoToOffset RAoffset DecOffsed
-
#GoToAltAz - Goes to the given Altitude/Azimuth coordinates. Alt and Az are in degrees. If
Guide Control is enabled will command completion the guiding will be re-engaged.
Syntax: #GoToAltAz Alt Az
-
#GuideControl - Stops or starts guiding (works for PHD2 / PHD1 / MGEN2/3 ). When the guiding is starting, define a pause in the imaging plan line to give some time the guiding to stabilize.
Syntax: #GuideControl Start/Stop
-
#LoadImage - Loads an image. The parameter is the image full path and file name or the word "Auto". Use "Auto" to load the last take image. If no image is taken in this session yet, will be loaded the last take image from the previous session.
Syntax: #LoadImage PathName/Auto
-
#NextPlan - Defines plan that the be executed after completion of the current plan. This command just defines next plan, it will not be executed before current plan completion, so there is no problem to use the command in Vertical plans. Note that if there are more than one plan with same name, will be executed the first one found in the plans list.
Syntax: #NextPlan PlanName
-
#PanelState - changes the state of the connected
Flat Panel to On/Off and the panel brightness percent (from 0/% to 100%) when the state is On.
Syntax: #PanelState On/Off XXX
-
-
#Pause - Makes pause shows defined message and waits for resuming the plan execution.
Syntax: #Pause Message
-
#Refocus - pauses the execution of the current executes automatic refocusing using
Auto Focus Aid and
FocusCraft, after that resumes the imaging plan.
-
#RefocusPause - Enables or disables Refocusing automatic refocusing.
Syntax: #RefocusPause On/Off
-
#RepeatTillAlt - Defines that the current plans should be executed till the object Altitude becomes lower than the defined limit. If the plan is shorter it will be started from the beginning. If executed this command in the beginning of the plan the logic will be "Execute the plan as long as it is possible, if there is time repeat the lines as much lines as possible". If the command is executed as last line the logic is "Execute the plans once, if there is time repeat the plan as long as possible". The second option ensures that the plan will be executed at least once, the first option ensures that the plan will stop on the defined time no matter if the whole plan is full executed at least once.
Syntax: #RepeatTillAlt XX.X
-
#RepeatTillTime - Defines that the current plans should be executed till the given time. If the plan is shorter it will be started from the beginning. If executed this command in the beginning of the plan the logic will be "Execute the plan as long as it is possible, if there is time repeat the lines as much lines as possible". If the command is executed as last line the logic is "Execute the plans once, if there is time repeat the plan as long as possible". The second option ensures that the plan will be executed at least once, the first option ensures that the plan will stop on the defined time no matter if the whole plan is full executed at least once.
Syntax: #RepeatTillTime XX:XX:XX
-
#ResetFocusCraft - Resets the
FocusCraft best values and the graph.
-
#ResetImageID - Resets the image ID counter. It does the same as "
Reset Image ID" button.
-
#RotatorPos - Sets the
Rotator position to the given angle in degrees.
Syntax: #RotatorPos X.XX
-
#SetObjName - change the object name. Affects the storage folder name if Object Name is part of the naming.
Syntax: #SetObjName NewName
-
#SolveSync - Uses
PointCraft to make
Near or
Blind plate-solving and then
Sync the mount to the found coordinates.
NOTE: No sync will be made if the declination is bigger than 85 or lower than -85
Syntax: #SolveSync Near/Blind
-
#SolveGoTo - Uses
PointCraft to make
Near or
Blind plate-solving and then go to the found coordinates without making synchronization. Useful in combination with #LoadImage command. If
Guide Control is enabled will command completion the guiding will be re-engaged.
Syntax: #SolveGoTo Near/Blind
-
#Shutdown - Without parameter shutdowns the computer. If there is optional parameter makes the one of the desired action.
Syntax: #Shutdown restart/standby/hibernate
-
#StopPlan - stops the execution of the current plan. If there is parameter "Full" it will cancel the execution of #NextPlan too.
-
#SwitchState - changes the state port/switch state of the connected
Ports Hub to On/Off the XXX is the port number.
Syntax: #SwitchState XXX On/Off
-
#SwitchSet - changes the port/switch value of the connected
Ports Hub. XXX is the port number, X.XX is the port value. If the port is accepting only On/Off the X.XX could be also On/Off words
Syntax: #SwitchSet XXX X.XX
-
#Tracking - Enables or disables mount tracking
Syntax: #Tracking On/Off
-
Syntax: #TempCompensationPause On/Off
-
#WaitTillTime- Holds the next exposure till the given local time. If the parameter
ResumeIfPassed is used and the give time is passed the execution will be resumed. If there is no such parameter and the time has passed the plan execution will be resumed on the next day.
Syntax: #WaitTillTime XX:XX:XX ResumeIfPassed
-
#UnPark - unparks the scope.
If the mount is not supporting movements by Alt/Az coordinates APT will convert them to RA/Dec for current time and for the current
Location.
Tips&Tricks To make easier the use of #GoTo in combination with Object Browser, use Shift+Click on the OK button in the browser. This will store in the clipboard ready to use #GoTo with the coordinates of the selected object.
In case you want to execute external script or a program there are some parameters that you can send:
%LastFile% - the path and file name of the last saved image
%CurrExp% - the number of the current exposure
%TotalCount% - the total count of exposures to make in a plan
%EDuration% - the expected remaining duration (00X’ or 00X”)
%ETime% - the expected time when the plan will end
%ISO% - the current ISO
%Gain% - the current gain
%Exp% - the current exposure time
%PCBat% - the PC battery percent
%CamBat% - the Camera battery percent
%CamSpace% - the free space on the camera card
%ExifT% - the temperature reported by EOS Exif or by the CCD/CMOS
%RA% - the right accession reported by
telescope
%DEC% - the declination reported by
telescope
%Obj% - the entered object name
%FocalLen% - the entered focal length
%FocusPos% - the current position of the
focuser
%ImageY% - the image height
%ImageX% - the image width
%Pixel% - the pixel size
%Lat% - the site Latitude
%Long% - the site Longitude
%SQM% - the Sky Quality value
%ATimeDayEnd% - time when Sun sets
%ATimeDayStart%, - time when Sun rises
%ATimeNautStart% - time when Nautical Twilight starts
%ATimeNautEnd% - time when Nautical Twilight ends
%ATimeANStart% - time when Astro Night starts
%ATimeANEnd% - time when Astro Night ends
Example : test.vbs %LastFile% %CurrExp%
This will try to execute the script test.vbs (if there is no path the script has to be located in the APT folder) and will pass path is file name of the last take image as first parameter and the number of the exposure as second one.
Tips&Tricks If a pause is defined it will be executed after execution of the command or script.