Module JNISpice
Package spice.basic

Class SPK

    • Constructor Detail

      • SPK

        private SPK​(java.lang.String fileName)
        Construct an SPK 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 SPK file. The file must not exist prior to this method call.
        Throws:
        SpiceException
      • 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.
        Parameters:
        fileName - String
        nCommentChars - int
        internalFileName - String
        Returns:
        SPK
        Throws:
        SpiceException - exception
      • openForRead

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

        public int[] getBodies()
                        throws SpiceException
        Obtain a set of ID codes of objects for which an SPK file contains data.
        Returns:
        int[]
        Throws:
        SpiceException - exception
      • 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.

        Parameters:
        initialSet - int[]
        Returns:
        int[]
        Throws:
        SpiceException - exception
      • 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.

        Parameters:
        body - int
        Returns:
        SpiceWindow
        Throws:
        SpiceException - exception
      • 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.

        Parameters:
        body - int
        cover - SpiceWindow
        Returns:
        SpiceWindoe
        Throws:
        SpiceException - exception
      • 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.
        Parameters:
        body - Body
        btime - Time
        center - Body
        ChebyCoeffs - double[][][]
        frame - ReferenceFrame
        polydg - int
        first - Time
        n - int
        last - Time
        intlen - TDBDuration
        segid - String
        Throws:
        SpiceException - exception
      • 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.
        Parameters:
        body - Body
        btime - Time
        center - Body
        ChebyCoeffs - double[][][]
        frame - ReferenceFrame
        polydg - int
        first - Time
        n - int
        last - Time
        intlen - TDBDuration
        segid - String
        Throws:
        SpiceException - exception
      • 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.
        Parameters:
        body - Body
        epochs - Time[]
        center - Body
        states - StateVector[]
        frame - ReferenceFrame
        n - int
        first - Time
        gm - double
        last - Time
        segid - String
        Throws:
        SpiceException - exception
      • 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.
        Parameters:
        body - Body
        epochs - Time[]
        center - Body
        states - StateVector[]
        frame - ReferenceFrame
        n - int
        first - Time
        degree - int
        last - Time
        segid - String
        Throws:
        SpiceException - exception
      • 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.
        Parameters:
        body - Body
        epochs - Time[]
        center - Body
        states - StateVector[]
        frame - ReferenceFrame
        n - int
        first - Time
        degree - int
        last - Time
        segid - String
        Throws:
        SpiceException - exception