Example #1
0
def _load_c(path):
    '''Load c kernel and associated windows.'''
    _IDS.reset()
    spice.ckobj(path, _IDS)
    for idcode in _IDS:
        _WINDOWS.reset()
        spice.ckcov(path, idcode, _WINDOWS)
        # Merge new windows and exsiting windows
        new_windows = [(Time.fromet(et0), Time.fromet(et1))
            for et0, et1 in zip(_WINDOWS[::2], _WINDOWS[1::2])]
        ROT_WINDOWS[idcode] = _merge_windows(ROT_WINDOWS[idcode] + new_windows)
    return set(_IDS[:])
Example #2
0
def _load_pc(path):
    '''Load pc kernel and associated windows.'''
    _IDS.reset()
    try:
        spice.pckfrm(path, _IDS)
        for idcode in _IDS:
            _WINDOWS.reset()
            spice.ckcov(path, idcode, _WINDOWS)
            # Merge new windows and exsiting windows
            new_windows = [(Time.fromet(et0), Time.fromet(et1))
                for et0, et1 in zip(_WINDOWS[::2], _WINDOWS[1::2])]
            ROT_WINDOWS[idcode] = _merge_windows(
                ROT_WINDOWS[idcode] + new_windows)
        return set(_IDS[:])
    except spice.SpiceError:
        # Parse text kernels seperately
        with open(path, 'r') as f:
            return set(map(int, re.findall('BODY([-0-9]*)_PM', f.read())))