Example #1
0
def gen_data():
    yield pytest.mark.xfail(raises=TypeError)([399, None])
    yield pytest.mark.xfail(raises=ValueError)([399, 'a'])
    yield pytest.mark.xfail(raises=ValueError)([399, 'asdf'])
    for idcode in (399, 301, 499, 401, 402, 10):
        yield idcode, 0
        yield idcode, spiceminer.Time()
        yield idcode, list(spiceminer.frange(spiceminer.Time(2000), spiceminer.Time(2000, 2), spiceminer.Time.DAY))
Example #2
0
# First we need to load some kernels:
kernel.load("data")

# Next get the object we desire info about:
obj = kernel.get("MARS")
print obj
print "Parent:  ", obj.parent()
print "Children:", obj.children()
# Note: if you know the id of the object rather than the name, you can also
# do: kernel.get(499)

# We also need some time frame to get data from:
start = Time(2000, 1, 1)
stop = Time(2000, 2, 1)
times = frange(start, stop, Time.DAY)
# The Time-class is similar to the well known datetime but has the advantage
# that it actullay represents POSIX time instead of a date.
# Frange works just like the normal xrange(), the only difference is, that it
# can handle floats.

# If you don't want to let go off datetime there is also a range function for
# that:
import datetime

start2 = datetime.datetime(2000, 1, 1)
stop2 = datetime.datetime(2000, 2, 1)
times2 = dtrange(start2, stop2, stop2 - start2)

# Now for the interesting stuff. Getting positional data is pretty easy:
data = obj.state(times)