def is_safe(self, stale=180):
        assert self._current_col, self.logger.warning("No connection to sensors, can't check weather safety")

        # Always assume False
        self._is_safe = False
        record = {'safe': False}

        try:
            record = self._current_col.find_one({'type': 'weather'})

            is_safe = record['data'].get('Safe', False)
            self.logger.debug("is_safe: {}".format(is_safe))

            timestamp = record['date']
            self.logger.debug("timestamp: {}".format(timestamp))

            age = (current_time().datetime - timestamp).total_seconds()
            self.logger.debug("age: {} seconds".format(age))

        except:
            self.logger.warning("Weather not safe or no record found in Mongo DB")
            is_safe = False
        else:
            if age > stale:
                self.logger.warning("Weather record looks stale, marking unsafe.")
                is_safe = False
        finally:
            self._is_safe = is_safe

        return self._is_safe
Determines whether current conditions are safe or not
dataset/ETHPy150Open panoptes/POCS/panoptes/weather/weather_station.py/WeatherStationMongo.is_safe