Module JNISpice
Package spice.basic

Class CK


  • public class CK
    extends DAF
    Class CK provides methods for writing, summarizing, and conducting low-level read operations on CK files.

    To make CK data available to programs for frame transformations, use the method KernelDatabase.load(java.lang.String).

    Version 1.0.0 04-JAN-2010 (NJB)

    • Constructor Detail

      • CK

        private CK​(java.lang.String fileName)
        Construct an CK instance representing a file. The file need not exist.
    • Method Detail

      • openNew

        private void openNew​(java.lang.String internalFileName,
                             int nCommentChars)
                      throws SpiceException
        Open a new CK file. The file must not exist prior to this method call.
        Throws:
        SpiceException
      • openNew

        public static CK openNew​(java.lang.String fileName,
                                 java.lang.String internalFileName,
                                 int nCommentChars)
                          throws SpiceException
        Create a new CK file.The file must not exist prior to this method call.
        Parameters:
        fileName - String
        nCommentChars - int
        internalFileName - String
        Returns:
        CK
        Throws:
        SpiceException - exception
      • openForRead

        public static CK openForRead​(java.lang.String fileName)
                              throws SpiceException
        Open an existing CK file for read access.
        Parameters:
        fileName - String
        Returns:
        CK
        Throws:
        SpiceException - exception
      • openForWrite

        public static CK openForWrite​(java.lang.String fileName)
                               throws SpiceException
        Open an existing CK for write access.

        Note that a CK cannot be opened for write access if it has already been opened for read access.

        Parameters:
        fileName - String
        Returns:
        CK
        Throws:
        SpiceException - exception
      • getInstruments

        public int[] getInstruments()
                             throws SpiceException
        Obtain a set of ID codes of objects for which an CK file contains data.
        Returns:
        int []
        Throws:
        SpiceException - exception
      • getInstruments

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

        The result is returned in a new set.

        Parameters:
        initialSet - int[]
        Returns:
        int[]
        Throws:
        SpiceException - exception
      • getCoverage

        public SpiceWindow getCoverage​(Instrument instrument,
                                       boolean needav,
                                       java.lang.String level,
                                       SCLKDuration tol,
                                       TimeSystem timsys,
                                       int nintvls)
                                throws SpiceException
        Obtain a SpiceWindow representing the time coverage provided by this CK for a given instrument.
        Parameters:
        instrument - Instrument
        nintvls - int
        needav - boolean
        timsys - TimeSystem
        level - String
        tol - SCLKDuration
        Returns:
        SpiceWindow
        Throws:
        SpiceException - exception
      • getCoverage

        public SpiceWindow getCoverage​(Instrument instrument,
                                       boolean needav,
                                       java.lang.String level,
                                       SCLKDuration tol,
                                       TimeSystem timsys,
                                       SpiceWindow cover,
                                       int nintvls)
                                throws SpiceException
        Obtain a SpiceWindow representing the time coverage provided by this CK for a given instrument; return the union of this window with a pre-existing coverage window.

        Note that the resulting window will be meaningful only if the input window is compatible with the requested coverage representation for this CK instance: specifically, the instruments, coverage levels, tolerances, time systems, and "need angular velocity" flags must match.

        Parameters:
        instrument - Instrument
        nintvls - int
        needav - boolean
        cover - SpiceWindow
        level - String
        timsys - TimeSystem
        tol - SCLKDuration
        Returns:
        SpiceWindow
        Throws:
        SpiceException - exception
      • writeType02Segment

        public void writeType02Segment​(Time first,
                                       Time last,
                                       Instrument inst,
                                       ReferenceFrame frame,
                                       java.lang.String segid,
                                       Time[] startTimes,
                                       Time[] stopTimes,
                                       SpiceQuaternion[] quats,
                                       Vector3[] avvs,
                                       double[] rates)
                                throws SpiceException
        Write a type 2 segment to an CK file.
        Parameters:
        first - Time
        rates - double[]
        last - Time
        avvs - Vector3[]
        inst - Instrument
        quats - SpiceQuaternion[]
        frame - ReferenceFrame
        stopTimes - Time[]
        segid - String
        startTimes - Time[]
        Throws:
        SpiceException - exception
      • writeType03Segment

        public void writeType03Segment​(Time first,
                                       Time last,
                                       Instrument inst,
                                       ReferenceFrame frame,
                                       boolean avflag,
                                       java.lang.String segid,
                                       Time[] timeTags,
                                       SpiceQuaternion[] quats,
                                       Vector3[] avvs,
                                       Time[] startTimes)
                                throws SpiceException
        Write a type 3 segment to an CK file.
        Parameters:
        first - Time
        startTimes - Time[]
        last - Time
        avvs - Vector3[]
        inst - Instrument
        quats - SpiceQuaternion[]
        frame - ReferenceFrame
        timeTags - Time[]
        avflag - boolean
        segid - String
        Throws:
        SpiceException - exception