Apply corrections to a cube label for subarea extraction.
This class is used to apply corrections to a cube label when a subarea has been extracted. It is a base class which will take the cube label from the original cube file along with subarea information and generate a corrected cube label for the output cube file.
If you would like to see SubArea being used in implementation, see crop, reduce, enlarge, cropspecial, or pad.
- Author
- 2009-10-02 Janet Barrett
- History:
- 2010-11-21 Mackenzie Boyd - Modified UpdateLabels method so so that the units for Scale and PixelResolution keywords are perserved.
- History:
- 2011-01-24 Steven Lambright - Cameras are still valid when linc and sinc are not equal, so now this class is more likely to not delete the instrument group.
- History:
- 2013-12-27 Janet Barrett - Modified the UpdateLabel method so that it updates the MinimumLatitude, MaximumLatitude, MinimumLongitude, and MaximumLongitude keywords for equatorial cylindrical projections. All other projections will not have these keywords in their labels because it is not possible to recalculate them for curved projections. Fixes #1500.
Definition at line 47 of file SubArea.h.
void Isis::SubArea::UpdateLabel |
( |
Cube * |
icube, |
|
|
Cube * |
ocube, |
|
|
PvlGroup & |
results |
|
) |
| |
Modifies a label for a file containing a subarea.
The AlphaCube, Mapping, and Instrument groups are all affected when a subarea is extracted from another file. If the linc is not equal to the sinc, then the Instrument and Mapping groups will be removed from the label because they will no longer be valid. If the linc is equal to the sinc and they are not equal to 1, then the map scale and resolution in the Mapping group needs to be updated. The latitude and longitude ranges become invalid when the subarea does not cover the entire sample and line range of the original cube. Update the upper left corner x,y values if the projection is still valid and the starting line and/or starting sample have been changed from their location in the original file.
- Parameters
-
icube | This is the input cube that will have the subarea extracted from it. The label of this cube will be used to create updated Mapping, Instrument, and AlphaCube groups for the label of the output cube containing the subarea. |
ocube | This is the output cube file containing the subarea. The label of this cube will be modified by extracting the Mapping, Instrument, and AlphaCube groups from the input label and putting them in this label. |
results | This is the Results group that will go into the application log file. This group must be created by the calling application. Information will be added to it if the Mapping or Instrument groups are deleted from the output image label. |
Definition at line 126 of file SubArea.cpp.
References Isis::PvlContainer::addKeyword(), Isis::Cube::deleteGroup(), Isis::PvlContainer::deleteKeyword(), Isis::PvlObject::findObject(), Isis::TProjection::Has180Domain(), Isis::Cube::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::TProjection::IsEquatorialCylindrical(), Isis::Projection::IsGood(), Isis::TProjection::IsPlanetographic(), Isis::TProjection::IsPositiveEast(), Isis::Cube::label(), Isis::Cube::lineCount(), Isis::Cube::projection(), Isis::Cube::putGroup(), Isis::Cube::sampleCount(), Isis::Projection::SetWorld(), Isis::TProjection::To180Domain(), Isis::toDouble(), Isis::TProjection::ToPlanetographic(), Isis::TProjection::ToPositiveWest(), Isis::toString(), Isis::TProjection::UniversalLatitude(), Isis::TProjection::UniversalLongitude(), Isis::AlphaCube::UpdateGroup(), Isis::Projection::XCoord(), and Isis::Projection::YCoord().
Referenced by Isis::FileTool::saveAs_FullResolution(), Isis::Enlarge::UpdateOutputLabel(), and Isis::Reduce::UpdateOutputLabel().