Пример #1
0
    def test_write_observation_history_table(self):
        obs_topic = topic_helpers.observation_topic
        session_id = 1001

        result = tbls.write_observation_history(obs_topic, session_id)
        obs_hist = tbls.create_observation_history(self.metadata)
        self.check_ordered_dict_to_table(result, obs_hist)
        self.assertEqual(result['Session_sessionId'], session_id)
        self.assertEqual(result['observationId'], obs_topic.observationId)
        self.assertEqual(result['observationStartTime'], obs_topic.observation_start_time)
        self.assertEqual(result['observationStartMJD'], obs_topic.observation_start_mjd)
        self.assertEqual(result['observationStartLST'], obs_topic.observation_start_lst)
        self.assertEqual(result['night'], obs_topic.night)
        self.assertEqual(result['TargetHistory_targetId'], obs_topic.targetId)
        self.assertEqual(result['Field_fieldId'], obs_topic.fieldId)
        self.assertEqual(result['groupId'], obs_topic.groupId)
        self.assertEqual(result['filter'], obs_topic.filter)
        self.assertEqual(result['dec'], obs_topic.dec)
        self.assertEqual(result['altitude'], obs_topic.altitude)
        self.assertEqual(result['visitTime'], obs_topic.visit_time)
        self.assertEqual(result['visitExposureTime'], sum(obs_topic.exposure_times))
        self.assertEqual(result['skyBrightness'], obs_topic.sky_brightness)
        self.assertEqual(result['cloud'], obs_topic.cloud)
        self.assertEqual(result['seeingFwhmGeom'], obs_topic.seeing_fwhm_geom)
        self.assertEqual(result['fiveSigmaDepth'], obs_topic.five_sigma_depth)
        self.assertEqual(result['moonRA'], obs_topic.moon_ra)
        self.assertEqual(result['moonAz'], obs_topic.moon_az)
        self.assertEqual(result['sunDec'], obs_topic.sun_dec)
        self.assertEqual(result['sunAlt'], obs_topic.sun_alt)
        self.assertEqual(result['solarElong'], obs_topic.solar_elong)
Пример #2
0
 def test_summary_all_props_table(self):
     oh = tbls.create_observation_history(self.metadata)
     sh = tbls.create_slew_history(self.metadata)
     sfs = tbls.create_slew_final_state(self.metadata)
     ph = tbls.create_observation_proposal_history(self.metadata)
     p = tbls.create_proposal(self.metadata)
     f = tbls.create_field(self.metadata)
     summary = tbls.create_summary_all_props(self.metadata, oh, sh, sfs, p, ph, f)
     self.assertEqual(len(summary.c), 36)
Пример #3
0
 def test_create_observation_history_table(self):
     obs_hist = tbls.create_observation_history(self.metadata)
     self.assertEqual(len(obs_hist.c), 36)
     self.assertEqual(len(obs_hist.indexes), 4)