File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -771,18 +771,23 @@ void sanitize(std::string &input);
771
771
772
772
/* *
773
773
* Set the Target object for the camera model.
774
+ *
775
+ * If no radii can be found in the label from the naif keywords
776
+ * use the radii from the csm model
774
777
*
775
778
* @param label The label containing information to create the Target from
776
779
*/
777
780
void CSMCamera::setTarget (Pvl label) {
778
781
Target *target = new Target (label);
779
782
780
- // get radii from CSM
781
- csm::Ellipsoid targetEllipsoid = csm::SettableEllipsoid::getEllipsoid (m_model);
782
- std::vector<Distance> radii = {Distance (targetEllipsoid.getSemiMajorRadius (), Distance::Meters),
783
- Distance (targetEllipsoid.getSemiMajorRadius (), Distance::Meters),
784
- Distance (targetEllipsoid.getSemiMinorRadius (), Distance::Meters)};
785
- target->setRadii (radii);
783
+ if (target->radii ().size () == 0 ) {
784
+ // get radii from CSM
785
+ csm::Ellipsoid targetEllipsoid = csm::SettableEllipsoid::getEllipsoid (m_model);
786
+ std::vector<Distance> radii = {Distance (targetEllipsoid.getSemiMajorRadius (), Distance::Meters),
787
+ Distance (targetEllipsoid.getSemiMajorRadius (), Distance::Meters),
788
+ Distance (targetEllipsoid.getSemiMinorRadius (), Distance::Meters)};
789
+ target->setRadii (radii);
790
+ }
786
791
787
792
// Target needs to be able to access the camera to do things like
788
793
// compute resolution
Original file line number Diff line number Diff line change @@ -143,6 +143,18 @@ namespace Isis {
143
143
*m_systemCode = -1 ;
144
144
(*m_systemName).append (" THE COSMOS" );
145
145
}
146
+
147
+ if (label.hasObject (" NaifKeywords" )) {
148
+ PvlObject naifKeywords = label.findObject (" NaifKeywords" );
149
+ QString m_bodyCode = naifKeywords[" BODY_CODE" ];
150
+ PvlKeyword radiiKey = naifKeywords.findKeyword (" BODY" + m_bodyCode + " _RADII" );
151
+ std::vector<Distance> radii (3 , Distance ());
152
+ radii[0 ] = Distance (radiiKey[0 ].toDouble (), Distance::Kilometers);
153
+ radii[1 ] = Distance (radiiKey[1 ].toDouble (), Distance::Kilometers);
154
+ radii[2 ] = Distance (radiiKey[2 ].toDouble (), Distance::Kilometers);
155
+
156
+ setRadii (radii);
157
+ }
146
158
147
159
m_shape = ShapeModelFactory::create (this , label);
148
160
}
You can’t perform that action at this time.
0 commit comments