示例#1
0
 def test_distance_1(self):
     tgt1 = entity.SiderealTarget(name="vega", ra=vega[0], dec=vega[1])
     tgt2 = entity.SiderealTarget(name="altair",
                                  ra=altair[0],
                                  dec=altair[1])
     time1 = self.obs.get_date("2010-10-18 22:30")
     d_alt, d_az = self.obs.distance(tgt1, tgt2, time1)
     self.assertEquals(str(d_alt)[:7], '-9.9657')
     self.assertEquals(str(d_az)[:7], '36.1910')
示例#2
0
 def test_airmass1(self):
     # now calculate via misc
     body = entity.SiderealTarget(name='ACTJ0022-0036',
                                  ra='00:22:13.44',
                                  dec='-00:36:25.20')
     time1 = self.obs.get_date("2010-10-18 21:00")
     c1 = self.obs.calc(body, time1)
     self.assert_(c1.airmass > 1.13)
示例#3
0
 def test_observable_4(self):
     # vega should be visible near the beginning but not near the end
     # during this period (setting)
     tgt = entity.SiderealTarget(name="vega", ra=vega[0], dec=vega[1])
     cts = entity.Constraints(
         time_start=self.obs.get_date("2014-04-29 09:30"),
         time_stop=self.obs.get_date("2014-04-29 10:30"),
         el_min_deg=15.0,
         el_max_deg=85.0,
         duration=30 * 60,
         airmass=None)
     cts = self.obs.observable(tgt, cts)
     self.assert_(cts.observable == True)  # 30 min ok
示例#4
0
 def test_observable_3(self):
     # vega should be visible near the end but not in the beginning
     # during this period (rising)
     tgt = entity.SiderealTarget(name="vega", ra=vega[0], dec=vega[1])
     cts = entity.Constraints(
         time_start=self.obs.get_date("2014-04-28 22:30"),
         time_stop=self.obs.get_date("2014-04-28 23:30"),
         el_min_deg=15.0,
         el_max_deg=85.0,
         duration=50 * 60,
         airmass=None)
     cts = self.obs.observable(tgt, cts)
     self.assert_(cts.observable == False)  # 50 min NOT ok
示例#5
0
 def test_observable_1(self):
     # vega should be visible during this period
     tgt = entity.SiderealTarget(name="vega", ra=vega[0], dec=vega[1])
     cts = entity.Constraints(
         time_start=self.obs.get_date("2014-04-29 04:00"),
         time_stop=self.obs.get_date("2014-04-29 05:00"),
         el_min_deg=15.0,
         el_max_deg=85.0,
         duration=59.9 * 60,
         airmass=None)
     cts = self.obs.observable(tgt, cts)
     ## print((1, cts.observable,
     ##        cts.time_rise.astimezone(self.obs.tz_local).strftime("%H:%M"),
     ##        cts.time_set.astimezone(self.obs.tz_local).strftime("%H:%M")))
     self.assert_(cts.observable == True)
示例#6
0
 def test_get_tgt(self):
     tgt = entity.SiderealTarget(name="vega", ra=vega[0], dec=vega[1])
     self.assert_(isinstance(tgt.body, ephem.Body))