示例#1
0
    def test_position(self):
        p = uranus.Position(uranus.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.6282134140759301, 14)
        self.assertEqual(longitude, 308.40566409553765)
        self.assertEqual(radius, 19.844051001140322)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.7703622749278436, 14)
        self.assertEqual(longitude, 347.91917802519964)
        self.assertEqual(radius, 20.095402766570462)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.5625095080138525, 14)
        self.assertEqual(longitude, 27.321376904656642)
        self.assertEqual(radius, 19.902712546938368)
示例#2
0
    def test_position(self):
        p = mars.Position(mars.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -1.8068684712918077, 14)
        self.assertEqual(longitude, 331.9059416711147)
        self.assertEqual(radius, 1.3816313510653964)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 1.3413650151739689, 14)
        self.assertEqual(longitude, 96.09842753476634)
        self.assertEqual(radius, 1.5840682142081786)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 1.078229523934518, 14)
        self.assertEqual(longitude, 194.05289858575324)
        self.assertEqual(radius, 1.631044330391502)
示例#3
0
    def test_position(self):
        p = earth.Position(earth.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 2.1651204901319734e-05, 14)
        self.assertEqual(longitude, 100.363323142225)
        self.assertEqual(radius, 0.9833333560780444)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 0.00011901318043573914, 14)
        self.assertEqual(longitude, 99.92973010197568)
        self.assertEqual(radius, 0.983289338510011)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 4.95339099701003e-05, 14)
        self.assertEqual(longitude, 100.51614552278916)
        self.assertEqual(radius, 0.9833010058152097)
示例#4
0
    def test_position(self):
        p = jupiter.Position(jupiter.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.9894618542824553, 14)
        self.assertEqual(longitude, 329.7713376559485)
        self.assertEqual(radius, 5.020988316386657)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 0.20051130112254614, 14)
        self.assertEqual(longitude, 271.7299034774712)
        self.assertEqual(radius, 5.247685790242188)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 1.151630375278742, 14)
        self.assertEqual(longitude, 218.56792143641388)
        self.assertEqual(radius, 5.432242090031535)
示例#5
0
    def test_position(self):
        p = mercury.Position(mercury.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 6.194758510915122, 14)
        self.assertEqual(longitude, 166.25446998252286)
        self.assertEqual(radius, 0.3689447062980261)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -6.890601940330963, 14)
        self.assertEqual(longitude, 308.0020711769773)
        self.assertEqual(radius, 0.4265244131415521)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 5.147097409406132, 14)
        self.assertEqual(longitude, 181.4019565130787)
        self.assertEqual(radius, 0.3893565329208419)
示例#6
0
    def test_position(self):
        p = neptune.Position(neptune.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 0.3745111145247912, 14)
        self.assertEqual(longitude, 299.546754568677)
        self.assertEqual(radius, 30.145211309963376)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.2952703665730311, 14)
        self.assertEqual(longitude, 321.4728593378659)
        self.assertEqual(radius, 30.04242600523542)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -0.9264709585814667, 14)
        self.assertEqual(longitude, 343.56386354496607)
        self.assertEqual(radius, 29.944701179744804)
示例#7
0
    def test_position(self):
        p = saturn.Position(saturn.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -2.4798143896218066, 14)
        self.assertEqual(longitude, 19.779644001582255)
        self.assertEqual(radius, 9.366709083172355)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 1.5827657392464183, 14)
        self.assertEqual(longitude, 153.22998324863892)
        self.assertEqual(radius, 9.266136560404153)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 0.9829772740784639, 14)
        self.assertEqual(longitude, 270.51396993626645)
        self.assertEqual(radius, 10.064742444221443)
示例#8
0
    def test_position(self):
        p = venus.Position(venus.TERMS_VSOP87D)

        jde = astrodate.calculate_julian(1998, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 0.8454455696475623, 14)
        self.assertEqual(longitude, 91.06983954587166)
        self.assertEqual(radius, 0.719596069699695)

        jde = astrodate.calculate_julian(2008, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, 3.253578332266348, 14)
        self.assertEqual(longitude, 183.34794389977853)
        self.assertEqual(radius, 0.7202648234694472)

        jde = astrodate.calculate_julian(2018, 1, 1)
        p.calculate_with_julianTD(jde)
        latitude = p.get_latitude()
        longitude = p.get_longitude()
        radius = p.get_radius()
        self.assertAlmostEqual(latitude, -1.1077565827266298, 14)
        self.assertEqual(longitude, 275.8648465097962)
        self.assertEqual(radius, 0.7273119838277067)
示例#9
0
def calc_dt_interp(dat):
    """
    Calculate the value for delta-t by interpolating with values from a table of historic values.
    :param dat: the date tuple to use for the interpolation
    :return: the value for dalta-t
    """
    if dat:
        if (dat[0] < DATE_TD_YEAR_MIN - 70) or (dat[0] >
                                                DATE_TD_YEAR_MAX + 70):
            julian = astrodate.calculate_julian(dat[0], dat[1], dat[2])
            dy = julian - 2382148.0
            dt = ((dy * dy) / 41048480.0) - 15.0
        elif dat[0] < DATE_TD_YEAR_MIN:
            m = (DATE_DELTA_T_VALUES[1] - DATE_DELTA_T_VALUES[0]) / 2.0
            dt = ((dat[0] - DATE_TD_YEAR_MIN) * m) + DATE_DELTA_T_VALUES[0]
        elif dat[0] > DATE_TD_YEAR_MAX:
            last = (DATE_TD_YEAR_MAX - DATE_TD_YEAR_MIN) / 2
            m = (DATE_DELTA_T_VALUES[last] -
                 DATE_DELTA_T_VALUES[last - 1]) / 2.0
            dt = ((dat[0] - DATE_TD_YEAR_MAX) * m) + DATE_DELTA_T_VALUES[last]
        else:
            i = dat[0] - DATE_TD_YEAR_MIN
            dt = DATE_DELTA_T_VALUES[i]
        return dt
    return None