Kernels

Kernels are files containing information relating to objects in space.

Official documentation

The NAIF website has a lot of indepth information about kernels.

API

spiceminer.load(path='.', recursive=True, followlinks=False, force_reload=False)

Load a kernel file or all kernel files in a directory tree.

Meta-kernels are not supported, because they would be parsed internally by the C-framework, therefore ignoring the feautures for time window extraction.

Parameters:

path: str, optional

Relative or absolute path to the kernel file/directory.

recursive: bool, optional

Search subdirectories for kernel files.

followlinks: bool, optional

Follow symbolic links.

force_reload: bool, optional

Reload already loaded kernel files. By default an error is raised if a kernel file is already loaded.

Returns:

kernels: set of Kernel

The loaded kernels.

Raises:

ValueError

If the kernel file is already loaded.

IOError

If no files were loaded.

See also

load_single
More controllable way to load single files.
unload
Unload kernels.
spiceminer.load_single(path, extension=None, force_reload=False)

Load a single kernel file. Allows non-standart extensions.

Meta-kernels are not supported, because they would be parsed internally by the C-framework, therefore ignoring the feautures for time window extraction.

Parameters:

path: str

Relative or absolute path to the kernel file.

extension: str, optional

Use the provided extension instead of the extension of the file.

force_reload: bool, optional

Reload already loaded kernel files. By default an error is raised if a kernel file is already loaded.

Returns:

Kernel

The loaded kernel.

Raises:

ValueError

If the kernel file is already loaded.

IOError

If no files were loaded.

See also

load
Load multiple files.
unload
Unload kernels.
spiceminer.unload(path='.', recursive=True, followlinks=False)

Unload a kernel file or all kernel files in a directory tree.

Parameters:

path: str, optional

Relative or absolute path to the kernel file/directory.

recursive: bool, optional

Search subdirectories for kernel files.

followlinks: bool, optional

Follow symbolic links.

Returns:

kernels: set of kernel

The unloaded kernels.

See also

load
Load multiple files.
load_single
More controllable way to load single files.
class spiceminer.Kernel(path, kernel_type, force_reload=False)

A loaded kernel file.

Warning

The constructor should never be used directly. Use one of the methods in the See also section.

Parameters:

path: str

Relative or absolute path to the kernel file/directory.

kernel_type: {‘sp’, ‘c’, ‘pc’, ‘f’, ‘ls’, ‘sc’}

Used to identify what information the kernel is holding and how to load it.

force_reload: bool, optional

Reload already loaded kernel files. By default an error is raised if a kernel file is already loaded.

Raises:

ValueError

If the kernel file is already loaded.

See also

load
Load multiple files.
load_single
More controllable way to load single files.
unload
Unload kernels.

Attributes

classattribute LOADED: set of Kernel All loaded kernels.
classattribute TIMEWINDOWS_POS: dict of int -> list Maps a list of start-end-tuples for all known time windows of its position to the id of a Body.
classattribute TIMEWINDOWS_ROT: dict of int -> list Maps a list of start-end-tuples for all known time windows of its rotation to the id of a Body.
path: str Absolute path to the kernel file.
name: str Filename of the kernel file.
type: {‘sp’, ‘c’, ‘pc’, ‘f’, ‘ls’, ‘sc’} Identifier for kernel loading mechanism.
info: {‘pos’, ‘rot’, ‘none’} What kind of spatial information the kernel contains.
ids: set of int The IDs of all bodies about which the kernel has information.

Methods