From 72b7e029f843ea23b0246cff2cffb7312faa010f Mon Sep 17 00:00:00 2001 From: danjampro Date: Tue, 22 Jun 2021 11:08:43 +1000 Subject: [PATCH] rely on exptime (#487) --- src/huntsman/pocs/observatory.py | 20 ++++++++------------ src/huntsman/pocs/utils/flats.py | 22 ---------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/src/huntsman/pocs/observatory.py b/src/huntsman/pocs/observatory.py index e2ea2437..7e7cc8fc 100644 --- a/src/huntsman/pocs/observatory.py +++ b/src/huntsman/pocs/observatory.py @@ -677,18 +677,14 @@ def _take_autoflats(self, cameras, observation, target_scaling=0.17, scaling_tol self.logger.info(f"Flat field status for {cam_name}: {status}") # Check if we need to terminate the sequence early - if self.past_midnight: # Sky getting brighter - if all([s.is_too_bright and s.min_exptime_reached for s in sequences.values()]): - self.logger.info("Terminating flat field sequence for the " - f"{observation.filter_name} filter because all exposures are" - " too bright at the minimum exposure time.") - return - else: # Sky getting fainter - if all([s.is_too_faint and s.max_exptime_reached for s in sequences.values()]): - self.logger.info("Terminating flat field sequence for the " - f"{observation.filter_name} filter because all exposures are" - " too faint at the maximum exposure time.") - return + if self.past_midnight and all([s.min_exptime_reached for s in sequences.values()]): + self.logger.info(f"Terminating flat field sequence for {observation.filter_name}" + f" filter because min exposure time reached.") + return + elif all([s.max_exptime_reached for s in sequences.values()]): + self.logger.info(f"Terminating flat field sequence for {observation.filter_name}" + f" filter because max exposure time reached.") + return def _autoflat_target_counts(self, cam_name, target_scaling, scaling_tolerance): """ Get the target counts and tolerance for each camera. diff --git a/src/huntsman/pocs/utils/flats.py b/src/huntsman/pocs/utils/flats.py index ca03e569..1dac5f5d 100644 --- a/src/huntsman/pocs/utils/flats.py +++ b/src/huntsman/pocs/utils/flats.py @@ -153,28 +153,6 @@ def max_exptime_reached(self): except IndexError: return False - @property - def is_too_faint(self): - """ Check if the last exposure was too faint. - Returns: - bool: True if the last exposure was too faint, else False. - """ - try: - return self._average_counts[-1] + self._counts_tolerance < self._target_counts - except IndexError: - return False - - @property - def is_too_bright(self): - """ Check if the last exposure was too bright. - Returns: - bool: True if the last exposure was too bright, else False. - """ - try: - return self._average_counts[-1] - self._counts_tolerance > self._target_counts - except IndexError: - return False - def update(self, filename, exptime, time_start): """ Update the sequence data with the previous iteration. Args: