Repository contains the CCDCiel python scripts for making easier some complex operations. https://github.com/JBielanski/CCDCiel_Scripts
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
See the top-level LICENSE file for the full license text.
Copyright (c) 2025 Jan Bielanski
Script to manage focuser position per filter
- calculate focuser position for selected filter using autofocus tool
- store information about filter and calculated focus point in database
- read and set focuser position from/to database
- work in three modes:
- 'CALCULATE' [DEFAULT] calculate focuser position for all filters in filter wheel and store in database
- 'READ' read configuration for focuser and filters from database
- 'RESET' reset focuser position to 0, set first filter in filters wheel, reomove all offsets for filters
- allow to select focus method:
- 'AUTO' [DEFAULT] can move to focus star
- 'INPLACE' perform autofocus in current position
- allow to provide reference/current filter name (for CCDCiel older than 0.9.92-3829) as parameter
- allow to select subsets of filters for session
Requirements:
CCDCiel 0.9.92-3829 or newer: https://vega.ap-i.net/pub/ccdciel/daily_build/
For older vesion script works differently for READ mode and disable all operation in script which try to modify offsets in CCDCiel
Script use the CCDciel JSON-RPC interface. For more information and reference of the available methods see: https://www.ap-i.net/ccdciel/en/documentation/jsonrpc_reference
Script usage, scenarios:
- First usage
- set manually focuser in position near focuse point
- run script with parameters:
--> "-m CALCULATE" - [OPTIONAL] calculate is default mode
--> "-f " - [OBLIGATORY] provide position near focus point
--> "-n " OR "-i " - [OBLIGATORY] to set reference filter
--> -s - [OPTIONAL] run autofocus for selected filters, provide list as array like: [1,3,4,5] (*)
--> "-d " - [OPTIONAL] name of database, default "focuser_position_per_filter.db"
--> "-t " - [OPTIONAL] set autofocus method AUTO or INPLACE, AUTO is default and could move telescope to focus star
- Usage when database has been created:
- run script with parameters:
--> "-m CALCULATE" - [OPTIONAL] calculate is default mode
--> "-d " - [OBLIGATORY/OPTIONAL] name of database if you provide own name, default "focuser_position_per_filter.db"
--> "-t " - [OPTIONAL] set autofocus method AUTO or INPLACE, AUTO is default and could move telescope to focus star
--> "-n " OR "-i " - [OPTIONAL] to change reference filter, if not provided used reference filter from database
--> -s - [OPTIONAL] run autofocus for selected filters, provide list as array like: [1,3,4,5] (*)
- Read data from database without running autofocus
- run script with parameters:
--> "-m READ" - [OBLIGATORY] script will read data from database
--> "-d " - [OBLIGATORY/OPTIONAL] name of database if you provide own name, default "focuser_position_per_filter.db"
--> "-n " - [OBLIGATORY/OPTIONAL] set reference filter optional for new CCDCiel, for CCDCiel older than 0.9.92-3829 set current filter and read position, so parameter is obligatory
- Reset focuser and filter wheel data, useful at the end off session
- run script with parameters:
--> "-m RESET" - [OBLIGATORY] reset configuration in CCDCiel (Remove all offsets / set filter wheel on FIRST position / set focuser on ZERO position)
- Display help
- run script with parameters:
--> "--help" - display help
(*) for calculation will be used filters with index 1,3,4 and 5 if they are in filters wheel others filters will be marked as not in use.
- calculate focuser position for selected filter using autofocus tool
- store information about filter and calculated focus point in database
- script remember filter which was set before script has been started
- script try to use current focuser position to initial for autofocus if: -- can not read position from database -- focuser position send as parameter to script is 0
- script exit if focuser position is 0 and ask to set it manually
- script at the end return to filter which was set before script has been started and set focuser position to calculated value for this filter
- added reference filter and offset for each filter in database
- move to reference filter after calculate focuser position for all filters in filters wheel
- added working modes: CALCULATE (default) and READ
- added command line arguments parser
- added RESET working mode to reset focuser positions and offsets for all filters
- added check for sqlite3 module
- support recognize CCDCiel version in script
- disable setting OFFSET for CCDCiel older than 0.9.92.3829
- added option which allow to provide reference filter: --filtername, -n
- added selection between AutomaticAutofocus and Autofocus by: --focustype, -t <autofocus type: AUTO, INPLACE>
- added filter usage flag in database, allow to reduce filters for which will autofocus to selected subset: SELECTED FILTERS + REFERENCE FILTER
- for other filters only offset will be recalculated
- release under GPL-3.0 license
- added command line argument to select filters subset: --subset, -s
- added selection of reference filter by ID --filterid, -i
- selection reference filter by name and index can not be use together, use: --filtername, -n OR --filterid, -i
- RESET - remove all offsets, set filter wheel on FIRST position, set focuser on ZERO position