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.
 
 Target (Pvl &label)
 Construct a Target without SPICE data.
 
 Target ()
 Constructs an empty Target object.
 
 ~Target ()
 Destroys the Target.
 
void init ()
 Initialize member variables.
 
bool isSky () const
 Return if our target is the sky.
 
SpiceInt naifBodyCode () const
 This returns the NAIF body code of the target.
 
SpiceInt naifPlanetSystemCode () const
 This returns the NAIF planet system body code of the target.
 
QString name () const
 Return target name.
 
QString systemName () const
 Return planet system name.
 
std::vector< Distanceradii () const
 Returns the radii of the body in km.
 
void restoreShape ()
 Restores the shape to the original after setShapeEllipsoid has overridden it.
 
void setShapeEllipsoid ()
 Set the shape to the ellipsoid and save the original shape.
 
void setRadii (std::vector< Distance > radii)
 Sets the radii of the body.
 
void setName (QString name)
 Set the name for the Target.
 
void setSpice (Spice *spice)
 Set the Spice pointer for the Target.
 
ShapeModelshape () const
 Return the shape.
 
Spicespice () const
 Return the spice object.
 
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.
 
static PvlGroup radiiGroup (QString target)
 Creates a Pvl Group with keywords TargetName, EquitorialRadius, and PolarRadius.
 
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.
 

Private Member Functions

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

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.
 

Private Attributes

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

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.

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.

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::NaifStatus::CheckErrors(), Isis::ShapeModelFactory::create(), Isis::PvlContainer::hasKeyword(), init(), lookupNaifBodyCode(), m_bodyCode, m_name, m_radii, m_shape, m_sky, m_spice, m_systemCode, m_systemName, Isis::Distance::Meters, name(), spice(), Isis::toInt(), and Isis::PvlObject::Traverse.

◆ 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::ShapeModelFactory::create(), Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), init(), m_bodyCode, m_name, m_radii, m_shape, m_sky, m_spice, m_systemCode, m_systemName, Isis::Distance::Meters, name(), setName(), Isis::toInt(), and Isis::PvlObject::Traverse.

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

References init(), m_bodyCode, m_name, m_spice, m_systemCode, and m_systemName.

◆ ~Target()

Isis::Target::~Target ( )

Destroys the Target.

Destroys the Target object.

Definition at line 187 of file Target.cpp.

References Isis::NaifStatus::CheckErrors(), m_bodyCode, m_name, m_originalShape, m_radii, m_shape, m_systemCode, and m_systemName.

Member Function Documentation

◆ frameType()

int Isis::Target::frameType ( )

Definition at line 562 of file Target.cpp.

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

References m_originalShape, m_shape, and m_sky.

Referenced by Target(), Target(), and Target().

◆ isSky()

bool Isis::Target::isSky ( ) const

Return if our target is the sky.

Definition at line 215 of file Target.cpp.

References m_sky.

Referenced by Isis::Spice::computeSolarLongitude(), Isis::ShapeModelFactory::create(), and Isis::Spice::init().

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

References Isis::Spice::getInteger(), lookupNaifBodyCode(), m_name, m_spice, and Isis::IException::Unknown.

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

References Isis::NaifStatus::CheckErrors(), Isis::IException::Io, and name().

Referenced by lookupNaifBodyCode(), radiiGroup(), radiiGroup(), and Target().

◆ naifBodyCode()

SpiceInt Isis::Target::naifBodyCode ( ) const

This returns the NAIF body code of the target.

Returns
SpiceInt NAIF body code

Definition at line 522 of file Target.cpp.

References m_bodyCode.

Referenced by Isis::Spice::init(), Isis::Spice::naifBodyCode(), and 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 535 of file Target.cpp.

References m_systemCode.

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

◆ name()

QString Isis::Target::name ( ) const

Return target name.

Definition at line 541 of file Target.cpp.

References m_name.

Referenced by Isis::Spice::init(), lookupNaifBodyCode(), setName(), Target(), Target(), Isis::TargetBody::TargetBody(), and Isis::Spice::targetName().

◆ pmCoefs()

std::vector< Angle > Isis::Target::pmCoefs ( )

Definition at line 577 of file Target.cpp.

◆ pmNutPrecCoefs()

std::vector< double > Isis::Target::pmNutPrecCoefs ( )

Definition at line 592 of file Target.cpp.

◆ poleDecCoefs()

std::vector< Angle > Isis::Target::poleDecCoefs ( )

Definition at line 572 of file Target.cpp.

◆ poleDecNutPrecCoefs()

std::vector< double > Isis::Target::poleDecNutPrecCoefs ( )

Definition at line 587 of file Target.cpp.

◆ poleRaCoefs()

std::vector< Angle > Isis::Target::poleRaCoefs ( )

Definition at line 567 of file Target.cpp.

◆ poleRaNutPrecCoefs()

std::vector< double > Isis::Target::poleRaNutPrecCoefs ( )

Definition at line 582 of file Target.cpp.

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

References m_radii.

Referenced by Isis::BundleTargetBody::BundleTargetBody(), Isis::Spice::init(), Isis::Spice::radii(), radiiGroup(), radiiGroup(), setRadii(), Isis::TargetBody::TargetBody(), and Isis::ShapeModel::targetRadii().

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

References Isis::NaifStatus::CheckErrors(), radii(), radiiGroup(), Isis::toString(), and Isis::IException::Unknown.

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

References Isis::PvlObject::findObject(), lookupNaifBodyCode(), radii(), radiiGroup(), Isis::toDouble(), Isis::toString(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

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

References Isis::IException::Io, lookupNaifBodyCode(), radiiGroup(), and Isis::IException::Unknown.

Referenced by Isis::Latitude::add(), Isis::Latitude::Latitude(), Isis::Latitude::Latitude(), radiiGroup(), radiiGroup(), radiiGroup(), 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 610 of file Target.cpp.

References m_originalShape, m_shape, and Isis::ShapeModel::name().

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

References m_name, and name().

Referenced by Target().

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

References m_radii, and radii().

Referenced by Isis::Spice::init().

◆ setShapeEllipsoid()

void Isis::Target::setShapeEllipsoid ( )

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

Definition at line 628 of file Target.cpp.

References m_originalShape, and m_shape.

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

References m_spice, and spice().

◆ shape()

ShapeModel * Isis::Target::shape ( ) const

Return the shape.

Definition at line 680 of file Target.cpp.

References m_shape.

Referenced by Isis::Spice::init().

◆ spice()

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

Return the spice object.

Definition at line 688 of file Target.cpp.

References m_spice.

Referenced by Isis::ShapeModel::resolution(), setSpice(), and Target().

◆ sysNutPrecCoefs()

std::vector< Angle > Isis::Target::sysNutPrecCoefs ( )

Definition at line 602 of file Target.cpp.

◆ sysNutPrecConstants()

std::vector< Angle > Isis::Target::sysNutPrecConstants ( )

Definition at line 597 of file Target.cpp.

◆ systemName()

QString Isis::Target::systemName ( ) const

Return planet system name.

Definition at line 547 of file Target.cpp.

References m_systemName.

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.

Referenced by naifBodyCode(), Target(), Target(), Target(), and ~Target().

◆ m_name

QString* Isis::Target::m_name
private

target name

Definition at line 118 of file Target.h.

Referenced by lookupNaifBodyCode(), name(), setName(), Target(), Target(), Target(), and ~Target().

◆ m_originalShape

ShapeModel* Isis::Target::m_originalShape
private

target original shape model

Definition at line 121 of file Target.h.

Referenced by init(), restoreShape(), setShapeEllipsoid(), and ~Target().

◆ m_radii

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

target radii

Definition at line 120 of file Target.h.

Referenced by radii(), setRadii(), Target(), Target(), and ~Target().

◆ m_shape

ShapeModel* Isis::Target::m_shape
private

target shape model

Definition at line 122 of file Target.h.

Referenced by init(), restoreShape(), setShapeEllipsoid(), shape(), Target(), Target(), and ~Target().

◆ m_sky

bool Isis::Target::m_sky
private

flag indicating target is the sky

Definition at line 123 of file Target.h.

Referenced by init(), isSky(), Target(), and Target().

◆ 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.

Referenced by lookupNaifBodyCode(), setSpice(), spice(), Target(), Target(), and Target().

◆ 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.

Referenced by naifPlanetSystemCode(), Target(), Target(), Target(), and ~Target().

◆ m_systemName

QString* Isis::Target::m_systemName
private

name of the planetary system of the target

Definition at line 119 of file Target.h.

Referenced by systemName(), Target(), Target(), Target(), and ~Target().


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