Example #1
0
 def __init__(self, tdbEpoch=None):
     """Create a new AppGeoData object for a specific date.
     Inputs:
     - tdbEpoch  TDB of apparent geocentric position (Julian year)
                 note: TDT will always do and UTC is usually adequate
                 default: current date
     """
     # compute star-independent apparent geocentric data
     if tdbEpoch == None:
         tdbDays = Tm.utcFromPySec()
     else:
         tdbDays = Tm.mjdFromEpJ(tdbEpoch)
     self.dtPM, self.bPos, self.hDir, self.grav, self.bVelC, self.bGamma, self.pnMat \
         = llv.mappa (2000.0, tdbDays)
Example #2
0
 def __init__(self, tdbEpoch=None):
     """Create a new AppGeoData object for a specific date.
     Inputs:
     - tdbEpoch  TDB of apparent geocentric position (Julian year)
                 note: TDT will always do and UTC is usually adequate
                 default: current date
     """
     # compute star-independent apparent geocentric data
     if tdbEpoch == None:
         tdbDays = Tm.utcFromPySec()
     else:
         tdbDays = Tm.mjdFromEpJ (tdbEpoch)
     self.dtPM, self.bPos, self.hDir, self.grav, self.bVelC, self.bGamma, self.pnMat \
         = llv.mappa (2000.0, tdbDays)
Example #3
0
 def GeocentricFromTopocentric(self, fromP, dumV):
     if self.obsData is None:
         raise ValueError("must specify obsData to convert to Geocentric from Topocentric")
     return (
         geoFromTopo(fromP, Tm.lastFromUT1(self.fromDate, self.obsData.longitude), self.obsData),
         _CnvObj.ZeroV,
     )
Example #4
0
 def GeocentricFromTopocentric(self, fromP, dumV):
     if self.obsData is None:
         raise ValueError("must specify obsData to convert to Geocentric from Topocentric")
     return (
         geoFromTopo(fromP, Tm.lastFromUT1(self.fromDate, self.obsData.longitude), self.obsData),
         _CnvObj.ZeroV,
     )
Example #5
0
 def TopocentricFromGeocentric(self, fromP, dumV):
     if self.obsData == None:
         raise ValueError("must specify obsData to cnvert to Topocentric from Geocentric")
     return (
         topoFromGeo(fromP, Tm.lastFromUT1(self.toDate, self.obsData.longitude), self.obsData),
         _CnvObj.ZeroV,
     )
Example #6
0
 def TopocentricFromGeocentric(self, fromP, dumV):
     if self.obsData == None:
         raise ValueError(
             "must specify obsData to cnvert to Topocentric from Geocentric"
         )
     return (
         topoFromGeo(fromP,
                     Tm.lastFromUT1(self.toDate, self.obsData.longitude),
                     self.obsData),
         _CnvObj.ZeroV,
     )
Example #7
0
def icrsFromFixedFK4(fk4P, fk4Date):
    """
    Converts mean catalog fk4 coordinates to ICRS for a fixed star.
    Uses the approximation that ICRS = FK5 J2000.
    
    Inputs:
    - fk4Date   TDB date of fk4 coordinates (Besselian epoch)
                note: TDT will always do and UTC is usually adequate
    - fk4P(3)   mean catalog fk4 cartesian position (au)
    
    Returns:
    - icrsP(3)  ICRS cartesian position (au), a numpy.array
    
    Error Conditions:
    none
    
    Warnings:
    The FK4 date is in Besselian years.
    
    The star is assumed fixed on the celestial sphere. That is a bit
    different than assuming it has zero proper motion because
    FK4 system has slight ficticious proper motion.
    
    The FK4 system refers to a specific set of precession constants;
    not all Besselian-epoch data was precessed using these constants
    (especially data for epochs before B1950).
    
    References:
    P.T. Wallace's routine FK45Z
    """
    #  compute new precession constants
    #  note: ETrms and PreBn both want Besselian date
    eTerms = llv.etrms (fk4Date)
    precMat = llv.prebn (fk4Date, 1950.0)

    #  subtract e-terms from position. As a minor approximation,
    #  we don't bother to subtract variation in e-terms from proper motion.
    magP = RO.MathUtil.vecMag(fk4P)
    meanFK4P = fk4P - (eTerms * magP)

    #  precess position to B1950, assuming zero fk4 pm
    #  (we'll correct for the fictious fk4 pm later)
    b1950P = numpy.dot(precMat, meanFK4P)

    #  convert position to ICRS (actually FK5 J2000)
    #  but still containing fk4 fictitious pm;
    #  compute fictitious pm.
    tempP = numpy.dot(_MatPP, b1950P)
    ficV  = numpy.dot(_MatVP, b1950P)

    #  correct ICRS position for fk4 fictitious pm
    #  (subtract over period fk4Date to J2000)
    period = 2000.0 - Tm.epJFromMJD (llv.epb2d (fk4Date))
    return tempP - ficV * period
Example #8
0
 def ICRS2000FromGeocentric(self, fromP, dumV):
     agData = AppGeoData(Tm.epJFromMJD(self.fromDate))
     return (icrsFromGeo(fromP, agData), _CnvObj.ZeroV)
Example #9
0
 def GeocentricFromICRS2000(self, fromP, fromV):
     agData = AppGeoData(Tm.epJFromMJD(self.toDate))
     return (geoFromICRS(fromP, fromV, agData), _CnvObj.ZeroV)
Example #10
0
 def ICRS2000FromGeocentric(self, fromP, dumV):
     agData = AppGeoData(Tm.epJFromMJD(self.fromDate))
     return (icrsFromGeo(fromP, agData), _CnvObj.ZeroV)
Example #11
0
 def GeocentricFromICRS2000(self, fromP, fromV):
     agData = AppGeoData(Tm.epJFromMJD(self.toDate))
     return (geoFromICRS(fromP, fromV, agData), _CnvObj.ZeroV)