|
Isis 3.0 Application Source Code Reference |
Home |
Container for SPICE kernel creation. More...
#include <SpiceKernel.h>
Public Types | |
| typedef K | SegmentType |
| typedef std::vector< SegmentType > | SegmentList |
| typedef SegmentList::iterator | SegmentIter |
| typedef SegmentList::const_iterator | ConstSegmentIter |
Public Member Functions | |
| SpiceKernel () | |
| virtual | ~SpiceKernel () |
| int | size () const |
| Returns the number of segments. | |
| const SpiceSegment & | operator[] (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. | |
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.
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.
Definition at line 68 of file SpiceKernel.h.
| 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.
| 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.
| 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.
Definition at line 103 of file SpiceKernel.h.
| ConstSegmentIter end | ( | ) | const [inline] |
Const iterator to end of list.
Definition at line 112 of file SpiceKernel.h.
| SegmentIter begin | ( | ) | [inline] |
Returns the start of the list for iterating purposes.
Definition at line 121 of file SpiceKernel.h.
| SegmentIter end | ( | ) | [inline] |
Returns the end of the list.
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.
| 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.
| 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.
| Visitor | Visitor class that accepts each segment in the list |
Definition at line 178 of file SpiceKernel.h.