This repository contains 2 tools:
- raw2fits module which converts a given RAW image file to FITS.
- watchnconvert which watches a directory for new RAW files and converts them as they appear.
Requires Python >= 3.9 and pip
pip install -r requirements.txt
Run with default parameter values:
python watchnconvert.py
To see available parameters and their default values:
python watchnconvert.py --help
This can then be used e.g. with the INDI CCD Simulator to make real photos available to consuming software such as KStars with cameras that aren't directly supported.
For example, one can use an EZ Share card and my ezshare tool to download images from an unsupported camera via WiFi, and then automatically convert them to FITS, which allows them to be used in the INDI CCD Simulator and therefore INDI clients apps.
- In ezshare Typescript project start
npm run olyto download images from an Olympus PEN camera (usenpm run startwith appropriate parameters for other cameras). - In this project directory, start
python watchnconvert.py --directory ../ezshare/raws/ --output_file ./latest.fitsto auto-convert new images to./latest.fits - Make sure there are no other
.fitsfiles in this directory. - In INDI CCD Sim config, watch this project direcotry.
- Now, triggering an image capture in EKOS will load the current content of
latest.fits.
So the flow is generally:1
- Capture image in camera.
- Wait for image being downloaded and converted.
- Trigger capture in EKOS (or other INDI clients) to load the image.
This implies of course that it's generally not suitable for automatic workflows, as one needs to trigger the camera, and do so before triggering the capture in EKOS. Except in some cases with some workarounds:
With a bit of trickery, one can use it e.g. for the polar alignment. The idea is to set the exposure lenght long enough to allow for steps 1. and 2. above to be completed before the alignment process tries to load the next image.
But a problem here is that the CCD Simulator loads the image from disk at the beginngin of the exposure time, not at the end. However, if the plate solving fails for a captured image, it makes another capture and tries again. So we can exploit this by letting it intentionally fail for the first time, by giving it a non-solvable image (e.g. pure noise or black) to give us enough time to do steps 1. and 2. above before the 2nd capture in the 2nd and 3rd alignment step:
- Set Exposure time to a value which is greater than the max. download time from the EZ Share card + some extra (>= 45 seconds in my case).
- Slew mount to start location.
- Make first capture and wait for it to be downloaded and converted.
- Start Polar alignment. It will immediate make the first capture and load the image from step 2.
- After completion of capture, while mount is slewing to the next position,
cp <path-to-noise.fits> ./latest.fitsto let plate solving fail, which makes time for capturing, downloading and converting a new image. - Capture new image in camera. It will be picked up automatically on the retried capture. Repeat from 5. for the third alignment step.
- For the final adjustment step, just keep capturing; images will be picked up automatically.
One can probably streamline this by avoiding the purposeful failing and re-capturing (which makes each step take >= 90 seconds) by using manual slewing instead; but I haven't tried that yet.