Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Asynchronously save images #132

Open
pgriffin17 opened this issue Jan 8, 2024 · 1 comment
Open

[ENHANCEMENT] Asynchronously save images #132

pgriffin17 opened this issue Jan 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pgriffin17
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
The Observatory.save_last_image function takes some time to complete (1.6 seconds on my machine in a Jupyter notebook with my 4 MB images). I suspect this will take at least as much time, if not longer, for images to save when used with pyscope under typical circumstances. Over nights where we take 800 images, this could add up to around 20 minutes of image save time during which no new images could be taken.

Describe the solution you'd like
Images should be saved asynchronously so that the telescope can either begin slewing to a new location or a new image can be requested once the previous image is downloaded. I believe that NINA saves images asynchronously, maybe we can gain insight from their implementation. SharpCap also downloads images from the camera into a temporary RAM buffer before saving out, allowing several short exposure images to be taken quickly (until that buffer fills up, at which point the image cadence slows).

@pgriffin17 pgriffin17 added the enhancement New feature or request label Jan 8, 2024
@pgriffin17
Copy link
Collaborator Author

It may make sense to have a header-writing queue that we have as a dictionary. This dictionary would include the filename of the file in question, as well as a dictionary of FITS header cards. We would have Observatory obtain all of the FITS header cards from the observatory while/during/directly after the image is taken, save those into this dictionary, and send this dictionary to an asynchronous process to save that dictionary to a file which contains the queue of image filenames and header info to write into them. A separate process could look at this queue, load the image, write the header data to the file, and then platesolve the image, saving the image with the WCS solution. This will help to minimize down-time between successive images, especially helping in instances of short images on the same target, such as for exoplanet or asteroid lightcurves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant