Beispiel #1
0
def with_leapseconds(datafiles):
    for item in datafiles:
        if item.type == 'ls':
            kernel.load(item.path)
            break
    else:
        pytest.skip('No leap seconds kernel available')
    yield
    kernel.unload(item.path)
Beispiel #2
0
def with_spacecraftclock(datadir):
    paths = [path for path in KERNEL_FILES if spice.getfat(path)[1] == 'sc']
    if not paths:
        pytest.skip('No spacecraft clock kernel available.')
    kernels = set.union(*(kernel.load(path) for path in paths))
    yield
    for k in kernels:
        k._unload()
Beispiel #3
0
def with_leapseconds(datadir):
    for path in KERNEL_FILES:
        if spice.getfat(path)[1] == 'ls':
            k = kernel.load(path).pop()
            break
    else:
        pytest.skip('No leap seconds kernel available.')
    yield
    k._unload()
Beispiel #4
0
def load_kernels(datadir):
    kernel.load(datadir)
Beispiel #5
0
# This example will show the basic usage of the spiceminer module.
from spiceminer import frange, dtrange, Time, kernel

# Or simply from spiceminer import *. I just like to be explicit.

# 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)
Beispiel #6
0
def kernels():
    data_root = os.getenv('SPICEMINERDATA', os.path.join(ROOT_DIR, 'data'))
    if not os.path.isdir(data_root):
        msg = 'Data not found. Please read the documentation on tests for more info.'
        raise ImportError(msg)
    kernel.load(data_root, followlinks=True)