Isis 3 Programmer Reference
Isis::Target Class Reference

This class is used to create and store valid Isis 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 (Pvl &label)
 Construct a Target without SPICE data. 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...
 
void setName (QString name)
 Set the name for the Target. More...
 
void setSpice (Spice *spice)
 Set the Spice pointer for the Target. 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 Isis 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.
History:
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.
History:
2016-05-18 Jeannie Backer - Removed unused lookupNaifBodyCode() method that takes no input parameters (since it was replaced with lookupNaifBodyCode(Pvl)). References #3934.
History:
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.
History:
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.
History:
2021-02-17 Kristin Berry, Jesse Mapel, and Stuart Sides - Added the ability to create a Target without SPICE data and later set the sensor model pointer.

Definition at line 63 of file Target.h.

Constructor & Destructor Documentation

◆ Target() [1/3]

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 38 of file Target.cpp.

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

◆ Target() [2/3]

Isis::Target::Target ( Pvl label)

Construct a Target without SPICE data.

The label should contain an Instrument group with a TargetName and a Kernels group with a ShapeModel.

Parameters
labelLabel containing information about the Target.

Definition at line 109 of file Target.cpp.

References Isis::PvlObject::findGroup().

◆ Target() [3/3]

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 134 of file Target.cpp.

◆ ~Target()

Isis::Target::~Target ( )

Destroys the Target.

Destroys the Target object.

Definition at line 162 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 152 of file Target.cpp.

◆ isSky()

bool Isis::Target::isSky ( ) const

Return if our target is the sky.

Definition at line 190 of file Target.cpp.

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

◆ lookupNaifBodyCode() [1/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 201 of file Target.cpp.

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

◆ lookupNaifBodyCode() [2/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 244 of file Target.cpp.

◆ naifBodyCode()

SpiceInt Isis::Target::naifBodyCode ( ) const

This returns the NAIF body code of the target.

Returns
SpiceInt NAIF body code

Definition at line 497 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 510 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 532 of file Target.cpp.

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

◆ radiiGroup() [1/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 451 of file Target.cpp.

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

◆ 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 275 of file Target.cpp.

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

◆ radiiGroup() [3/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 403 of file Target.cpp.

References Isis::PvlContainer::findKeyword().

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

◆ restoreShape()

void Isis::Target::restoreShape ( )

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

Definition at line 585 of file Target.cpp.

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

◆ setName()

void Isis::Target::setName ( QString  name)

Set the name for the Target.

This function should be used if the target name is not available on the label originally used to initialize the Target.

Parameters
nameThe new name of the Target

Definition at line 632 of file Target.cpp.

◆ 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 615 of file Target.cpp.

Referenced by Isis::CSMCamera::setTarget().

◆ setShapeEllipsoid()

void Isis::Target::setShapeEllipsoid ( )

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

Definition at line 603 of file Target.cpp.

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

◆ setSpice()

void Isis::Target::setSpice ( Spice spice)

Set the Spice pointer for the Target.

This function should be used if the Target was initialized without SPICE data but is still needed by a sensor model.

Parameters
spiceA pointer to the new Spice object

Definition at line 647 of file Target.cpp.

Referenced by Isis::CSMCamera::setTarget().

◆ shape()

◆ spice()

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

Return the spice object.

Definition at line 663 of file Target.cpp.

◆ systemName()

QString Isis::Target::systemName ( ) const

Return planet system name.

Definition at line 522 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 112 of file Target.h.

◆ m_name

QString* Isis::Target::m_name
private

target name

Definition at line 118 of file Target.h.

◆ m_originalShape

ShapeModel* Isis::Target::m_originalShape
private

target original shape model

Definition at line 121 of file Target.h.

◆ m_radii

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

target radii

Definition at line 120 of file Target.h.

◆ m_shape

ShapeModel* Isis::Target::m_shape
private

target shape model

Definition at line 122 of file Target.h.

◆ m_sky

bool Isis::Target::m_sky
private

flag indicating target is the sky

Definition at line 123 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 129 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 116 of file Target.h.

◆ m_systemName

QString* Isis::Target::m_systemName
private

name of the planetary system of the target

Definition at line 119 of file Target.h.


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