예제 #1
0
def test_utc_to_tt_offset():

    assert marstime.utc_to_tt_offset_math() >=35.
    assert marstime.utc_to_tt_offset_numpy() >=35.
    
    t =  marstime.j2000_epoch()
    #j2000 is Jan 1 2000, utc offset should be =32+32.184
    assert within_error(marstime.utc_to_tt_offset(t), 64.184, 1e-3)

    t = marstime.j2000_epoch() - 5*365.
    assert within_error(marstime.utc_to_tt_offset(t), 61.184, 1e-3)

    t=0
    assert within_error(marstime.utc_to_tt_offset(t), 0, 1e-3)
예제 #2
0
def test_j2000_offset_tt():
    assert marstime.j2000_offset_tt() > 2456203.-2451545.
    assert marstime.j2000_offset_tt(marstime.j2000_epoch())==0
    assert marstime.j2000_offset_tt(2451645)==100
예제 #3
0
def test_julian_tt():
    assert marstime.julian_tt() > 2456203.
    assert marstime.julian_tt(0) == 0
    v = marstime.julian_tt(marstime.j2000_epoch())-marstime.j2000_epoch()
    assert (v>64.183/86400.)&(v<64.185/86400.)
예제 #4
0
def test_j2000_epoch():
    assert marstime.j2000_epoch() == 2451545.0
예제 #5
0
Created on Wed Jul 27 13:03:32 2016

@author: Astronomy
"""

import sys
sys.path.append('f:\\Astronomy\Python Play')
sys.path.append('f:\\Astronomy\Python Play\marstime-0.4.6')
import marstime
import ephem
import numpy as np
import matplotlib.pyplot as pl
import datetime

print marstime.Mars_Ls(j2000_ott=0.1)
print marstime.j2000_epoch()

observer = ephem.Observer()
observer.lon = ephem.degrees('-104.907985')
observer.lat = ephem.degrees('39.708200')
Planet = ephem.Mars('2016-07-26 03:30:00Z')
Planet.compute(observer)

print Planet.name
print Planet.sun_distance
print Planet.earth_distance
print Planet.size
print Planet.mag
print Planet.phase
#print Planet.radius #Crashes at work
Planet.elong