Tutorial
Reference Manual
Installation
Tutorial
Reference Manual
Installation
This page contain reference for the JSON-RPC interface.
The program accept JSON-RPC 2.0 request on the port 3277 using both direct socket or HTTP POST.
For HTTP POST set your JSON-RPC procedure to use the following URL:
http://localhost:3277/jsonrpc
This JSON-RPC method are the basis for the Python scripts, both internal (launched from CCDciel) or external (launched from a terminal or another application).
A Python function is provided to simplify the use. The host,port parameters can be use to send the command to another instance of CCDciel.
The syntax is:
jsonresult = ccdciel(method) jsonresult = ccdciel(method,parameter) jsonresult = ccdciel(method,parameter,host,port)
For example:
from ccdciel import ccdciel ra = ccdciel('TelescopeRA')['result']
To make Python to find this function in external script you must specify the environment variable PYTHONPATH, this is not necessary when running the script from CCDciel:
set PYTHONPATH=C:\Program Files\CCDciel\scripts export PYTHONPATH=/usr/share/ccdciel/scripts
Use the standard Python functions ( argv, getopt, argparse) to retrieve the script parameters. For example:
print ('Argument List:', str(sys.argv))
The invocation format for this methods is: {“jsonrpc”: “2.0”, “method”: “method_name”, “id”:1}
The responses for this methods are in the form: {“jsonrpc”: “2.0”, “result”: result_value, “id”: 1}
Method name is not case sensitive.
Method name | Result type | Result value |
---|---|---|
CCDciel_Version | array | [main version, short revision, full revision] |
Devices | array | The driver and connection type for each defined device |
Devices_connected | bool | True if all the devices are connected |
Camera_connected | bool | True if the camera is connected |
Camera_getframe | integer | Camera frame [x,y,width,heigth] |
CcdTemp | double | The current CCD temperature |
Preview_getexposure | double | Get the preview exposure time |
Preview_getbinning | string | Get the preview binning |
Preview_running | bool | True if the preview is running |
Preview_loop_running | bool | True if the preview is in loop |
Capture_getexposure | double | Get the capture exposure |
Capture_getbinning | string | Get the capture binning |
Capture_getobjectname | string | Get the capture object name |
Capture_getcount | integer | Get the capture image count |
Capture_getframetype | string | Get the capture frame type |
Capture_getdither | integer | Get the capture Dither count |
Capture_running | bool | True if a capture is running |
Capture_getLastfilename | string | The full path name of the last saved file |
Telescope_connected | bool | True if the telescope is connected |
Telescope_eqmod | bool | True if the telescope use the EqMod driver |
Telescope_parked | bool | True if the telescope is parked |
Telescope_tracking | bool | True if the telescope is tracking |
Telescope_trackingrate | string | SIDEREAL, LUNAR, SOLAR, CUSTOM |
Telescope_PierSide | string | pierEast, pierWest, pierUnknown, pierNotImplemented |
Telescope_slewing | bool | True if the telescope is slewing |
TelescopeRA | double | The telescope position right ascension |
TelescopeDE | double | The telescope position declination |
Wheel_connected | bool | True if the filter wheel is connected |
Wheel_GetfiltersName | array | The name of the filters in the wheel |
Focuser_connected | bool | True if the focuser is connected |
FocuserPosition | int | The focuser absolute position |
CoverStatus | string | The status of the telescope cover |
CalibratorStatus | string | The status of the flat calibrator |
CalibratorBrightness | int | The brightness of the calibrator |
Autoguider_connected | bool | True if the auto-guider is connected |
Autoguider_running | bool | True if the auto-guider is running |
Autoguider_guiding | bool | True if the auto-guider is guiding |
Autoguider_Getlockposition | x,y | The current guide lock position |
Internalguider_GetGuideExposure | double | The guider exposure time |
Internalguider_GetSpectrofunction | bool | The value of “Activate spectroscopy function” |
Internalguider_GetSpectroSinglestar | bool | The value of “Activate single star guiding on fixed location” |
Internalguider_GetSpectroChangeMultistar | bool | The value of “Change to multistar after the star is locked” |
Internalguider_GetSpectroAstrometry | bool | The value of “Use astrometry to identify the target” |
Internalguider_GetSpectroAstrometryExposure | double | The exposure time for the astrometry |
Internalguider_GetSpectroSlitname | string | The selected slit name in the list of slit offset |
Internalguider_GetSpectroGuidestaroffset | double, double | The X,Y guide star offset relative to the target |
Internalguider_GetSpectroMultistaroffset | double, double | The current multi-star guide offset |
Planetarium_connected | bool | True if the planetarium is connected |
TimeNow | string | The current local time on the computer running CCDciel |
Obs_latitude | double | The observer latitude |
Obs_longitude | double | The observer longitude |
Obs_elevation | double | The observer elevation |
HostOS | string | The operating system on the computer running CCDciel |
DirectorySeparator | string | The directory separator symbol on the computer running CCDciel |
AppDir | string | The directory where the program is installed |
TmpDir | string | The directory for temporary files |
CaptureDir | string | The directory to save the images from capture sequence |
The invocation format for this methods is: {“jsonrpc”: “2.0”, “method”: “method_name”, “id”:1}
The responses for this methods are in the form: {“jsonrpc”: “2.0”, “result”:{“status”: “OK!”}, “id”: 1}
Status can be “OK!” if the command is successful, or “Failed!” if not. In this later case it can contain information about why it fail.
Method name is not case sensitive.
Method name | Function |
---|---|
Camera_Resetframe | Reset the camera full frame ROI |
Preview_single | Start a single preview |
Preview_loop | Start a preview loop |
Preview_waitloop | Wait until the user stop the preview loop |
Preview_stop | Stop any in progress preview or preview loop |
Capture_start | Start a capture |
Capture_stop | Stop a capture |
Finder_Stoploop | Stop the finder loop |
Telescope_track | Start telescope tracking |
Telescope_abortmotion | Stop any telescope movement |
Eqmod_clearpoints | Clear EqMod alignment data |
Eqmod_clearsyncdelta | Clear Eqmod sync delta |
Eqmod_stdsync | Set Eqmod in Standard sync mode |
Eqmod_appendsync | Set Eqmod in Add point on sync mode |
Wheel_getfilter | Get the current filter number in the wheel |
Cover_open | Open the telescope cover |
Cover_close | Close the telescope cover |
Calibrator_light_off | Turn flat calibrator light off |
Autofocus | Run auto-focus at the current position, same as the Autofocus button |
AutomaticAutofocus | Run auto-focus, same as invoked from a sequence, will eventually move to a bright star |
Astrometry_solve | Plate solve the current image |
Astrometry_sync | Plate solve the current image and sync the telescope |
Astrometry_slew_image_center | Plate solve the current image and slew the telescope |
Astrometry_plot_dso | Plate solve the current image and annotate DSO |
Astrometry_plot_hyperleda | Plate solve the current image and annotate DSO using the hyperleda catalog |
Autoguider_connect | Connect to the autoguider software |
Autoguider_calibrate | Force a new calibration of the autoguider |
Autoguider_startguiding | Start to guide |
Autoguider_stopguiding | Stop guiding |
Autoguider_pause | Pause guiding |
Autoguider_unpause | Restart after pause |
Autoguider_dither | Dither now |
Autoguider_shutdown | Close the autoguider program |
Planetarium_connect | Connect the planetarium software |
Planetarium_showimage | Plate solve the current image and show in planetarium |
Planetarium_shutdown | Close the planetarium software |
Program_shutdown | Close CCDciel |
Clear_reference_image | Remove the reference image |
CustomHeader_clear | Delete all the custom header keywords |
The invocation format for this methods is: {“jsonrpc”: “2.0”, “method”: “method_name”, “params”: [params], “id”:1}
The responses for this methods are in the form: {“jsonrpc”: “2.0”, “result”:{“status”: “OK!”}, “id”: 1}
Status can be “OK!” if the command is successful, or “Failed!” if not. In this later case it can contain information about why it fail.
Method name is not case sensitive.
Method name | Parameter | Function |
---|---|---|
Devices_connection | True / False | Connect or disconnect the devices |
Ccd_settemperature | temp | Set the CCD temperature |
Camera_Setframe | [x,y,width,height] | Set the camera frame size (ROI) |
Preview_setexposure | exp | Set the preview exposure time |
Preview_setbinning | bin | Set the preview binning |
Capture_setexposure | exp | Set the capture exposure |
Capture_setbinning | bin | Set the capture binning |
Capture_setobjectname | name | Set the capture object name |
Capture_setcount | count | Set the capture image count |
Capture_setframetype | Light/Bias/Dark/Flat | Set the capture frame type |
Capture_setdither | count | Set the capture Dither count |
Finder_Saveimage | ON/OFF | Activate the saving of finder image when looping |
Finder_Startloop | exposure time | Start the finder loop with the given exposure time |
Finder_Snapshot | exposure time, filename, count | Take a series of finder camera snapshot |
Internalguider_Snapshot | exposure time, filename, count | Take a series of guide camera snapshot, guiding must be stopped before to use this command |
Sequence_start | sequence | Load and start the sequence |
Telescope_settrackingrate | rate | rate = SIDEREAL,LUNAR,SOLAR |
Telescope_slew | [RA, DEC] | Slew to specified coordinates, do not return until the slew is complete |
Telescope_slewasync | [RA, DEC] | Slew to specified coordinates, return immediatelly |
Telescope_sync | [RA, DEC] | Sync to specified coordinates |
Telescope_park | True / False | Park or unpark the telescope |
Autoguider_Setlockposition | x,y | Set immediately the new guide lock position in PHD2 or Internal guider |
Autoguider_Storelockposition | x,y | Store the guide lock position for the next time guiding is started |
Internalguider_SetGuideExposure | double | Set the guider exposure time |
Internalguider_SetSpectrofunction | bool | Set the value of “Activate spectroscopy function” |
Internalguider_SetSpectroSinglestar | bool | Set the value of “Activate single star guiding on fixed location” |
Internalguider_SetSpectroChangeMultistar | bool | Set the value of “Change to multistar after the star is locked” |
Internalguider_SetSpectroAstrometry | bool | Set the value of “Use astrometry to identify the target” |
Internalguider_SetSpectroAstrometryExposure | double | Set the exposure time for the astrometry |
Internalguider_SetSpectroSlitname | string | Select this slit name in list to set the slit offset |
Internalguider_SetSpectroGuidestaroffset | double, double | Set the X,Y guide star offset relative to the target |
Internalguider_SetSpectroMultistaroffset | double, double | Set the X,Y multi-star guide offset |
Wheel_setfilter | number | Set the filter number in the wheel |
Focuser_setposition | number | Set the focuser absolute position |
SetFocusXY | X,Y | Select the star at position X,Y for focus operation |
Get_Switch | nickname,switchname | Return the current value for the switch |
Set_Switch | nickname,switchname,value | Set the value of the switch |
Calibrator_light_on | brightness | Light the flat calibrator at the specified brightness |
Planetarium_showimage_fov | FOV [degree] | Plate solve the current image and show in planetarium using the specified field of view |
Eq2hz | [RA, DEC] | From apparent ra,dec, return alt,az coordinates. RA in hours, all other angle in degree |
Hz2eq | [AZ, ALT] | From az,alt, return apparent ra,dec coordinates. RA in hours, all other angle in degree |
Save_fits_file | filename | Save the FITS file |
Open_fits_file | filename | Open the FITS file |
Open_reference_image | filename | Load a reference image |
LogMsg | text | Print text in CCDciel log |
CustomHeader_add | [key,value] | Add a new custom header keyword with value. Replace the value if the key already exist |
CustomHeader_del | key | Delete all the occurrence of this custom header keyword |
CustomHeader | key | Return the value for this keyword |
This method return a global program status with the same information as the Status web page.
method | status |
---|---|
params | devices planetarium autoguider safety weather dome mount camera wheel rotator focuser sequence capture log |
The params field allow to filter the information send by the program.
When the params field is not specified the response include all the information.
Example:
$ telnet localhost 3277 Connected to localhost. {"jsonrpc": "2.0", "method": "status", "params": ["camera","focuser"], "id": 2} {"jsonrpc": "2.0", "result":{"camera": {"connected": true, "binning": "1x1", "frame": "0/0/1280/1024", "cooler": false, "temperature": 0.0}, "focuser": {"connected": true, "position": 37200, "temperature": 0.0, "focusermessage": "AutoFocus successful; 15:03:52 HFD=4.2"}}, "id": 2}
There is three way to get the status information: