HiRISE

HiRISE.HiPlan.SPICE
Class Kernel_Utilities

java.lang.Object
  extended by HiRISE.HiPlan.SPICE.Kernel_Utilities

public class Kernel_Utilities
extends Object

A utility class for managing SPICE kernels. This class uses the NAIF SPICE toolkit via the ASU-developed JSPICE system.

Version:
1.6
Author:
Christian Schaller - UA/PIRL

Field Summary
static String ID
          Class identification name with source code version and date.
 
Method Summary
static boolean areKernelsLoaded()
          Tests if any kernels are loaded.
static List<String> getLoadedKernels()
          Gets a list of kernels loaded.
static List<String> getStateFileKernels(String stateFilePathname, boolean timeKernelsOnly)
          Gets the list of kernel names from the named MTT state file.
static String getToolkitVersion()
          Gets the version of the SPICE toolkit used to build the JSPICE library.
static boolean isKernelLoaded(String kernelPathname)
          Tests if a particular kernel is loaded.
static ArrayList<String> kernel_list()
          Deprecated. use getLoadedKernels() instead.
static boolean kernel_loaded(String kernelPathname)
          Deprecated. use isKernelLoaded(String) instead.
static boolean kernels_loaded()
          Deprecated. use areKernelsLoaded() instead.
static void load_from_state_file(String stateFilePathname)
          Deprecated. use loadKernelsFromStateFIle(String) instead.
static void load_from_state_file(String stateFilePathname, boolean timeKernelsOnly)
          Deprecated. use loadKernelsFromStateFile(String, boolean) instead.
static void load_kernel(String kernelPathname)
          Deprecated. use loadKernel(String) instead.
static void loadKernel(String kernelPathname)
          Loads a named kernel into the SPICE system.
static void loadKernelsFromStateFile(String stateFilePathname)
          Loads the SPICE kernels named in an MTT state file.
static void loadKernelsFromStateFile(String stateFilePathname, boolean timeKernelsOnly)
          Loads the SPICE kernels named in an MTT state file.
static ArrayList<String> state_file_kernels(String stateFilePathname, boolean timeKernelsOnly)
          Deprecated. use getStateFileKernels(String,boolean) instead.
static String toolkit_version()
          Deprecated. use getToolkitVersion() instead.
static void unload_all_kernels()
          Deprecated. use unloadAllKernels() instead.
static void unload_kernel(String kernelPathname)
          Deprecated. use unloadKernel(String) instead.
static void unload_state_file(String stateFilePathname)
          Deprecated. use unloadKernelsFromStateFile(String) instead.
static void unloadAllKernels()
          Unloads all kernels from the SPICE system.
static void unloadKernel(String kernelPathname)
          Unloads a named kernel from the SPICE system.
static void unloadKernelsFromStateFile(String stateFilePathname)
          Unloads the SPICE kernels named in an MTT state file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values
Method Detail

getToolkitVersion

public static String getToolkitVersion()
Gets the version of the SPICE toolkit used to build the JSPICE library. If the JSPICE library is not found, because the native library is not in the system library path, for instance, the return value is a null.

Returns:
the SPICE toolkit version or null.

loadKernel

public static void loadKernel(String kernelPathname)
                       throws SPICE_Exception
Loads a named kernel into the SPICE system. If the kernel is already loaded (determined via kernel_loaded(java.lang.String)) it will not be loaded again. Note that a kernel is identified uniquely by its full pathname, not by its filename.

Parameters:
kernelPathname - the pathname of the kernel to load.
Throws:
SPICE_Exception - if there is a problem loading the kernel.

unloadKernel

public static void unloadKernel(String kernelPathname)
Unloads a named kernel from the SPICE system. Note that a kernel is identified uniquely by its full pathname, not by its filename. If the named kernel is not in the SPICE system, no action is taken.

Parameters:
kernelPathname - the pathname of the kernel to unload.

unloadAllKernels

public static void unloadAllKernels()
Unloads all kernels from the SPICE system.


loadKernelsFromStateFile

public static void loadKernelsFromStateFile(String stateFilePathname,
                                            boolean timeKernelsOnly)
                                     throws IOException,
                                            SPICE_Exception
Loads the SPICE kernels named in an MTT state file. All kernels are loaded, unless timeKernelsOnly is true. If so, only the kernels related to time (leap seconds kernels, spacecraft clock kernels) are loaded, likely speeding the load process considerably.

If a kernel is already loaded, it will not be loaded again.

Parameters:
stateFilePathname - the name of the MTT state file to load.
timeKernelsOnly - if true, only time-related kernels are loaded; otherwise all kernels are loaded.
Throws:
IOException - if there is a problem reading the state file.
SPICE_Exception - if there is a problem loading the kernels.

loadKernelsFromStateFile

public static void loadKernelsFromStateFile(String stateFilePathname)
                                     throws IOException,
                                            SPICE_Exception
Loads the SPICE kernels named in an MTT state file. All kernels are loaded, unless they are already loaded. This method is equivalent to invoking load_from_state_file(String,boolean) with timeKernelsOnly set to false.

If a kernel is already loaded, it will not be loaded again.

Parameters:
stateFilePathname - the name of the MTT state file to load.
Throws:
IOException - if there is a problem reading the state file.
SPICE_Exception - if there is a problem loading the kernels.

unloadKernelsFromStateFile

public static void unloadKernelsFromStateFile(String stateFilePathname)
                                       throws IOException
Unloads the SPICE kernels named in an MTT state file.

Parameters:
stateFilePathname - the name of the MTT state file to unload.
Throws:
IOException - if there is a problem reading the state file.

getStateFileKernels

public static List<String> getStateFileKernels(String stateFilePathname,
                                               boolean timeKernelsOnly)
                                        throws IOException
Gets the list of kernel names from the named MTT state file. Valid kernel type codes are the following: LS, SCLK, SPK, PCK, and CK. The first two (LS and SCLK) are time-related kernels; the others are not.

Parameters:
stateFilePathname - the name of the MTT state file.
timeKernelsOnly - if true, only time-related kernels are considered; otherwise all kernels are considered.
Throws:
IOException - if there is a problem reading the state file.

areKernelsLoaded

public static boolean areKernelsLoaded()
Tests if any kernels are loaded.

Returns:
true if the SPICE system has kernels loaded; false otherwise.

isKernelLoaded

public static boolean isKernelLoaded(String kernelPathname)
Tests if a particular kernel is loaded. Kernels are identified by pathname.

Parameters:
kernelPathname - the pathname of the kernel in question.
Returns:
true if the SPICE system has the indicated kernel loaded; false otherwise.

getLoadedKernels

public static List<String> getLoadedKernels()
Gets a list of kernels loaded.

Returns:
a list of all currently loaded kernels. If no kernels are loaded, the list is empty.

toolkit_version

@Deprecated
public static String toolkit_version()
Deprecated. use getToolkitVersion() instead.


load_kernel

@Deprecated
public static void load_kernel(String kernelPathname)
                        throws SPICE_Exception
Deprecated. use loadKernel(String) instead.

Throws:
SPICE_Exception

unload_kernel

@Deprecated
public static void unload_kernel(String kernelPathname)
Deprecated. use unloadKernel(String) instead.


unload_all_kernels

@Deprecated
public static void unload_all_kernels()
Deprecated. use unloadAllKernels() instead.


load_from_state_file

@Deprecated
public static void load_from_state_file(String stateFilePathname,
                                                   boolean timeKernelsOnly)
                                 throws IOException,
                                        SPICE_Exception
Deprecated. use loadKernelsFromStateFile(String, boolean) instead.

Throws:
IOException
SPICE_Exception

load_from_state_file

@Deprecated
public static void load_from_state_file(String stateFilePathname)
                                 throws IOException,
                                        SPICE_Exception
Deprecated. use loadKernelsFromStateFIle(String) instead.

Throws:
IOException
SPICE_Exception

unload_state_file

@Deprecated
public static void unload_state_file(String stateFilePathname)
                              throws IOException
Deprecated. use unloadKernelsFromStateFile(String) instead.

Throws:
IOException

state_file_kernels

@Deprecated
public static ArrayList<String> state_file_kernels(String stateFilePathname,
                                                              boolean timeKernelsOnly)
                                            throws IOException
Deprecated. use getStateFileKernels(String,boolean) instead.

Throws:
IOException

kernels_loaded

@Deprecated
public static boolean kernels_loaded()
Deprecated. use areKernelsLoaded() instead.


kernel_loaded

@Deprecated
public static boolean kernel_loaded(String kernelPathname)
Deprecated. use isKernelLoaded(String) instead.


kernel_list

@Deprecated
public static ArrayList<String> kernel_list()
Deprecated. use getLoadedKernels() instead.


HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona