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

Adjustments for pyscope on real hardware #127

Merged
merged 13 commits into from
Jan 9, 2024

Conversation

pgriffin17
Copy link
Collaborator

Solves #125 by implementing a working exposure time logging property in the ascom_camera.py script in my exptime branch and updating the observatory class to use this, which results in the last user-input exposure time being logged to the FITS header if the ASCOM LastExposureDuration function is not implemented in the ASCOM driver.

This builds off of #124 .

@pgriffin17 pgriffin17 marked this pull request as ready for review January 8, 2024 01:16
@pgriffin17 pgriffin17 marked this pull request as draft January 8, 2024 01:23
@pgriffin17
Copy link
Collaborator Author

pgriffin17 commented Jan 8, 2024

Current changelog

  • Adds new ASCOM camera properties of _last_exposure_duration and _last_exposure_time

    • These hold temporary exposure duration and image start time values in the case that the camera does not support actual readout of these parameters (as is the case for ZWO ASI290MM Mini).
  • Adds LastInputExposureDuration property to ASCOM camera driver

    • This exposes _last_exposure_duration as set by the user.
  • Currently the Observatory class has checks on which value to place for EXPTIME and EXPOSURE (this should probably be moved to the ASCOM Camera driver

    • Also adds CAMTIME to FITS header, which is True if the EXPTIME/EXPOSURE is set from the camera's own time or if it is using the user's input time.
  • Changes _last_exposure_start_time in maxim driver to use dt.utcnow() instead of time.time().

@pgriffin17
Copy link
Collaborator Author

I've now added a function to ASCOM Camera that will set the image data type appropriately depending on the camera settings. Documentation is shown below:
image

@pgriffin17
Copy link
Collaborator Author

pgriffin17 commented Jan 8, 2024

Fixes #125, #128, and allows pyscope to function on real minimal hardware setups.

  • Tested on Losmandy Gemini (1) G11 German Equatorial mount along with ZWO ASI290MM Mini camera.

ASCOM Cameras now have their image arrays transposed by default to match their standard orientation, as well as having their data type set to 16 bit by default, or based off of their MaxADU (as in the documentation or in the screenshot above). This keeps the Observatory class the same as far as the ImageArray property is concerned.

Changelog:

ASCOM Camera related features

  • Adds new ASCOM camera properties of _last_exposure_duration and _last_exposure_time
    • These hold temporary exposure duration and image start time values in the case that the camera does not support actual readout of these parameters (as is the case for ZWO ASI290MM Mini).
  • Adds LastInputExposureDuration property to ASCOM camera driver
    • This exposes _last_exposure_duration as set by the user.
  • Adds new ASCOM camera properties of _image_data_type, and _DoTranspose
    • These store the optimal data type for the images (as set by SetImageDataType()) and whether the ImageArray should be transposed.
  • Currently the Observatory class has checks on which value to place for EXPTIME and EXPOSURE (this should probably be moved to the ASCOM Camera driver)
    • Also adds CAMTIME to FITS header, which is True if the EXPTIME/EXPOSURE is set from the camera's own time or if it is using the user's input time.

Observatory class optimizations

  • The Observatory class previously had several calls to self.camera.ImageArray within the save_last_image() function. These have now been reduced to one call that is stored in a variable and referenced several times.

Camera driver optimizations

  • Changes _last_exposure_start_time in maxim driver and ASCOM camera driver to use dt.utcnow() instead of time.time().

Get Real Hardware Working by changing _read_out_kwargs

  • To get real hardware working, adjusted location setting lines to ensure that devices are connected before setting mount parameters
  • Also cleared up some Cover Calibrator if statements
  • Part of the rotator section caused errors, so added a check to ensure the rotator driver was assigned before checking some kwargs.

Next up is to move EXPTIME/EXPOSURE checks (on using the camera's own exposure time, if it exists, or the user input exposure time) from the Observatory class to the ASCOM Camera driver.

@pgriffin17
Copy link
Collaborator Author

Now I have moved EXPTIME/EXPOSURE checks (on using the camera's own exposure time, if it exists, or the user input exposure time) from the Observatory class to the ASCOM Camera driver.

@pgriffin17 pgriffin17 marked this pull request as ready for review January 8, 2024 23:16
@pgriffin17 pgriffin17 changed the title Exptime update Adjustments for pyscope on real hardware Jan 8, 2024
@pgriffin17
Copy link
Collaborator Author

This pull request:

closes #125
closes #128

pyscope/observatory/ascom_camera.py Show resolved Hide resolved
pyscope/observatory/maxim.py Show resolved Hide resolved
Copy link
Collaborator Author

@pgriffin17 pgriffin17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use astropy.Time.now() instead of datetime

@WWGolay WWGolay merged commit a9d9dc9 into macro-consortium:main Jan 9, 2024
4 checks passed
@pgriffin17 pgriffin17 deleted the exptime branch January 9, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants