Ejemplo n.º 1
0
    def test_low_dec(self):
        with open(datapaths.swift_bat_grb_pos_v2) as f:
            good_src = voeventparse.load(f)
        with open(datapaths.swift_bat_grb_low_dec) as f:
            bad_src = voeventparse.load(f)

        good_fk5 = convert_voe_coords_to_eqposn(
                                     voeventparse.pull_astro_coords(good_src))
        bad_fk5 = convert_voe_coords_to_eqposn(
                                     voeventparse.pull_astro_coords(bad_src))
        self.assertIsNone(filters.ami.reject(good_fk5))
        self.assertIsNotNone(filters.ami.reject(bad_fk5))
Ejemplo n.º 2
0
 def test_swift_grb_v2_fk5(self):
     with open(datapaths.swift_bat_grb_pos_v2) as f:
         swift_grb_v2 = voeventparse.load(f)
     known_swift_grb_posn = ephem.Equatorial(
         74.741200/DEG_PER_RADIAN, 25.313700/DEG_PER_RADIAN,
         epoch=ephem.J2000)
     voe_coords = voeventparse.pull_astro_coords(swift_grb_v2)
     extracted_posn = convert_voe_coords_to_eqposn(voe_coords)
     self.assertEqual(extracted_posn.ra, known_swift_grb_posn.ra)
     self.assertEqual(extracted_posn.dec, known_swift_grb_posn.dec)
Ejemplo n.º 3
0
    def __init__(self, voevent):
        self.voevent = voevent
        if not filters.is_bat_grb_pkt(voevent):
            raise ValueError("Cannot instantiate BatGrb; packet header mismatch.")

        self.description = "Swift BAT GRB - initial position"
        id_long_short = BatGrb._pull_swift_bat_id(self.voevent)
        self.id_long = 'SWIFT' + id_long_short[0]
        self.id = 'SWIFT_' + id_long_short[1]
        #Assigned name according to the 'why' section of voevent packet:
        self.inferred_name = self.voevent.Why.Inference.Name
        self.isotime = voeventparse.pull_isotime(self.voevent)
        self.params = voeventparse.pull_params(self.voevent)
        self.position = convert_voe_coords_to_eqposn(
                                       voeventparse.pull_astro_coords(self.voevent))