Skip to content

Commit

Permalink
Moved camera EXPTIME check from observatory to ASCOM driver
Browse files Browse the repository at this point in the history
  • Loading branch information
pgriffin17 committed Jan 8, 2024
1 parent 404e03d commit 2bf796d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
12 changes: 11 additions & 1 deletion pyscope/observatory/ascom_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
self._last_exposure_start_time = None
self._image_data_type = None
self._DoTranspose = True
self._camera_time = True

def AbortExposure(self):
logger.debug(f"ASCOMCamera.AbortExposure() called")
Expand Down Expand Up @@ -124,6 +125,11 @@ def CameraYSize(self):
logger.debug(f"ASCOMCamera.CameraYSize property called")
return self._device.CameraYSize

@property
def CameraTime(self):
logger.debug(f"ASCOMCamera.CameraTime property called")
return self._camera_time

@property
def CanAbortExposure(self):
logger.debug(f"ASCOMCamera.CanAbortExposure property called")
Expand Down Expand Up @@ -274,7 +280,11 @@ def IsPulseGuiding(self):
@property
def LastExposureDuration(self):
logger.debug(f"ASCOMCamera.LastExposureDuration property called")
return self._device.LastExposureDuration
last_exposure_duration = self._device.LastExposureDuration
if last_exposure_duration is None or last_exposure_duration == 0:
last_exposure_duration = self.LastInputExposureDuration
self._camera_time = False
return last_exposure_duration

@property
def LastExposureStartTime(self):
Expand Down
21 changes: 5 additions & 16 deletions pyscope/observatory/observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2522,24 +2522,13 @@ def camera_info(self):
except:
pass
try:
# If ASCOM camera, EXPTIME and EXPOSURE should be obtained
# from camera.LastExposureDuration (if that property exists or is not 0.0).
if self._camera_driver == "ASCOMCamera":
try:
last_exposure_duration = self.camera.LastExposureDuration
cam_time = True
if last_exposure_duration == 0:
last_exposure_duration = self.camera.LastInputExposureDuration
cam_time = False
except:
last_exposure_duration = self.camera.LastInputExposureDuration
cam_time = False
else:
last_exposure_duration = None
cam_time = False
last_exposure_duration = self.camera.LastExposureDuration
info["EXPTIME"] = (last_exposure_duration, info["EXPTIME"][1])
info["EXPOSURE"] = (last_exposure_duration, info["EXPOSURE"][1])
info["CAMTIME"] = (cam_time, info["CAMTIME"][1])
except:
pass
try:
info["CAMTIME"] = (self.camera.CameraTime, info["CAMTIME"][1])
except:
pass
try:
Expand Down

0 comments on commit 2bf796d

Please sign in to comment.