本文整理汇总了C++中PvlGroup::hasKeyword方法的典型用法代码示例。如果您正苦于以下问题:C++ PvlGroup::hasKeyword方法的具体用法?C++ PvlGroup::hasKeyword怎么用?C++ PvlGroup::hasKeyword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PvlGroup
的用法示例。
在下文中一共展示了PvlGroup::hasKeyword方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
/**
* Create and initialize a Latitude value using the mapping group's latitude
* units and radii.
*
* @see ErrorChecking
* @see CoordinateType
* @param latitude The latitude value this instance will represent,
* in the mapping group's units
* @param mapping A mapping group
* @param latitudeUnits The angular units of the latitude value (degs, rads)
* @param errors Error checking conditions
*/
Latitude::Latitude(Angle latitude, PvlGroup mapping,
ErrorChecking errors) : Angle(latitude) {
m_equatorialRadius = NULL;
m_polarRadius = NULL;
if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) {
m_equatorialRadius = new Distance(toDouble(mapping["EquatorialRadius"][0]),
Distance::Meters);
m_polarRadius = new Distance(toDouble(mapping["PolarRadius"][0]),
Distance::Meters);
}
else {
PvlGroup radiiGrp = TProjection::TargetRadii(mapping["TargetName"]);
m_equatorialRadius = new Distance(toDouble(radiiGrp["EquatorialRadius"][0]),
Distance::Meters);
m_polarRadius = new Distance(toDouble(radiiGrp["PolarRadius"][0]),
Distance::Meters);
}
m_errors = errors;
if(mapping["LatitudeType"][0] == "Planetographic") {
setPlanetographic(latitude.radians(), Radians);
}
else if(mapping["LatitudeType"][0] == "Planetocentric") {
setPlanetocentric(latitude.radians(), Radians);
}
else {
QString msg = "Latitude type [" + mapping["LatitudeType"][0] +
"] is not recognized";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
}
示例2: add
/**
* Adds an angle to this latitude. The adding method is determined by the
* latitude type.
*
* @param angleToAdd the latitude being added to this one
* @param mapping the mapping group from a projection
* @return The result
*/
Latitude Latitude::add(Angle angleToAdd, PvlGroup mapping) {
CoordinateType latType;
Distance equatorialRadius;
Distance polarRadius;
if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) {
equatorialRadius = Distance(toDouble(mapping["EquatorialRadius"][0]),
Distance::Meters);
polarRadius = Distance(toDouble(mapping["PolarRadius"][0]),
Distance::Meters);
}
else {
PvlGroup radiiGrp = TProjection::TargetRadii(mapping["TargetName"]);
equatorialRadius = Distance(toDouble(radiiGrp["EquatorialRadius"][0]),
Distance::Meters);
polarRadius = Distance(toDouble(radiiGrp["PolarRadius"][0]),
Distance::Meters);
}
if(mapping["LatitudeType"][0] == "Planetocentric")
latType = Planetocentric;
else if (mapping["LatitudeType"][0] == "Planetographic")
latType = Planetographic;
else {
IString msg = "Latitude type [" + IString(mapping["LatitudeType"][0]) +
"] is not recognized";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
return add(angleToAdd, equatorialRadius, polarRadius, latType);
}
示例3: GetCCD_Channel_Coefficients
/**
* With the Channel, CCD in the isis label, find the coefficient values
* for this image
*
* @author Sharmila Prasad (11/24/2010)
*
* @param pCubeLabel
*/
void GetCCD_Channel_Coefficients(Pvl & pCubeLabel)
{
int iChannel=-1, iSumming=-1;
QString sCcd="";
PvlGroup instrGrp = pCubeLabel.findObject("IsisCube").findGroup("Instrument");
// Summing keyword
if (!instrGrp.hasKeyword("Summing")) {
QString sMsg = "Summing keyword not found";
throw IException(IException::User, sMsg, _FILEINFO_);
}
else {
PvlKeyword binKey = instrGrp.findKeyword("Summing");
iSumming = toInt(binKey[0]);
if (iSumming != 1 && iSumming != 2 && iSumming != 4) {
QString sMsg = "Invalid Summing value in input file, must be 1,2,or 4";
throw IException(IException::User, sMsg, _FILEINFO_);
}
}
// CCD Keyword
if (!instrGrp.hasKeyword("CcdId")) {
QString sMsg = "CcdId keyword not found";
throw IException(IException::User, sMsg, _FILEINFO_);
}
else {
PvlKeyword ccdKey = instrGrp.findKeyword("CcdId");
sCcd = ccdKey[0];
}
// Channel Keyword
if (!instrGrp.hasKeyword("ChannelNumber")) {
QString sMsg = "ChannelNumber keyword not found";
throw IException(IException::User, sMsg, _FILEINFO_);
}
else {
PvlKeyword channelKey = instrGrp.findKeyword("ChannelNumber");
iChannel = toInt(channelKey[0]);
}
// Get the coefficient file name
QString dCoeffFile = "$mro/calibration/HiRISE_Gain_Drift_Correction_Bin" + toString(iSumming) + ".0001.csv";
//QString dCoeffFile = "/home/sprasad/isis3/isis/src/mro/apps/hicalproc/HiRISE_Gain_Drift_Correction_Bin" + toString(iSumming) + ".0001.csv";
#ifdef _DEBUG_
cout << dCoeffFile << endl;
#endif
// Get the coefficients
ReadCoefficientFile(FileName(dCoeffFile).expanded(), sCcd, iChannel);
}
示例4: UpdateBandKey
// Updates existing BandBin keywords with additional values to ensure
// label compilancy (which should support Camera models). It checks for the
// existance of the keyword and uses its (assumed) first value to set nvals
// values to a constant. If the keyword doesn't exist, it uses the default
// value.
void UpdateBandKey(const QString &keyname, PvlGroup &bb, const int &nvals,
const QString &default_value) {
QString defVal(default_value);
if ( bb.hasKeyword(keyname) ) {
defVal = bb[keyname][0];
}
bb.addKeyword(makeKey(keyname, nvals, defVal), PvlContainer::Replace);
return;
}
示例5: IsisMain
void IsisMain() {
// Create a process so we can output the noproj'd labels without overwriting
Process p;
// Open the user interface and get the input file and the ideal specs file
UserInterface &ui = Application::GetUserInterface();
Cube *mcube, *icube;
// If a MATCH cube is entered, make sure to SetInputCube it first to get the SPICE blobs
// from it propagated to the TO labels
// Until polygon blobs are detached without "/" don't propagate them
p.PropagatePolygons(false);
if((ui.WasEntered("MATCH"))) {
mcube = p.SetInputCube("MATCH");
icube = p.SetInputCube("FROM");
}
else {
mcube = icube = p.SetInputCube("FROM");
}
Camera *incam = mcube->camera();
// Extract Instrument groups from input labels for the output match and noproj'd cubes
PvlGroup inst = mcube->group("Instrument");
PvlGroup fromInst = icube->group("Instrument");
QString groupName = (QString) inst["SpacecraftName"] + "/";
groupName += (QString) inst.findKeyword("InstrumentId");
// Get Ideal camera specifications
FileName specs;
if((ui.WasEntered("SPECS"))) {
specs = ui.GetFileName("SPECS");
}
else {
specs = "$base/applications/noprojInstruments???.pvl";
specs = specs.highestVersion();
}
Pvl idealSpecs(specs.expanded());
PvlObject obSpecs = idealSpecs.findObject("IdealInstrumentsSpecifications");
PvlGroup idealGp = obSpecs.findGroup(groupName);
double transx, transy, transl, transs;
transx = transy = transl = transs = 0.;
if(idealGp.hasKeyword("TransX")) transx = idealGp["TransX"];
if(idealGp.hasKeyword("TransY")) transy = idealGp["TransY"];
if(idealGp.hasKeyword("ItransL")) transl = idealGp["ItransL"];
if(idealGp.hasKeyword("ItransS")) transs = idealGp["ItransS"];
int detectorSamples = mcube->sampleCount();
if(idealGp.hasKeyword("DetectorSamples")) detectorSamples = idealGp["DetectorSamples"];
int numberLines = mcube->lineCount();
int numberBands = mcube->bandCount();
if(idealGp.hasKeyword("DetectorLines")) numberLines = idealGp["DetectorLines"];
int xDepend = incam->FocalPlaneMap()->FocalPlaneXDependency();
// Get output summing mode
if(ui.GetString("SOURCE") == "FROMMATCH") {
LoadMatchSummingMode();
}
else if(ui.GetString("SOURCE") == "FROMINPUT") {
LoadInputSummingMode();
}
double pixPitch = incam->PixelPitch() * ui.GetDouble("SUMMINGMODE");
detectorSamples /= (int)(ui.GetDouble("SUMMINGMODE"));
// Get the user options
int sampleExpansion = int((ui.GetDouble("SAMPEXP") / 100.) * detectorSamples + .5);
int lineExpansion = int((ui.GetDouble("LINEEXP") / 100.) * numberLines + .5);
QString instType;
// Adjust translations for summing mode
transl /= ui.GetDouble("SUMMINGMODE");
transs /= ui.GetDouble("SUMMINGMODE");
detectorSamples += sampleExpansion;
numberLines += lineExpansion;
// Determine whether this ideal camera is a line scan or framing camera and
// set the instrument id and exposure
int detectorLines;
int expandFlag;
if(incam->DetectorMap()->LineRate() != 0.0) {
instType = "LINESCAN";
// Isis3 line rate is always in seconds so convert to milliseconds for the
// Ideal instrument
detectorLines = 1;
expandFlag = 1;
}
else {
instType = "FRAMING";
detectorLines = numberLines;
expandFlag = 0;
// Framing cameras don't need exposure time
}
//.........这里部分代码省略.........
示例6: GroundRange
/**
* Find the lat/lon range of the image. This will use the image footprint,
* camera, or projection in order to find a good result.
*
* @param Cube* This is required for estimation. You can pass in NULL (it will
* disable estimation).
* @param minLat This is an output: minimum latitude
* @param maxLat This is an output: maximum latitude
* @param minLon This is an output: minimum longitude
* @param maxLon This is an output: maximum longitude
* @param allowEstimation If this is true then extra efforts will be made to
* guess the ground range of the input. This can still fail.
* @return True if a ground range was found, false if no ground range could
* be determined. Some lat/lon results may still be populated; their
* values are undefined.
*/
bool UniversalGroundMap::GroundRange(Cube *cube, Latitude &minLat,
Latitude &maxLat, Longitude &minLon, Longitude &maxLon,
bool allowEstimation) {
// Do we need a RingRange method?
// For now just return false
if (HasCamera())
if (p_camera->target()->shape()->name() == "Plane") return false;
if (HasProjection())
if (p_projection->projectionType() == Projection::RingPlane) return false;
minLat = Latitude();
maxLat = Latitude();
minLon = Longitude();
maxLon = Longitude();
// If we have a footprint, use it
try {
if (cube) {
ImagePolygon poly;
cube->read(poly);
geos::geom::MultiPolygon *footprint = PolygonTools::MakeMultiPolygon(
poly.Polys()->clone());
geos::geom::Geometry *envelope = footprint->getEnvelope();
geos::geom::CoordinateSequence *coords = envelope->getCoordinates();
for (unsigned int i = 0; i < coords->getSize(); i++) {
const geos::geom::Coordinate &coord = coords->getAt(i);
Latitude coordLat(coord.y, Angle::Degrees);
Longitude coordLon(coord.x, Angle::Degrees);
if (!minLat.isValid() || minLat > coordLat)
minLat = coordLat;
if (!maxLat.isValid() || maxLat < coordLat)
maxLat = coordLat;
if (!minLon.isValid() || minLon > coordLon)
minLon = coordLon;
if (!maxLon.isValid() || maxLon < coordLon)
maxLon = coordLon;
}
delete coords;
coords = NULL;
delete envelope;
envelope = NULL;
delete footprint;
footprint = NULL;
}
}
catch (IException &) {
}
if (!minLat.isValid() || !maxLat.isValid() ||
!minLon.isValid() || !maxLon.isValid()) {
if (HasCamera()) {
// Footprint failed, ask the camera
PvlGroup mappingGrp("Mapping");
mappingGrp += PvlKeyword("LatitudeType", "Planetocentric");
mappingGrp += PvlKeyword("LongitudeDomain", "360");
mappingGrp += PvlKeyword("LongitudeDirection", "PositiveEast");
Pvl mappingPvl;
mappingPvl += mappingGrp;
double minLatDouble;
double maxLatDouble;
double minLonDouble;
double maxLonDouble;
p_camera->GroundRange(
minLatDouble, maxLatDouble,
minLonDouble, maxLonDouble, mappingPvl);
minLat = Latitude(minLatDouble, Angle::Degrees);
maxLat = Latitude(maxLatDouble, Angle::Degrees);
minLon = Longitude(minLonDouble, Angle::Degrees);
maxLon = Longitude(maxLonDouble, Angle::Degrees);
}
else if (HasProjection()) {
// Footprint failed, look in the mapping group
PvlGroup mappingGrp = p_projection->Mapping();
if (mappingGrp.hasKeyword("MinimumLatitude") &&
mappingGrp.hasKeyword("MaximumLatitude") &&
//.........这里部分代码省略.........
示例7: IsisMain
void IsisMain() {
// We will be warping a cube
ProcessRubberSheet p;
// Get the map projection file provided by the user
UserInterface &ui = Application::GetUserInterface();
Pvl userPvl(ui.GetFileName("MAP"));
PvlGroup &userMappingGrp = userPvl.findGroup("Mapping", Pvl::Traverse);
// Open the input cube and get the projection
Cube *icube = p.SetInputCube("FROM");
// Get the mapping group
PvlGroup fromMappingGrp = icube->group("Mapping");
TProjection *inproj = (TProjection *) icube->projection();
PvlGroup outMappingGrp = fromMappingGrp;
// If the default range is FROM, then wipe out any range data in user mapping file
if(ui.GetString("DEFAULTRANGE").compare("FROM") == 0 && !ui.GetBoolean("MATCHMAP")) {
if(userMappingGrp.hasKeyword("MinimumLatitude")) {
userMappingGrp.deleteKeyword("MinimumLatitude");
}
if(userMappingGrp.hasKeyword("MaximumLatitude")) {
userMappingGrp.deleteKeyword("MaximumLatitude");
}
if(userMappingGrp.hasKeyword("MinimumLongitude")) {
userMappingGrp.deleteKeyword("MinimumLongitude");
}
if(userMappingGrp.hasKeyword("MaximumLongitude")) {
userMappingGrp.deleteKeyword("MaximumLongitude");
}
}
// Deal with user overrides entered in the GUI. Do this by changing the user's mapping group, which
// will then overlay anything in the output mapping group.
if(ui.WasEntered("MINLAT") && !ui.GetBoolean("MATCHMAP")) {
userMappingGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(ui.GetDouble("MINLAT"))), Pvl::Replace);
}
if(ui.WasEntered("MAXLAT") && !ui.GetBoolean("MATCHMAP")) {
userMappingGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(ui.GetDouble("MAXLAT"))), Pvl::Replace);
}
if(ui.WasEntered("MINLON") && !ui.GetBoolean("MATCHMAP")) {
userMappingGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("MINLON"))), Pvl::Replace);
}
if(ui.WasEntered("MAXLON") && !ui.GetBoolean("MATCHMAP")) {
userMappingGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("MAXLON"))), Pvl::Replace);
}
/**
* If the user is changing from positive east to positive west, or vice-versa, the output minimum is really
* the input maximum. However, the user mapping group must be left unaffected (an input minimum must be the
* output minimum). To accomplish this, we swap the minimums/maximums in the output group ahead of time. This
* causes the minimums and maximums to correlate to the output minimums and maximums. That way when we copy
* the user mapping group into the output group a mimimum overrides a minimum and a maximum overrides a maximum.
*/
bool sameDirection = true;
if(userMappingGrp.hasKeyword("LongitudeDirection")) {
if(((QString)userMappingGrp["LongitudeDirection"]).compare(fromMappingGrp["LongitudeDirection"]) != 0) {
sameDirection = false;
}
}
// Since the out mapping group came from the from mapping group, which came from a valid cube,
// we can assume both min/max lon exists if min longitude exists.
if(!sameDirection && outMappingGrp.hasKeyword("MinimumLongitude")) {
double minLon = outMappingGrp["MinimumLongitude"];
double maxLon = outMappingGrp["MaximumLongitude"];
outMappingGrp["MaximumLongitude"] = toString(minLon);
outMappingGrp["MinimumLongitude"] = toString(maxLon);
}
if(ui.GetString("PIXRES").compare("FROM") == 0 && !ui.GetBoolean("MATCHMAP")) {
// Resolution will be in fromMappingGrp and outMappingGrp at this time
// delete from user mapping grp
if(userMappingGrp.hasKeyword("Scale")) {
userMappingGrp.deleteKeyword("Scale");
}
if(userMappingGrp.hasKeyword("PixelResolution")) {
userMappingGrp.deleteKeyword("PixelResolution");
}
}
else if(ui.GetString("PIXRES").compare("MAP") == 0 || ui.GetBoolean("MATCHMAP")) {
// Resolution will be in userMappingGrp - delete all others
if(outMappingGrp.hasKeyword("Scale")) {
outMappingGrp.deleteKeyword("Scale");
}
if(outMappingGrp.hasKeyword("PixelResolution")) {
outMappingGrp.deleteKeyword("PixelResolution");
}
if(fromMappingGrp.hasKeyword("Scale"));
//.........这里部分代码省略.........
示例8: IException
/**
* Set the output cube to specified file name and specified input images
* and output attributes and lat,lons
*/
Isis::Cube *ProcessMapMosaic::SetOutputCube(FileList &propagationCubes,
double slat, double elat, double slon, double elon,
CubeAttributeOutput &oAtt, const QString &mosaicFile) {
if (propagationCubes.size() < 1) {
QString msg = "The list does not contain any data";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
int samples, lines, bands = 0;
Pvl label;
label.read(propagationCubes[0].toString());
PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse);
mGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace);
mGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace);
mGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace);
mGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace);
if (mGroup.hasKeyword("UpperLeftCornerX"))
mGroup.deleteKeyword("UpperLeftCornerX");
if (mGroup.hasKeyword("UpperLeftCornerY"))
mGroup.deleteKeyword("UpperLeftCornerY");
Pvl mapPvl;
mapPvl += mGroup;
// Use CreateForCube because our range differs from any of the cubes (manually specified)
Projection *proj = Isis::ProjectionFactory::CreateForCube(mapPvl, samples, lines, false);
double xmin, xmax, ymin, ymax;
proj->XYRange(xmin, xmax, ymin, ymax);
// The xmin/ymax should be rounded for the labels
xmin = mapPvl.findGroup("Mapping")["UpperLeftCornerX"];
ymax = mapPvl.findGroup("Mapping")["UpperLeftCornerY"];
for (int i = 0; i < propagationCubes.size(); i++) {
Cube cube;
cube.open(propagationCubes[i].toString());
bands = max(cube.bandCount(), bands);
// See if the cube has a projection and make sure it matches
// previous input cubes
Projection *projNew =
Isis::ProjectionFactory::CreateFromCube(*(cube.label()));
if (proj == NULL) {
}
else if (*proj != *projNew) {
QString msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString() +
"] and [" + propagationCubes[0].toString() + "]";
throw IException(IException::User, msg, _FILEINFO_);
}
if (proj) delete proj;
proj = projNew;
}
if (proj) delete proj;
return SetOutputCube(propagationCubes[0].toString(), xmin, xmax, ymin, ymax,
slat, elat, slon, elon, bands, oAtt, mosaicFile);
}
示例9: IsisMain
void IsisMain() {
// Get the list of cubes to mosaic
UserInterface &ui = Application::GetUserInterface();
FileList flist(ui.GetFileName("FROMLIST"));
vector<Cube *> clist;
try {
if(flist.size() < 1) {
QString msg = "the list file [" + ui.GetFileName("FROMLIST") +
"does not contain any data";
throw IException(IException::User, msg, _FILEINFO_);
}
// open all the cube and place in vector clist
for(int i = 0; i < flist.size(); i++) {
Cube *c = new Cube();
clist.push_back(c);
c->open(flist[i].toString());
}
// run the compair function here. This will conpair the
// labels of the first cube to the labels of each following cube.
PvlKeyword sourceProductId("SourceProductId");
QString ProdId;
for(int i = 0; i < (int)clist.size(); i++) {
Pvl *pmatch = clist[0]->label();
Pvl *pcomp = clist[i]->label();
CompareLabels(*pmatch, *pcomp);
PvlGroup g = pcomp->findGroup("Instrument", Pvl::Traverse);
if(g.hasKeyword("StitchedProductIds")) {
PvlKeyword k = g["StitchedProductIds"];
for(int j = 0; j < (int)k.size(); j++) {
sourceProductId += g["stitchedProductIds"][j];
}
}
ProdId = (QString)pmatch->findGroup("Archive", Pvl::Traverse)["ObservationId"];
QString bandname = (QString)pmatch->findGroup("BandBin", Pvl::Traverse)["Name"];
bandname = bandname.toUpper();
ProdId = ProdId + "_" + bandname;
}
bool runXY = true;
//calculate the min and max lon
double minLat = DBL_MAX;
double maxLat = -DBL_MAX;
double minLon = DBL_MAX;
double maxLon = -DBL_MAX;
double avgLat;
double avgLon;
for(int i = 0; i < (int)clist.size(); i++) {
TProjection *proj = (TProjection *) clist[i]->projection();
if(proj->MinimumLatitude() < minLat) minLat = proj->MinimumLatitude();
if(proj->MaximumLatitude() > maxLat) maxLat = proj->MaximumLatitude();
if(proj->MinimumLongitude() < minLon) minLon = proj->MinimumLongitude();
if(proj->MaximumLongitude() > maxLon) maxLon = proj->MaximumLongitude();
}
avgLat = (minLat + maxLat) / 2;
avgLon = (minLon + maxLon) / 2;
TProjection *proj = (TProjection *) clist[0]->projection();
proj->SetGround(avgLat, avgLon);
avgLat = proj->UniversalLatitude();
avgLon = proj->UniversalLongitude();
// Use camera class to get Inc., emi., phase, and other values
double Cemiss;
double Cphase;
double Cincid;
double ClocalSolTime;
double CsolarLong;
double CsunAzimuth;
double CnorthAzimuth;
for(int i = 0; i < (int)clist.size(); i++) {
Camera *cam = clist[i]->camera();
if(cam->SetUniversalGround(avgLat, avgLon)) {
Cemiss = cam->EmissionAngle();
Cphase = cam->PhaseAngle();
Cincid = cam->IncidenceAngle();
ClocalSolTime = cam->LocalSolarTime();
CsolarLong = cam->solarLongitude().degrees();
CsunAzimuth = cam->SunAzimuth();
CnorthAzimuth = cam->NorthAzimuth();
runXY = false;
break;
}
}
//The code within the if runXY was added in 10/07 to find an intersect with
//pole images that would fail when using projection set universal ground.
// This is run if no intersect is found when using lat and lon in
// projection space.
if(runXY) {
double startX = DBL_MAX;
double endX = DBL_MIN;
double startY = DBL_MAX;
//.........这里部分代码省略.........
示例10: IsisMain
//.........这里部分代码省略.........
polyLinc = (int)(0.5 + 0.10 * incube->lineCount());
if(polyLinc == 0) polyLinc = 1;
}
}
else {
QString msg = "Invalid INCTYPE option[" + incType + "]";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
bandGeom = new BandGeometry();
bandGeom->setSampleInc(polySinc);
bandGeom->setLineInc(polyLinc);
bandGeom->setMaxIncidence(ui.GetDouble("MAXINCIDENCE"));
bandGeom->setMaxEmission(ui.GetDouble("MAXEMISSION"));
bool precision = ui.GetBoolean("INCREASEPRECISION");
if (getFootBlob) {
// Need to read history to obtain parameters that were used to
// create the footprint
History hist("IsisCube", in.expanded());
Pvl pvl = hist.ReturnHist();
PvlObject::PvlObjectIterator objIter;
bool found = false;
PvlGroup fpgrp;
for (objIter=pvl.endObject()-1; objIter>=pvl.beginObject(); objIter--) {
if (objIter->name().toUpper() == "FOOTPRINTINIT") {
found = true;
fpgrp = objIter->findGroup("UserParameters");
break;
}
}
if (!found) {
QString msg = "Footprint blob was not found in input image history";
throw IException(IException::User, msg, _FILEINFO_);
}
QString prec = (QString)fpgrp.findKeyword("INCREASEPRECISION");
prec = prec.toUpper();
if (prec == "TRUE") {
precision = true;
}
else {
precision = false;
}
QString inctype = (QString)fpgrp.findKeyword("INCTYPE");
inctype = inctype.toUpper();
if (inctype == "LINCSINC") {
int linc = fpgrp.findKeyword("LINC");
int sinc = fpgrp.findKeyword("SINC");
bandGeom->setSampleInc(sinc);
bandGeom->setLineInc(linc);
}
else {
int vertices = fpgrp.findKeyword("NUMVERTICES");
int lincsinc = (int)(0.5 + (((incube->sampleCount() * 2) +
(incube->lineCount() * 2) - 3.0) /
vertices));
bandGeom->setSampleInc(lincsinc);
bandGeom->setLineInc(lincsinc);
}
if (fpgrp.hasKeyword("MAXINCIDENCE")) {
double maxinc = fpgrp.findKeyword("MAXINCIDENCE");
bandGeom->setMaxIncidence(maxinc);
}
if (fpgrp.hasKeyword("MAXEMISSION")) {
double maxema = fpgrp.findKeyword("MAXEMISSION");
bandGeom->setMaxEmission(maxema);
}
}
bandGeom->collect(*cam, *incube, doGeometry, doPolygon, getFootBlob, precision);
// Check if the user requires valid image center geometry
if(ui.GetBoolean("VCAMERA") && (!bandGeom->hasCenterGeometry())) {
QString msg = "Image center does not project in camera model";
throw IException(IException::Unknown, msg, _FILEINFO_);
}
}
if(sFormat.toUpper() == "PVL")
GeneratePVLOutput(incube, general, camstats, statistics, bandGeom);
else
GenerateCSVOutput(incube, general, camstats, statistics, bandGeom);
// Clean the data
delete general;
general = NULL;
if(camstats) {
delete camstats;
camstats = NULL;
}
if(statistics) {
delete statistics;
statistics = NULL;
}
if(bandGeom) {
delete bandGeom;
bandGeom = NULL;
}
}