- java.lang.Object
-
- spice.basic.DAF
-
- spice.basic.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 Summary
Constructors Modifier Constructor Description private
CK(java.lang.String fileName)
Construct an CK instance representing a file.
-
Method Summary
Modifier and Type Method Description int
countSegments()
Count the segments in an CK file.SpiceWindow
getCoverage(Instrument instrument, boolean needav, java.lang.String level, SCLKDuration tol, TimeSystem timsys, int nintvls)
Obtain a SpiceWindow representing the time coverage provided by this CK for a given instrument.SpiceWindow
getCoverage(Instrument instrument, boolean needav, java.lang.String level, SCLKDuration tol, TimeSystem timsys, SpiceWindow cover, int nintvls)
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.int[]
getInstruments()
Obtain a set of ID codes of objects for which an CK file contains data.int[]
getInstruments(int[] initialSet)
Obtain a set of ID codes of objects for which an CK file contains data, merged with an existing set of ID codes.static CK
openForRead(java.lang.String fileName)
Open an existing CK file for read access.static CK
openForWrite(java.lang.String fileName)
Open an existing CK for write access.private void
openNew(java.lang.String internalFileName, int nCommentChars)
Open a new CK file.static CK
openNew(java.lang.String fileName, java.lang.String internalFileName, int nCommentChars)
Create a new CK file.The file must not exist prior to this method call.void
writeType02Segment(Time first, Time last, Instrument inst, ReferenceFrame frame, java.lang.String segid, Time[] startTimes, Time[] stopTimes, SpiceQuaternion[] quats, Vector3[] avvs, double[] rates)
Write a type 2 segment to an CK file.void
writeType03Segment(Time first, Time last, Instrument inst, ReferenceFrame frame, boolean avflag, java.lang.String segid, Time[] timeTags, SpiceQuaternion[] quats, Vector3[] avvs, Time[] startTimes)
Write a type 3 segment to an CK file.-
Methods inherited from class spice.basic.DAF
addComments, beginBackwardSearch, beginForwardSearch, close, deleteComments, findNextArray, findPreviousArray, getArrayName, getDoubleSummaryComponent, getFileName, getHandle, getIntegerSummaryComponent, getInternalFileName, getND, getNI, isReadable, isWritable, readComments
-
-
-
-
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
- StringnCommentChars
- intinternalFileName
- 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
- Instrumentnintvls
- intneedav
- booleantimsys
- TimeSystemlevel
- Stringtol
- 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
- Instrumentnintvls
- intneedav
- booleancover
- SpiceWindowlevel
- Stringtimsys
- TimeSystemtol
- 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
- Timerates
- double[]last
- Timeavvs
- Vector3[]inst
- Instrumentquats
- SpiceQuaternion[]frame
- ReferenceFramestopTimes
- Time[]segid
- StringstartTimes
- 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
- TimestartTimes
- Time[]last
- Timeavvs
- Vector3[]inst
- Instrumentquats
- SpiceQuaternion[]frame
- ReferenceFrametimeTags
- Time[]avflag
- booleansegid
- String- Throws:
SpiceException
- exception
-
countSegments
public int countSegments() throws SpiceException
Count the segments in an CK file.- Overrides:
countSegments
in classDAF
- Returns:
- int
- Throws:
SpiceException
- exception
-
-