JNISpice
version 2.0.0

spice.basic
Class SPK

java.lang.Object
  extended by spice.basic.DAF
      extended by spice.basic.SPK

public class SPK
extends DAF

Class SPK provides methods for writing, summarizing, and conducting low-level read operations on SPK files.

To make SPK data available to programs for state or position computations, use the method KernelDatabase.load(java.lang.String).

State or position vectors are normally computed via methods of the classes StateVector, StateRecord, PositionVector, or PositionRecord.

Version 1.0.0 04-JAN-2010 (NJB)


Field Summary
 
Fields inherited from class spice.basic.DAF
fileName, handle, internalFileName, ND, NI, readable, writable
 
Method Summary
 int[] getBodies()
          Obtain a set of ID codes of objects for which an SPK file contains data.
 int[] getBodies(int[] initialSet)
          Obtain a set of ID codes of objects for which an SPK file contains data, merged with an existing set of ID codes.
 SpiceWindow getCoverage(int body)
          Obtain a SpiceWindow representing the time coverage provided by this SPK for a given object.
 SpiceWindow getCoverage(int body, SpiceWindow cover)
          Return a SpiceWindow representing the union of a given SPICE coverage window with the time coverage provided by this SPK for a given object.
static SPK openForRead(java.lang.String fileName)
          Open an existing SPK file for read access.
static SPK openNew(java.lang.String fileName, java.lang.String internalFileName, int nCommentChars)
          Create a new SPK file.
 void writeType02Segment(Body body, Body center, ReferenceFrame frame, Time first, Time last, java.lang.String segid, TDBDuration intlen, int n, int polydg, double[][][] ChebyCoeffs, Time btime)
          Write a type 2 segment to an SPK file.
 void writeType03Segment(Body body, Body center, ReferenceFrame frame, Time first, Time last, java.lang.String segid, TDBDuration intlen, int n, int polydg, double[][][] ChebyCoeffs, Time btime)
          Write a type 3 segment to an SPK file.
 void writeType05Segment(Body body, Body center, ReferenceFrame frame, Time first, Time last, java.lang.String segid, double gm, int n, StateVector[] states, Time[] epochs)
          Write a type 5 segment to an SPK file.
 void writeType09Segment(Body body, Body center, ReferenceFrame frame, Time first, Time last, java.lang.String segid, int degree, int n, StateVector[] states, Time[] epochs)
          Write a type 9 segment to an SPK file.
 void writeType13Segment(Body body, Body center, ReferenceFrame frame, Time first, Time last, java.lang.String segid, int degree, int n, StateVector[] states, Time[] epochs)
          Write a type 13 segment to an SPK file.
 
Methods inherited from class spice.basic.DAF
addComments, beginBackwardSearch, beginForwardSearch, close, countSegments, deleteComments, findNextArray, findPreviousArray, getArrayName, getDoubleSummaryComponent, getFileName, getHandle, getIntegerSummaryComponent, getInternalFileName, getND, getNI, isReadable, isWritable, openForWrite, readComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openNew

public static SPK openNew(java.lang.String fileName,
                          java.lang.String internalFileName,
                          int nCommentChars)
                   throws SpiceException
Create a new SPK file. The file must not exist prior to this method call.

Throws:
SpiceException

openForRead

public static SPK openForRead(java.lang.String fileName)
                       throws SpiceException
Open an existing SPK file for read access.

Throws:
SpiceException

getBodies

public int[] getBodies()
                throws SpiceException
Obtain a set of ID codes of objects for which an SPK file contains data.

Throws:
SpiceException

getBodies

public int[] getBodies(int[] initialSet)
                throws SpiceException
Obtain a set of ID codes of objects for which an SPK file contains data, merged with an existing set of ID codes.

The result is returned in a new set.

Throws:
SpiceException

getCoverage

public SpiceWindow getCoverage(int body)
                        throws SpiceException
Obtain a SpiceWindow representing the time coverage provided by this SPK for a given object.

The returned window contains times expressed as seconds past J2000 TDB.

Throws:
SpiceException

getCoverage

public SpiceWindow getCoverage(int body,
                               SpiceWindow cover)
                        throws SpiceException
Return a SpiceWindow representing the union of a given SPICE coverage window with the time coverage provided by this SPK for a given object.

The returned window contains times expressed as seconds past J2000 TDB.

Throws:
SpiceException

writeType02Segment

public void writeType02Segment(Body body,
                               Body center,
                               ReferenceFrame frame,
                               Time first,
                               Time last,
                               java.lang.String segid,
                               TDBDuration intlen,
                               int n,
                               int polydg,
                               double[][][] ChebyCoeffs,
                               Time btime)
                        throws SpiceException
Write a type 2 segment to an SPK file.

Throws:
SpiceException

writeType03Segment

public void writeType03Segment(Body body,
                               Body center,
                               ReferenceFrame frame,
                               Time first,
                               Time last,
                               java.lang.String segid,
                               TDBDuration intlen,
                               int n,
                               int polydg,
                               double[][][] ChebyCoeffs,
                               Time btime)
                        throws SpiceException
Write a type 3 segment to an SPK file.

Throws:
SpiceException

writeType05Segment

public void writeType05Segment(Body body,
                               Body center,
                               ReferenceFrame frame,
                               Time first,
                               Time last,
                               java.lang.String segid,
                               double gm,
                               int n,
                               StateVector[] states,
                               Time[] epochs)
                        throws SpiceException
Write a type 5 segment to an SPK file.

Throws:
SpiceException

writeType09Segment

public void writeType09Segment(Body body,
                               Body center,
                               ReferenceFrame frame,
                               Time first,
                               Time last,
                               java.lang.String segid,
                               int degree,
                               int n,
                               StateVector[] states,
                               Time[] epochs)
                        throws SpiceException
Write a type 9 segment to an SPK file.

Throws:
SpiceException

writeType13Segment

public void writeType13Segment(Body body,
                               Body center,
                               ReferenceFrame frame,
                               Time first,
                               Time last,
                               java.lang.String segid,
                               int degree,
                               int n,
                               StateVector[] states,
                               Time[] epochs)
                        throws SpiceException
Write a type 13 segment to an SPK file.

Throws:
SpiceException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)