def test_get_seeing_using_different_start_month(self): seeing1 = SeeingModel(TimeHandler("2020-05-24")) self.assertEqual(seeing1.offset, 12441600) seeing1.initialize(self.environment_config, Filters()) self.assertEqual(seeing1.get_seeing(75400), 0.437314003705978) self.assertEqual(seeing1.get_seeing(76700), 0.510206997394562) self.assertEqual(seeing1.get_seeing(63190400), 0.453994989395142) self.assertEqual(seeing1.get_seeing(189424900), 0.386815994977951)
def __init__(self, options, configuration, database): """Initialize the class. Parameters ---------- options : argparse.Namespace The instance returned by ArgumentParser containing the command-line options. configuration : :class:`.SimulationConfig` The simulation configuration instance. database : :class:`.SocsDatabase` The simulation database instance. """ self.opts = options self.conf = configuration self.db = database if self.opts.frac_duration == -1: self.fractional_duration = self.conf.survey.duration else: self.fractional_duration = self.opts.frac_duration self.conf.survey.duration = self.opts.frac_duration self.time_handler = TimeHandler(self.conf.survey.start_date) self.log = logging.getLogger("kernel.Simulator") self.sal = SalManager() self.seq = Sequencer(self.conf.observing_site, self.conf.survey.idle_delay) self.dh = DowntimeHandler() self.conf_comm = ConfigurationCommunicator() self.sun = Sun() self.cloud_model = CloudModel(self.time_handler) self.seeing_model = SeeingModel(self.time_handler) self.field_database = FieldsDatabase() self.field_selection = FieldSelection() self.obs_site_info = (self.conf.observing_site.longitude, self.conf.observing_site.latitude) self.wait_for_scheduler = not self.opts.no_scheduler self.observation_proposals_counted = 1 self.target_proposals_counted = 1 self.socs_timeout = 180.0 # seconds if self.opts.scheduler_timeout > self.socs_timeout: self.socs_timeout = self.opts.scheduler_timeout
def setUp(self): self.th = TimeHandler("2020-01-01") self.seeing = SeeingModel(self.th) self.environment_config = Environment() self.num_original_values = 210384 self.elapsed_time = 8 * 24 * 3600