Isis 3 Programmer Reference
Isis::Target Class Reference

This class is used to create and store valid Isis3 targets. More...

#include <Target.h>

Collaboration diagram for Isis::Target:
Collaboration graph

Public Member Functions

 Target (Spice *spice, Pvl &label)
 Constructs a Target object and loads target information. More...
 
 Target ()
 Constructs an empty Target object. More...
 
 ~Target ()
 Destroys the Target. More...
 
void init ()
 Initialize member variables. More...
 
bool isSky () const
 Return if our target is the sky. More...
 
SpiceInt naifBodyCode () const
 This returns the NAIF body code of the target. More...
 
SpiceInt naifPlanetSystemCode () const
 This returns the NAIF planet system body code of the target. More...
 
QString name () const
 Return target name. More...
 
QString systemName () const
 Return planet system name. More...
 
std::vector< Distanceradii () const
 Returns the radii of the body in km. More...
 
void restoreShape ()
 Restores the shape to the original after setShapeEllipsoid has overridden it. More...
 
void setShapeEllipsoid ()
 Set the shape to the ellipsoid and save the original shape. More...
 
void setRadii (std::vector< Distance > radii)
 Sets the radii of the body. More...
 
ShapeModelshape () const
 Return the shape. More...
 
Spicespice () const
 Return the spice object
More...
 
int frameType ()
 
std::vector< AnglepoleRaCoefs ()
 
std::vector< AnglepoleDecCoefs ()
 
std::vector< AnglepmCoefs ()
 
std::vector< double > poleRaNutPrecCoefs ()
 
std::vector< double > poleDecNutPrecCoefs ()
 
std::vector< double > pmNutPrecCoefs ()
 
std::vector< AnglesysNutPrecConstants ()
 
std::vector< AnglesysNutPrecCoefs ()
 

Static Public Member Functions

static SpiceInt lookupNaifBodyCode (QString name)
 This returns the NAIF body code of the target indicated in the labels. More...
 
static PvlGroup radiiGroup (QString target)
 Creates a Pvl Group with keywords TargetName, EquitorialRadius, and PolarRadius. More...
 
static PvlGroup radiiGroup (Pvl &cubeLab, const PvlGroup &mapGroup)
 This method returns a Mapping group containing TargetName, EquatorialRadius, and PolarRadius in addition to all of the keywords that are in the given mapGroup. More...
 

Private Member Functions

SpiceInt lookupNaifBodyCode (Pvl &lab) const
 This returns the NAIF body code of the target indicated in the labels. More...
 

Static Private Member Functions

static PvlGroup radiiGroup (int bodyFrameCode)
 Convenience method called by the public radii() methods to compute the target radii using a body code recognized by NAIF. More...
 

Private Attributes

SpiceInt * m_bodyCode
 The NaifBodyCode value, if it exists in the labels. More...
 
SpiceInt * m_systemCode
 The NaifBodyCode of the targets planetary system If the target is sky, then what should this be??? More...
 
QString * m_name
 target name More...
 
QString * m_systemName
 name of the planetary system of the target More...
 
std::vector< Distancem_radii
 target radii More...
 
ShapeModelm_originalShape
 target original shape model More...
 
ShapeModelm_shape
 target shape model More...
 
bool m_sky
 flag indicating target is the sky More...
 
Spicem_spice
 parent Spice object, needed to get pixel resolution in ShapeModels More...
 

Detailed Description

This class is used to create and store valid Isis3 targets.

Author
2012-03-20 Debbie A. Cook
History:

2015-07-31 Kristin Berry - Added additional NaifStatus::CheckErrors() to see if any NAIF errors were signaled. References #2248.

2016-05-18 Jeannie Backer - Moved TProjection::TargetRadii() methods to Target::radiiGroup() methods. Added overloaded lookupNaifBodyCode(QString) to have a generic static method that takes the TargetName as an input parameter. Added overloaded lookupNaifBodyCode(Pvl) to use the label passed into Target's constructor to find the code if not found using the name or spice pointer provided. References #3934.

2016-05-18 Jeannie Backer - Removed unused lookupNaifBodyCode() method that takes no input parameters (since it was replaced with lookupNaifBodyCode(Pvl)). References #3934.

2017-08-14 Stuart Sides - Added the ability to use a target code and the NaifKeywords to find the radii. Added so osirisrex and spicelib v66. References #4947.

2018-10-02 Debbie A. Cook - Fixed method lookupNaifBodyCode to look up the Naif body code instead of the Naif body frame code. We may need to add a method to look up the Naif body frame code as well. Also moved the try loop attempting to find the radii tagged with the Naif body code ahead of the try loop that attempts to find the radii tagged with the body frame code in the method radiiGroup. Fixed any mention of Naif body frame code that should be Naif body code. These are not the same. Naif tags the body radii keyword with the Naif body code. The Naif body frame code refers to the orientation (SpiceRotation) of the body. References #4649 and #501.

Definition at line 76 of file Target.h.

Constructor & Destructor Documentation

◆ Target() [1/2]

Isis::Target::Target ( Spice spice,
Pvl lab 
)

Constructs a Target object and loads target information.

Parameters
labLabel containing Instrument and Kernels groups.
Author
2012-03-20 Debbie A. Cook
History:
2012-10-11 Debbie A. Cook - Original version

Definition at line 53 of file Target.cpp.

References Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), and Isis::toInt().

◆ Target() [2/2]

Isis::Target::Target ( )

Constructs an empty Target object.

Author
2012-03-20 Debbie A. Cook
History:
2012-08-29 Debbie A. Cook - Original version

Definition at line 124 of file Target.cpp.

◆ ~Target()

Isis::Target::~Target ( )

Destroys the Target.

Destroys the Target object.

Definition at line 152 of file Target.cpp.

Member Function Documentation

◆ init()

void Isis::Target::init ( )

Initialize member variables.

Author
2012-03-20 Debbie A. Cook
History:
2012-08-31 Debbie A. Cook - Original version

Definition at line 142 of file Target.cpp.

◆ isSky()

bool Isis::Target::isSky ( ) const

Return if our target is the sky.

Definition at line 180 of file Target.cpp.

Referenced by Isis::ShapeModelFactory::create().

◆ lookupNaifBodyCode() [1/2]

SpiceInt Isis::Target::lookupNaifBodyCode ( QString  name)
static

This returns the NAIF body code of the target indicated in the labels.

Returns
SpiceInt NAIF body code

Definition at line 234 of file Target.cpp.

References _FILEINFO_.

◆ lookupNaifBodyCode() [2/2]

SpiceInt Isis::Target::lookupNaifBodyCode ( Pvl lab) const
private

This returns the NAIF body code of the target indicated in the labels.

Returns
SpiceInt NAIF body code

Definition at line 191 of file Target.cpp.

References _FILEINFO_, Isis::IException::append(), Isis::PvlObject::findObject(), and Isis::PvlObject::hasObject().

◆ naifBodyCode()

SpiceInt Isis::Target::naifBodyCode ( ) const

This returns the NAIF body code of the target.

Returns
SpiceInt NAIF body code

Definition at line 487 of file Target.cpp.

Referenced by Isis::TargetBody::TargetBody().

◆ naifPlanetSystemCode()

SpiceInt Isis::Target::naifPlanetSystemCode ( ) const

This returns the NAIF planet system body code of the target.

Returns
SpiceInt NAIF system body code

e.g. Enceladus is in the Saturn system

Definition at line 500 of file Target.cpp.

Referenced by Isis::TargetBody::TargetBody().

◆ name()

QString Isis::Target::name ( ) const

◆ radii()

std::vector< Distance > Isis::Target::radii ( ) const

Returns the radii of the body in km.

The radii are obtained from the appropriate SPICE kernel for the body specified by TargetName in the Instrument group of the labels.

Definition at line 522 of file Target.cpp.

Referenced by Isis::Camera::BasicMapping(), Isis::BundleTargetBody::BundleTargetBody(), and Isis::TargetBody::TargetBody().

◆ radiiGroup() [1/3]

PvlGroup Isis::Target::radiiGroup ( QString  target)
static

Creates a Pvl Group with keywords TargetName, EquitorialRadius, and PolarRadius.

The values for the radii will be retrieved from the most recent Target Attitude and Shape Naif kernel available in the Isis data area.

Parameters
targetThe name of the body for which the radii will be retrieved.
Exceptions
IException::Io- "Could not convert target name to NAIF code."
Returns
PvlGroup Group named "Mapping" with keywords TargetName, EquatorialRadius, and PolarRadius.

Definition at line 393 of file Target.cpp.

References _FILEINFO_, and Isis::PvlContainer::findKeyword().

Referenced by Isis::Latitude::add(), Isis::Latitude::Latitude(), Isis::StereoTool::setFiles(), and Isis::TProjection::TProjection().

◆ radiiGroup() [2/3]

PvlGroup Isis::Target::radiiGroup ( Pvl cubeLab,
const PvlGroup mapGroup 
)
static

This method returns a Mapping group containing TargetName, EquatorialRadius, and PolarRadius in addition to all of the keywords that are in the given mapGroup.

Parameters
cubeLabPvl labels for the image.
mapGroupA const reference to a PvlGroup that contains mapping parameters for the projection.
Returns
PvlGroup The Mapping Group for the projection including the keywords TargetName, EquatorialRadius, and PolarRadius.

Definition at line 265 of file Target.cpp.

References _FILEINFO_, Isis::PvlContainer::addKeyword(), Isis::PvlObject::findGroup(), Isis::PvlContainer::findKeyword(), Isis::PvlObject::findKeyword(), Isis::PvlObject::findObject(), Isis::PvlContainer::hasKeyword(), Isis::PvlObject::hasKeyword(), Isis::PvlObject::hasObject(), Isis::toDouble(), Isis::toString(), and Isis::IException::what().

◆ radiiGroup() [3/3]

PvlGroup Isis::Target::radiiGroup ( int  bodyCode)
staticprivate

Convenience method called by the public radii() methods to compute the target radii using a body code recognized by NAIF.

The PVL group contains only the EquatorialRadius and PolarRadius keywords. This group does not contain the Target keyword.

Parameters
bodyFrameCodeA recognized NAIF code that represents the target body.
Returns
PvlGroup containing EquatorialRadius and PolarRadius keywords.

Definition at line 441 of file Target.cpp.

References _FILEINFO_, Isis::FileName::expanded(), Isis::FileName::highestVersion(), and Isis::toString().

◆ restoreShape()

void Isis::Target::restoreShape ( )

Restores the shape to the original after setShapeEllipsoid has overridden it.

Definition at line 575 of file Target.cpp.

Referenced by Isis::Sensor::IgnoreElevationModel().

◆ setRadii()

void Isis::Target::setRadii ( std::vector< Distance radii)

Sets the radii of the body.

Parameters
r[]Radii of the target in kilometers

Definition at line 605 of file Target.cpp.

◆ setShapeEllipsoid()

void Isis::Target::setShapeEllipsoid ( )

Set the shape to the ellipsoid and save the original shape.

Definition at line 593 of file Target.cpp.

Referenced by Isis::Sensor::IgnoreElevationModel().

◆ shape()

◆ spice()

Spice * Isis::Target::spice ( ) const

Return the spice object

Definition at line 623 of file Target.cpp.

◆ systemName()

QString Isis::Target::systemName ( ) const

Return planet system name.

Definition at line 512 of file Target.cpp.

Referenced by Isis::TargetBody::TargetBody().

Member Data Documentation

◆ m_bodyCode

SpiceInt* Isis::Target::m_bodyCode
private

The NaifBodyCode value, if it exists in the labels.

Otherwise, if the target is sky, it's the SPK code and if not sky then it's calculated by the NaifBodyCode() method.

Definition at line 121 of file Target.h.

◆ m_name

QString* Isis::Target::m_name
private

target name

Definition at line 127 of file Target.h.

◆ m_originalShape

ShapeModel* Isis::Target::m_originalShape
private

target original shape model

Definition at line 130 of file Target.h.

◆ m_radii

std::vector<Distance> Isis::Target::m_radii
private

target radii

Definition at line 129 of file Target.h.

◆ m_shape

ShapeModel* Isis::Target::m_shape
private

target shape model

Definition at line 131 of file Target.h.

◆ m_sky

bool Isis::Target::m_sky
private

flag indicating target is the sky

Definition at line 132 of file Target.h.

◆ m_spice

Spice* Isis::Target::m_spice
private

parent Spice object, needed to get pixel resolution in ShapeModels

Definition at line 138 of file Target.h.

◆ m_systemCode

SpiceInt* Isis::Target::m_systemCode
private

The NaifBodyCode of the targets planetary system If the target is sky, then what should this be???

Definition at line 125 of file Target.h.

◆ m_systemName

QString* Isis::Target::m_systemName
private

name of the planetary system of the target

Definition at line 128 of file Target.h.


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