Esempio n. 1
0
    def __init__ (self, ra=None, dec=None):
        super (SiderealObject, self).__init__ ()

        ret = _precastro.make_cat_entry ('', '', 0, 0., 0., 0., 0.,
                                         0., 0., self._handle.star)
        if ret:
            raise NovasError ('make_cat_entry', ret)

        ret = _precastro.make_object (2, 0, ' ', self._handle.star, self._handle)
        if ret:
            raise NovasError ('make_object', ret)

        if ra is not None:
            if isinstance (ra, basestring):
                self.ra = parsehours (ra)
            else:
                self.ra = ra

        if dec is not None:
            if isinstance (dec, basestring):
                self.dec = parsedeglat (dec)
            else:
                self.dec = dec

        self.promoepoch = 2451545.0 # J2000 epoch; unpatched NOVAS's assumption
Esempio n. 2
0
    def __init__ (self, name):
        super (EphemObject, self).__init__ ()

        if name not in _ephemnums:
            raise ValueError ('unrecognized ephemeris object name "%s"' % name)

        num = _ephemnums[name]

        # star info will be zero'ed out in this mode.
        ret = _precastro.make_object (0, num, ' ', None, self._handle)
        if ret:
            raise NovasError ('make_object', ret)