USGS

Isis 3.0 Application Source Code Reference

Home

SpiceKernel< K > Class Template Reference

Container for SPICE kernel creation. More...

#include <SpiceKernel.h>

List of all members.

Public Types

typedef K SegmentType
typedef std::vector< SegmentTypeSegmentList
typedef SegmentList::iterator SegmentIter
typedef SegmentList::const_iterator ConstSegmentIter

Public Member Functions

 SpiceKernel ()
virtual ~SpiceKernel ()
int size () const
 Returns the number of segments.
const SpiceSegmentoperator[] (const int i) const
void add (const QString &fname)
void add (Cube &cube)
QString getSummary (const QString &commfile="") const
void write (const QString &kname, const QString &commfile="", const int ckType=3) const
 SpiceKernel ()
 Constructor.
virtual ~SpiceKernel ()
 Destructor.
int size () const
 Returns the number of segments.
ConstSegmentIter begin () const
 Const iterator into list.
ConstSegmentIter end () const
 Const iterator to end of list.
SegmentIter begin ()
 Returns the start of the list for iterating purposes.
SegmentIter end ()
 Returns the end of the list.
void add (const K &segment)
 Add a new segment to the kernel.
template<typename Visitor >
void Accept (Visitor &v) const
 Template method Visitor implementation.
template<typename Visitor >
void Accept (const Visitor &v) const
 Const template methoid visitor implementation.

Detailed Description

template<typename K>
class Isis::SpiceKernel< K >

Container for SPICE kernel creation.

This class serves as a container for ISIS cube files to prep for writing the contents to a NAIF SPICE kernel. Each file added is a CK segment. When the ISIS cube is added, the contents of the Table BLOB (InstrumentRotation for CKs, InstrumentPosition for SPKs) are read and transformed to the appropriate state intended to be compatible with kernels issued by each mission source.

It is designed for ease of use. Here is an example to create the most basic of CK kernel from a single ISIS file:

   SpiceKernel kernel;
   kernel.add("mycube.cub");
   kernel.write("mycube.ck");  // Writes a type 3 CK kernel by default

Note that processing ISIS cubes is expensive in terms of NAIF kernel management. Lots of NAIF kernel activity is incurred in resolving all the necessary requirements to get the SPICE data in a form that satisfies NAIF kernel specifications.

Author:
2010-11-22 Kris Becker

This class serves as a container for ISIS cube files to prep for writing the contents to a NAIF SPICE kernel. Each file added is a CK or SPK segment depending upon the type specified in the K template parameter. When the ISIS cube SPICE segment is added, the contents of the Table BLOB (InstrumentRotation for CKs, InstrumentPosition for SPKs) have been read and transformed to the appropriate state intended to be compatible with kernels issued by each mission source.

It is designed for ease of use. Here is an example to create the most basic of CK kernel from a single ISIS file:

   SpiceKernel<SpkSegment> kernel;
   kernel.add("mycube.cub");

Note that processing ISIS cubes is expensive in terms of NAIF kernel management. Lots of NAIF kernel activity is incurred in resolving all the necessary requirements to get the SPICE data in a form that satisfies NAIF kernel specifications.

To get access to the segments a Visitor design pattern is used whereby the generic Visitor class need only write an paren operator that accepts a segment of the K type. This class interates through all the segments calling the operator(K &segment) method for each one in the container.

Note that when a new K Segment is added, the list is immediately sorted based on time. The sort is a stable sort, meaning if the segments are added in a time chronologically increasing time, the original list order is preserved.

Author:
2010-11-22 Kris Becker

Definition at line 68 of file SpiceKernel.h.


Member Typedef Documentation

typedef K SegmentType

Definition at line 85 of file SpiceKernel.h.

typedef std::vector<SegmentType> SegmentList

Definition at line 86 of file SpiceKernel.h.

typedef SegmentList::iterator SegmentIter

Definition at line 87 of file SpiceKernel.h.

typedef SegmentList::const_iterator ConstSegmentIter

Definition at line 88 of file SpiceKernel.h.


Constructor & Destructor Documentation

SpiceKernel (  ) 

Definition at line 49 of file SpiceKernel.cpp.

virtual ~SpiceKernel (  )  [inline, virtual]

Definition at line 71 of file SpiceKernel.h.

SpiceKernel (  )  [inline]

Constructor.

Definition at line 91 of file SpiceKernel.h.

virtual ~SpiceKernel (  )  [inline, virtual]

Destructor.

Definition at line 93 of file SpiceKernel.h.


Member Function Documentation

int size (  )  const [inline]

Returns the number of segments.

Definition at line 74 of file SpiceKernel.h.

const SpiceSegment & operator[] ( const int  i  )  const

Definition at line 64 of file SpiceKernel.cpp.

void add ( const QString &  fname  ) 

Definition at line 53 of file SpiceKernel.cpp.

void add ( Cube cube  ) 

Definition at line 60 of file SpiceKernel.cpp.

QString getSummary ( const QString &  commfile = ""  )  const

Definition at line 73 of file SpiceKernel.cpp.

void write ( const QString &  kname,
const QString &  commfile = "",
const int  ckType = 3 
) const

Definition at line 91 of file SpiceKernel.cpp.

int size (  )  const [inline]

Returns the number of segments.

Definition at line 96 of file SpiceKernel.h.

ConstSegmentIter begin (  )  const [inline]

Const iterator into list.

Returns:
ConstSegmentIter Returns a const iterator to the list

Definition at line 103 of file SpiceKernel.h.

ConstSegmentIter end (  )  const [inline]

Const iterator to end of list.

Returns:
ConstSegmentIter Returns the const end of the list

Definition at line 112 of file SpiceKernel.h.

SegmentIter begin (  )  [inline]

Returns the start of the list for iterating purposes.

Returns:
SegmentIter Returns an iterator on the collection

Definition at line 121 of file SpiceKernel.h.

SegmentIter end (  )  [inline]

Returns the end of the list.

Returns:
SegmentIter Returns the end of the list for determining the end of the iteration loop

Definition at line 131 of file SpiceKernel.h.

void add ( const K &  segment  )  [inline]

Add a new segment to the kernel.

This method accepts a new segment and inserts it in the list - actually appends it and then resorts the list so they are ordered by time.

Parameters:
segment New segment to add to list

Definition at line 143 of file SpiceKernel.h.

void Accept ( Visitor &  v  )  const [inline]

Template method Visitor implementation.

This method accepts a Visitor that defines an operator() of the form Visitor::operator()(K &segment). For every segment in the list, the operator will be called. The caller is assured the list is sorted via the operator<(const K &segment) of the segment type when they were added.

Parameters:
Visitor Visitor class that accepts each segment in the list

Definition at line 160 of file SpiceKernel.h.

void Accept ( const Visitor &  v  )  const [inline]

Const template methoid visitor implementation.

This is a const Visitor method implementation with same functionality as the non-const version.

Parameters:
Visitor Visitor class that accepts each segment in the list

Definition at line 178 of file SpiceKernel.h.


The documentation for this class was generated from the following files: