本文整理汇总了C++中Progress::SetMaximumSteps方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::SetMaximumSteps方法的具体用法?C++ Progress::SetMaximumSteps怎么用?C++ Progress::SetMaximumSteps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::SetMaximumSteps方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setControlPointLatLon
/**
* Calculates the lat/lon of the ControlNet.
*
* @param incubes The filename of the list of cubes in the ControlNet
* @param cnet The filename of the ControlNet
*/
void setControlPointLatLon(SerialNumberList &snl, ControlNet &cnet) {
CubeManager manager;
manager.SetNumOpenCubes(50); //Should keep memory usage to around 1GB
Progress progress;
progress.SetText("Calculating Lat/Lon");
progress.SetMaximumSteps(cnet.GetNumPoints());
progress.CheckStatus();
for (int cp = 0; cp < cnet.GetNumPoints(); cp++) {
ControlPoint *point = cnet.GetPoint(cp);
ControlMeasure *cm = point->GetRefMeasure();
Cube *cube = manager.OpenCube(snl.FileName(cm->GetCubeSerialNumber()));
try {
cube->camera()->SetImage(cm->GetSample(), cm->GetLine());
g_surfacePoints[point->GetId()] = cube->camera()->GetSurfacePoint();
}
catch (IException &e) {
QString msg = "Unable to create camera for cube file [";
msg += snl.FileName(cm->GetCubeSerialNumber()) + "]";
throw IException(e, IException::Unknown, msg, _FILEINFO_);
}
cube = NULL; //Do not delete, manager still has ownership
progress.CheckStatus();
}
manager.CleanCubes();
}
示例2: CheckFramelets
/**
* This method performs pass1 on one image. It analyzes each framelet's
* statistics and populates the necessary global variable.
*
* @param progress Progress message
* @param theCube Current cube that needs processing
*
* @return bool True if the file contains a valid framelet
*/
bool CheckFramelets(string progress, Cube &theCube) {
bool foundValidFramelet = false;
LineManager mgr(theCube);
Progress prog;
prog.SetText(progress);
prog.SetMaximumSteps(theCube.Lines());
prog.CheckStatus();
vector<double> frameletAvgs;
// We need to store off the framelet information, because if no good
// framelets were found then no data should be added to the
// global variable for framelets, just files.
vector< pair<int,double> > excludedFrameletsTmp;
Statistics frameletStats;
for(int line = 1; line <= theCube.Lines(); line++) {
if((line-1) % numFrameLines == 0) {
frameletStats.Reset();
}
mgr.SetLine(line);
theCube.Read(mgr);
frameletStats.AddData(mgr.DoubleBuffer(), mgr.size());
if((line-1) % numFrameLines == numFrameLines-1) {
if(IsSpecial(frameletStats.StandardDeviation()) ||
frameletStats.StandardDeviation() > maxStdev) {
excludedFrameletsTmp.push_back(
pair<int,double>((line-1)/numFrameLines, frameletStats.StandardDeviation())
);
}
else {
foundValidFramelet = true;
}
frameletAvgs.push_back(frameletStats.Average());
}
prog.CheckStatus();
}
inputFrameletAverages.push_back(frameletAvgs);
if(foundValidFramelet) {
for(unsigned int i = 0; i < excludedFrameletsTmp.size(); i++) {
excludedFramelets.insert(pair< pair<int,int>, double>(
pair<int,int>(currImage, excludedFrameletsTmp[i].first),
excludedFrameletsTmp[i].second
)
);
}
}
return foundValidFramelet;
}
示例3: WriteCubeOutList
/**
* Finds and writes all input cubes contained within the given Control Network
* to the output file list
*
* @param cnet The Control Network to list the filenames contained within
* @param sn2file The map for converting the Control Network's serial numbers
* to filenames
*/
void WriteCubeOutList( ControlNet cnet, map<iString,iString> sn2file ) {
UserInterface &ui = Application::GetUserInterface();
if( ui.WasEntered("TOLIST") ) {
Progress p;
p.SetText("Writing Cube List");
try {
p.SetMaximumSteps(cnet.Size());
p.CheckStatus();
} catch( iException &e ) {
e.Clear();
string msg = "The provided filters have resulted in an empty Control Network.";
throw Isis::iException::Message(Isis::iException::User,msg, _FILEINFO_);
}
set<iString> outputsn;
for( int cp = 0; cp < cnet.Size(); cp ++ ) {
for( int cm = 0; cm < cnet[cp].Size(); cm ++ ) {
outputsn.insert( cnet[cp][cm].CubeSerialNumber() );
}
p.CheckStatus();
}
std::string toList = ui.GetFilename("TOLIST");
ofstream out_stream;
out_stream.open(toList.c_str(), std::ios::out);
out_stream.seekp(0,std::ios::beg); //Start writing from beginning of file
for( set<iString>::iterator sn = outputsn.begin(); sn != outputsn.end(); sn ++ ) {
if( !sn2file[(*sn)].empty() ) {
out_stream << sn2file[(*sn)] << endl;
}
}
out_stream.close();
}
}
示例4: IsisMain
//.........这里部分代码省略.........
double fsamps(fcorns.lowerRight.sample - fcorns.topLeft.sample + 1.0);
// We want to create a grid of control points that is N rows by M columns.
// Get row and column variables, if not entered, default to 1% of the input
// image size
int rows(1), cols(1);
if (ui.WasEntered("ROWS")) {
rows = ui.GetInteger("ROWS");
}
else {
rows = (int)(((flines - 1.0) / ar->SearchChip()->Lines()) + 1);
}
cols = ui.GetInteger("COLUMNS");
if (cols == 0) {
cols = (int)(((fsamps - 1.0) / ar->SearchChip()->Samples()) + 1);
}
// Calculate spacing for the grid of points
double lSpacing = floor(flines / rows);
double sSpacing = floor(fsamps / cols);
#if defined(ISIS_DEBUG)
cout << "# Samples in Overlap: " << fsamps << endl;
cout << "# Lines in Overlap : " << flines << endl;
cout << "# Rows: " << rows << endl;
cout << "# Columns: " << cols << endl;
cout << "Line Spacing: " << lSpacing << endl;
cout << "Sample Spacing: " << sSpacing << endl;
#endif
// Display the progress...10% 20% etc.
Progress prog;
prog.SetMaximumSteps(rows * cols);
prog.CheckStatus();
// Initialize control point network
ControlNet cn;
cn.SetType(ControlNet::ImageToImage);
cn.SetUserName(Application::UserName());
cn.SetCreatedDate(iTime::CurrentLocalTime());
// Get serial numbers for input cubes
string transSN = SerialNumber::Compose(trans, true);
string matchSN = SerialNumber::Compose(match, true);
cn.SetTarget(transSN);
cn.SetDescription("Records s/c jitter between two adjacent HiRISE images");
// Set up results parameter saves
JitterParms jparms;
jparms.fromCorns = fcorns;
jparms.fromJit = trans.GetInfo();
jparms.matchCorns = mcorns;
jparms.matchJit = match.GetInfo();
jparms.regFile = regFile.Expanded();
jparms.cols = cols;
jparms.rows = rows;
jparms.lSpacing = lSpacing;
jparms.sSpacing = sSpacing;
jparms.nSuspects = 0;
// Loop through grid of points and get statistics to compute
// translation values
RegList reglist;
double fline0(fcorns.topLeft.line-1.0), fsamp0(fcorns.topLeft.sample-1.0);
示例5: IsisMain
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
Cube cube;
cube.open(ui.GetFileName("FROM"), "rw");
// Make sure cube has been run through spiceinit
try {
cube.camera();
}
catch(IException &e) {
string msg = "Spiceinit must be run before initializing the polygon";
throw IException(e, IException::User, msg, _FILEINFO_);
}
Progress prog;
prog.SetMaximumSteps(1);
prog.CheckStatus();
QString sn = SerialNumber::Compose(cube);
ImagePolygon poly;
if(ui.WasEntered("MAXEMISSION")) {
poly.Emission(ui.GetDouble("MAXEMISSION"));
}
if(ui.WasEntered("MAXINCIDENCE")) {
poly.Incidence(ui.GetDouble("MAXINCIDENCE"));
}
if(ui.GetString("LIMBTEST") == "ELLIPSOID") {
poly.EllipsoidLimb(true);
}
int sinc = 1;
int linc = 1;
IString incType = ui.GetString("INCTYPE");
if(incType.UpCase() == "VERTICES") {
poly.initCube(cube);
sinc = linc = (int)(0.5 + (((poly.validSampleDim() * 2) +
(poly.validLineDim() * 2) - 3.0) /
ui.GetInteger("NUMVERTICES")));
if (sinc < 1.0 || linc < 1.0)
sinc = linc = 1.0;
}
else if (incType.UpCase() == "LINCSINC"){
sinc = ui.GetInteger("SINC");
linc = ui.GetInteger("LINC");
}
else {
string msg = "Invalid INCTYPE option[" + incType + "]";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
bool precision = ui.GetBoolean("INCREASEPRECISION");
try {
poly.Create(cube, sinc, linc, 1, 1, 0, 0, 1, precision);
}
catch (IException &e) {
QString msg = "Cannot generate polygon for [" + ui.GetFileName("FROM") + "]";
throw IException(e, IException::User, msg, _FILEINFO_);
}
if(ui.GetBoolean("TESTXY")) {
Pvl cubeLab(ui.GetFileName("FROM"));
PvlGroup inst = cubeLab.findGroup("Instrument", Pvl::Traverse);
QString target = inst["TargetName"];
PvlGroup radii = Projection::TargetRadii(target);
Pvl map(ui.GetFileName("MAP"));
PvlGroup &mapping = map.findGroup("MAPPING");
if(!mapping.hasKeyword("TargetName"))
mapping += Isis::PvlKeyword("TargetName", target);
if(!mapping.hasKeyword("EquatorialRadius"))
mapping += Isis::PvlKeyword("EquatorialRadius", (QString)radii["EquatorialRadius"]);
if(!mapping.hasKeyword("PolarRadius"))
mapping += Isis::PvlKeyword("PolarRadius", (QString)radii["PolarRadius"]);
if(!mapping.hasKeyword("LatitudeType"))
mapping += Isis::PvlKeyword("LatitudeType", "Planetocentric");
if(!mapping.hasKeyword("LongitudeDirection"))
mapping += Isis::PvlKeyword("LongitudeDirection", "PositiveEast");
if(!mapping.hasKeyword("LongitudeDomain"))
mapping += Isis::PvlKeyword("LongitudeDomain", "360");
if(!mapping.hasKeyword("CenterLatitude"))
mapping += Isis::PvlKeyword("CenterLatitude", "0");
if(!mapping.hasKeyword("CenterLongitude"))
mapping += Isis::PvlKeyword("CenterLongitude", "0");
sinc = poly.getSinc();
linc = poly.getLinc();
bool polygonGenerated = false;
while (!polygonGenerated) {
Projection *proj = NULL;
geos::geom::MultiPolygon *xyPoly = NULL;
try {
proj = ProjectionFactory::Create(map, true);
xyPoly = PolygonTools::LatLonToXY(*poly.Polys(), proj);
polygonGenerated = true;
}
catch (IException &e) {
//.........这里部分代码省略.........
示例6: IsisMain
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
FileList addList(ui.GetFileName("ADDLIST"));
bool log = false;
FileName logFile;
if (ui.WasEntered("LOG")) {
log = true;
logFile = ui.GetFileName("LOG");
}
Pvl results;
results.setName("cnetadd_Results");
PvlKeyword added("FilesAdded");
PvlKeyword omitted("FilesOmitted");
PvlKeyword pointsModified("PointsModified");
bool checkMeasureValidity = ui.WasEntered("DEFFILE");
ControlNetValidMeasure validator;
if (checkMeasureValidity) {
Pvl deffile(ui.GetFileName("DEFFILE"));
validator = ControlNetValidMeasure(deffile);
}
SerialNumberList *fromSerials = ui.WasEntered("FROMLIST") ?
new SerialNumberList(ui.GetFileName("FROMLIST")) : new SerialNumberList();
ControlNet inNet = ControlNet(ui.GetFileName("CNET"));
inNet.SetUserName(Application::UserName());
inNet.SetModifiedDate(iTime::CurrentLocalTime()); //This should be done in ControlNet's Write fn
QString retrievalOpt = ui.GetString("RETRIEVAL");
PvlKeyword duplicates("DupSerialNumbers");
if (retrievalOpt == "REFERENCE") {
FileList list1(ui.GetFileName("FROMLIST"));
SerialNumberList addSerials(ui.GetFileName("ADDLIST"));
//Check for duplicate files in the lists by serial number
for (int i = 0; i < addSerials.Size(); i++) {
// Check for duplicate SNs accross the lists
if (fromSerials->HasSerialNumber(addSerials.SerialNumber(i))) {
duplicates.addValue(addSerials.FileName(i));
}
// Check for duplicate SNs within the addlist
for (int j = i + 1; j < addSerials.Size(); j++) {
if (addSerials.SerialNumber(i) == addSerials.SerialNumber(j)) {
QString msg = "Add list files [" + addSerials.FileName(i) + "] and [";
msg += addSerials.FileName(j) + "] share the same serial number.";
throw IException(IException::User, msg, _FILEINFO_);
}
}
}
// Get the lat/long coords from the existing reference measure
setControlPointLatLon(*fromSerials, inNet);
}
else {
for (int cp = 0; cp < inNet.GetNumPoints(); cp++) {
// Get the surface point from the current control point
ControlPoint *point = inNet.GetPoint(cp);
SurfacePoint surfacePoint = point->GetBestSurfacePoint();
if (!surfacePoint.Valid()) {
QString msg = "Unable to retreive lat/lon from Control Point [";
msg += point->GetId() + "]. RETREIVAL=POINT cannot be used unless ";
msg += "all Control Points have Latitude/Longitude keywords.";
throw IException(IException::User, msg, _FILEINFO_);
}
g_surfacePoints[point->GetId()] = surfacePoint;
}
}
FileName outNetFile(ui.GetFileName("ONET"));
Progress progress;
progress.SetText("Adding Images");
progress.SetMaximumSteps(addList.size());
progress.CheckStatus();
STRtree coordTree;
QList<ControlPoint *> pointList;
bool usePolygon = ui.GetBoolean("POLYGON");
if (usePolygon) {
for (int cp = 0; cp < inNet.GetNumPoints(); cp++) {
ControlPoint *point = inNet.GetPoint(cp);
SurfacePoint surfacePoint = g_surfacePoints[point->GetId()];
Longitude lon = surfacePoint.GetLongitude();
Latitude lat = surfacePoint.GetLatitude();
Coordinate *coord = new Coordinate(lon.degrees(), lat.degrees());
Envelope *envelope = new Envelope(*coord);
coordTree.insert(envelope, point);
}
}
else {
//.........这里部分代码省略.........
示例7: IsisMain
void IsisMain() {
// Get user interface
UserInterface &ui = Application::GetUserInterface();
// Get necessary variables from the user
double latStart = ui.GetDouble("STARTLAT");
double lonStart = ui.GetDouble("STARTLON");
double latEnd = ui.GetDouble("ENDLAT");
double lonEnd = ui.GetDouble("ENDLON");
double latSpacing = ui.GetDouble("LATSPACING");
double lonSpacing = ui.GetDouble("LONSPACING");
double latInc = ui.GetDouble("LATINCREMENT");
double lonInc = ui.GetDouble("LONINCREMENT");
// Get mapfile, add values for range and create projection
QString mapFile = ui.GetFileName("MAPFILE");
Pvl p(mapFile);
PvlGroup &mapping = p.findGroup("Mapping", Pvl::Traverse);
if(mapping.hasKeyword("MinimumLatitude")) {
mapping.deleteKeyword("MinimumLatitude");
}
if(mapping.hasKeyword("MaximumLatitude")) {
mapping.deleteKeyword("MaximumLatitude");
}
if(mapping.hasKeyword("MinimumLongitude")) {
mapping.deleteKeyword("MinimumLongitude");
}
if(mapping.hasKeyword("MaximumLongitude")) {
mapping.deleteKeyword("MaximumLongitude");
}
mapping += PvlKeyword("MinimumLatitude", toString(latStart));
mapping += PvlKeyword("MaximumLatitude", toString(latEnd));
mapping += PvlKeyword("MinimumLongitude", toString(lonStart));
mapping += PvlKeyword("MaximumLongitude", toString(lonEnd));
TProjection *proj;
try {
proj = (TProjection *) ProjectionFactory::Create(p);
}
catch(IException &e) {
QString msg = "Cannot create grid - MapFile [" + mapFile +
"] does not contain necessary information to create a projection";
throw IException(e, IException::User, msg, _FILEINFO_);
}
// Write grid to well known text output
QString out = FileName(ui.GetFileName("TO")).expanded();
std::ofstream os;
os.open(out.toAscii().data(), std::ios::out);
// Display the progress...10% 20% etc.
Progress prog;
int steps = (int)(abs((latEnd - latStart) / latSpacing) +
abs((lonEnd - lonStart) / lonSpacing) + 0.5) + 3;
prog.SetMaximumSteps(steps);
prog.CheckStatus();
/**
* Initialize document. GML is XML-based, so we need the necessary XML headers. These
* are necessary for the GML file to be recognized.
*/
os << "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" << endl;
os << "<ogr:FeatureCollection " << endl <<
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" << endl <<
"xsi:schemaLocation=\"http://org.maptools.org/\"" << endl <<
"xmlns:ogr=\"http://org.maptools.org/\"" << endl <<
"xmlns:gml=\"http://www.opengis.net/gml\">" << endl;
/**
* Draw the interior longitude lines by looping through the longitude
* range and drawing across each latitude line using the longitude increment. The first
* and last line will be skipped for now.
*/
for(double j = lonStart + lonSpacing; j < lonEnd; j += lonSpacing) {
StartNewLine(os);
for(double k = latStart; k <= latEnd; k += lonInc) {
proj->SetGround(k, j);
AddPointToLine(os, proj->XCoord(), proj->YCoord());
}
EndLine(os);
prog.CheckStatus();
}
/**
* Draw the exterior longitude boundary lines. This happens by drawing just the first and
* last longitude lines.
*/
for(double r = lonStart; r <= lonEnd; r += (lonEnd - lonStart)) {
StartNewLine(os);
for(double s = latStart; s <= latEnd; s += lonInc) {
proj->SetGround(s, r);
AddPointToLine(os, proj->XCoord(), proj->YCoord());
}
//.........这里部分代码省略.........
示例8: Message
/**
* Constructs an OverlapStatistics object. Compares the two input cubes and
* finds where they overlap.
*
* @param x The first input cube
* @param y The second input cube
* @param progressMsg (Default value of "Gathering Overlap Statistics") Text
* for indicating progress during statistic gathering
* @param sampPercent (Default value of 100.0) Sampling percent, or the percentage
* of lines to consider during the statistic gathering procedure
*
* @throws Isis::iException::User - All images must have the same number of
* bands
*/
OverlapStatistics::OverlapStatistics(Isis::Cube &x, Isis::Cube &y,
std::string progressMsg, double sampPercent) {
// Test to ensure sampling percent in bound
if (sampPercent <= 0.0 || sampPercent > 100.0) {
string msg = "The sampling percent must be a decimal (0.0, 100.0]";
throw iException::Message(iException::Programmer,msg,_FILEINFO_);
}
p_sampPercent = sampPercent;
// Extract filenames and band number from cubes
p_xFile = x.Filename();
p_yFile = y.Filename();
// Make sure number of bands match
if (x.Bands() != y.Bands()) {
string msg = "Number of bands do not match between cubes [" +
p_xFile.Name() + "] and [" + p_yFile.Name() + "]";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
p_bands = x.Bands();
p_stats.resize(p_bands);
//Create projection from each cube
Projection *projX = x.Projection();
Projection *projY = y.Projection();
// Test to make sure projection parameters match
if (*projX != *projY) {
string msg = "Mapping groups do not match between cubes [" +
p_xFile.Name() + "] and [" + p_yFile.Name() + "]";
throw iException::Message(iException::Programmer,msg,_FILEINFO_);
}
// Figure out the x/y range for both images to find the overlap
double Xmin1 = projX->ToProjectionX(0.5);
double Ymax1 = projX->ToProjectionY(0.5);
double Xmax1 = projX->ToProjectionX(x.Samples()+0.5);
double Ymin1 = projX->ToProjectionY(x.Lines()+0.5);
double Xmin2 = projY->ToProjectionX(0.5);
double Ymax2 = projY->ToProjectionY(0.5);
double Xmax2 = projY->ToProjectionX(y.Samples()+0.5);
double Ymin2 = projY->ToProjectionY(y.Lines()+0.5);
// Find overlap
if ((Xmin1<Xmax2) && (Xmax1>Xmin2) && (Ymin1<Ymax2) && (Ymax1>Ymin2)) {
double minX = Xmin1 > Xmin2 ? Xmin1 : Xmin2;
double minY = Ymin1 > Ymin2 ? Ymin1 : Ymin2;
double maxX = Xmax1 < Xmax2 ? Xmax1 : Xmax2;
double maxY = Ymax1 < Ymax2 ? Ymax1 : Ymax2;
// Find Sample range of the overlap
p_minSampX = (int)(projX->ToWorldX(minX) + 0.5);
p_maxSampX = (int)(projX->ToWorldX(maxX) + 0.5);
p_minSampY = (int)(projY->ToWorldX(minX) + 0.5);
p_maxSampY = (int)(projY->ToWorldX(maxX) + 0.5);
p_sampRange = p_maxSampX - p_minSampX + 1;
// Test to see if there was only sub-pixel overlap
if (p_sampRange <= 0) return;
// Find Line range of overlap
p_minLineX = (int)(projX->ToWorldY(maxY) + 0.5);
p_maxLineX = (int)(projX->ToWorldY(minY) + 0.5);
p_minLineY = (int)(projY->ToWorldY(maxY) + 0.5);
p_maxLineY = (int)(projY->ToWorldY(minY) + 0.5);
p_lineRange = p_maxLineX - p_minLineX + 1;
// Print percent processed
Progress progress;
progress.SetText(progressMsg);
int linc = (int)(100.0 / sampPercent + 0.5); // Calculate our line increment
// Define the maximum number of steps to be our line range divided by the
// line increment, but if they do not divide evenly, then because of
// rounding, we need to do an additional step for each band
int maxSteps = (int)(p_lineRange / linc + 0.5);
if (p_lineRange % linc != 0) maxSteps += 1;
maxSteps *= p_bands;
progress.SetMaximumSteps(maxSteps);
progress.CheckStatus();
//.........这里部分代码省略.........
示例9: IsisMain
void IsisMain(){
Process p;
// Reset all the stats objects because they are global
latStat.Reset();
lonStat.Reset();
resStat.Reset();
sampleResStat.Reset();
lineResStat.Reset();
aspectRatioStat.Reset();
phaseStat.Reset();
emissionStat.Reset();
incidenceStat.Reset();
localSolarTimeStat.Reset();
localRaduisStat.Reset();
northAzimuthStat.Reset();
UserInterface &ui = Application::GetUserInterface();
Cube *icube = p.SetInputCube("FROM");
Camera *cam = icube->Camera();
// Cube cube;
// cube.Open(ui.GetFilename("FROM"));
// Camera *cam = cube.Camera();
int eband = cam->Bands();
// if the camera is band independent that only run one band
if (cam->IsBandIndependent()) eband = 1;
int linc = ui.GetInteger("LINC");
int sinc = ui.GetInteger("SINC");
int pTotal = eband * ((cam->Lines()-2) / linc + 2) ;
Progress progress;
progress.SetMaximumSteps(pTotal);
progress.CheckStatus();
for (int band=1; band<=eband; band++) {
cam->SetBand(band);
for (int line=1; line<(int)cam->Lines(); line=line+linc) {
for (int sample=1; sample< cam->Samples(); sample=sample+sinc) {
buildStats(cam, sample, line);
}
//set the sample value to the last sample and run buildstats
int sample = cam->Samples();
buildStats(cam, sample, line);
progress.CheckStatus();
}
//set the line value to the last line and run on all samples(sample + sinc)
int line = cam->Lines();
for (int sample=1; sample< cam->Samples(); sample=sample+sinc) {
buildStats(cam, sample, line);
}
//set last sample and run with last line
int sample = cam->Samples();
buildStats(cam, sample, line);
progress.CheckStatus();
}
//Set up the Pvl groups and get min, max, avg, and sd for each statstics object
PvlGroup pUser("User Parameters");
pUser += PvlKeyword("Filename",ui.GetFilename("FROM"));
pUser += PvlKeyword("Linc",ui.GetInteger("LINC"));
pUser += PvlKeyword("Sinc",ui.GetInteger("SINC"));
PvlGroup pLat("Latitude");
pLat += ValidateKey("LatitudeMinimum",latStat.Minimum());
pLat += ValidateKey("LatitudeMaximum",latStat.Maximum());
pLat += ValidateKey("LatitudeAverage",latStat.Average());
pLat += ValidateKey("LatitudeStandardDeviation",latStat.StandardDeviation());
PvlGroup pLon("Longitude");
pLon += ValidateKey("LongitudeMinimum",lonStat.Minimum());
pLon += ValidateKey("LongitudeMaximum",lonStat.Maximum());
pLon += ValidateKey("LongitudeAverage",lonStat.Average());
pLon += ValidateKey("LongitudeStandardDeviation",lonStat.StandardDeviation());
PvlGroup pSampleRes("SampleResolution");
pSampleRes += ValidateKey("SampleResolutionMinimum",sampleResStat.Minimum(),
"meters/pixel");
pSampleRes += ValidateKey("SampleResolutionMaximum",sampleResStat.Maximum(),
"meters/pixel");
pSampleRes += ValidateKey("SampleResolutionAverage",sampleResStat.Average(),
"meters/pixel");
pSampleRes += ValidateKey("SampleResolutionStandardDeviation",
sampleResStat.StandardDeviation(),"meters/pixel");
PvlGroup pLineRes("LineResolution");
pLineRes += ValidateKey("LineResolutionMinimum",lineResStat.Minimum(),
"meters/pixel");
pLineRes += ValidateKey("LineResolutionMaximum",lineResStat.Maximum(),
"meters/pixel");
pLineRes += ValidateKey("LineResolutionAverage",lineResStat.Average(),
"meters/pixel");
pLineRes += ValidateKey("LineResolutionStandardDeviation",
lineResStat.StandardDeviation(),"meters/pixel");
PvlGroup pResolution("Resolution");
pResolution += ValidateKey("ResolutionMinimum",resStat.Minimum(),
//.........这里部分代码省略.........
示例10: IsisMain
/**
* This is the main method. Makeflat runs in three steps:
*
* 1) Calculate statistics
* - For all cameras, this checks for one band and matching
* sample counts.
* - For framing cameras, this checks the standard deviation of
* the images and records the averages of each image
* - For push frame cameras, this calls CheckFramelets for each
* image.
*
* 2) Create the temporary file, collect more detailed statistics
* - For all cameras, this generates the temporary file and calculates
* the final exclusion list
* - For framing/push frame cameras, the temporary file is
* 2 bands, where the first is a sum of DNs from each image/framelet
* and the second band is a count of valid DNs that went into each sum
*
* 3) Create the final flat field file
* - For all cameras, this processes the temporary file to create the final flat
* field file.
*/
void IsisMain() {
// Initialize variables
ResetGlobals();
UserInterface &ui = Application::GetUserInterface();
maxStdev = ui.GetDouble("STDEVTOL");
if(ui.GetString("IMAGETYPE") == "FRAMING") {
cameraType = Framing;
// framing cameras need to figure this out automatically
// during step 1
numFrameLines = -1;
}
else if(ui.GetString("IMAGETYPE") == "LINESCAN") {
cameraType = LineScan;
numFrameLines = ui.GetInteger("NUMLINES");
}
else {
cameraType = PushFrame;
numFrameLines = ui.GetInteger("FRAMELETHEIGHT");
}
FileList inList(ui.GetFilename("FROMLIST"));
Progress progress;
tempFileLength = 0;
numOutputSamples = 0;
/**
* Line scan progress is based on the input list, whereas
* the other cameras take much longer and are based on the
* images themselves. Prepare the progress if we're doing
* line scan.
*/
if(cameraType == LineScan) {
progress.SetText("Calculating Number of Image Lines");
progress.SetMaximumSteps(inList.size());
progress.CheckStatus();
}
/**
* For a push frame camera, the temp file is one framelet.
* Technically this is the same for the framing, but we
* don't know the height of a framelet yet.
*/
if(cameraType == PushFrame) {
tempFileLength = numFrameLines;
}
/**
* Start pass 1, use global currImage so that methods called
* know the image we're processing.
*/
for(currImage = 0; currImage < inList.size(); currImage++) {
/**
* Read the current cube into memory
*/
Cube tmp;
tmp.Open(Filename(inList[currImage]).Expanded());
/**
* If we haven't determined how many samples the output
* should have, we can do so now
*/
if(numOutputSamples == 0 && tmp.Bands() == 1) {
numOutputSamples = tmp.Samples();
}
/**
* Try and validate the image, quick tests first!
*
* (imageValid &= means imageValid = imageValid && ...)
*/
bool imageValid = true;
// Only single band images are acceptable
imageValid &= (tmp.Bands() == 1);
//.........这里部分代码省略.........
示例11: IsisMain
void IsisMain() {
const QString caminfo_program = "caminfo";
UserInterface &ui = Application::GetUserInterface();
QList< QPair<QString, QString> > *general = NULL, *camstats = NULL, *statistics = NULL;
BandGeometry *bandGeom = NULL;
// Get input filename
FileName in = ui.GetFileName("FROM");
// Get the format
QString sFormat = ui.GetAsString("FORMAT");
// if true then run spiceinit, xml default is FALSE
// spiceinit will use system kernels
if(ui.GetBoolean("SPICE")) {
QString parameters = "FROM=" + in.expanded();
ProgramLauncher::RunIsisProgram("spiceinit", parameters);
}
Process p;
Cube *incube = p.SetInputCube("FROM");
// General data gathering
general = new QList< QPair<QString, QString> >;
general->append(MakePair("Program", caminfo_program));
general->append(MakePair("IsisVersion", Application::Version()));
general->append(MakePair("RunDate", iTime::CurrentGMT()));
general->append(MakePair("IsisId", SerialNumber::Compose(*incube)));
general->append(MakePair("From", in.baseName() + ".cub"));
general->append(MakePair("Lines", toString(incube->lineCount())));
general->append(MakePair("Samples", toString(incube->sampleCount())));
general->append(MakePair("Bands", toString(incube->bandCount())));
// Run camstats on the entire image (all bands)
// another camstats will be run for each band and output
// for each band.
if(ui.GetBoolean("CAMSTATS")) {
camstats = new QList< QPair<QString, QString> >;
QString filename = ui.GetAsString("FROM");
int sinc = ui.GetInteger("SINC");
int linc = ui.GetInteger("LINC");
CameraStatistics stats(filename, sinc, linc);
Pvl camPvl = stats.toPvl();
PvlGroup cg = camPvl.findGroup("Latitude", Pvl::Traverse);
camstats->append(MakePair("MinimumLatitude", cg["latitudeminimum"][0]));
camstats->append(MakePair("MaximumLatitude", cg["latitudemaximum"][0]));
cg = camPvl.findGroup("Longitude", Pvl::Traverse);
camstats->append(MakePair("MinimumLongitude", cg["longitudeminimum"][0]));
camstats->append(MakePair("MaximumLongitude", cg["longitudemaximum"][0]));
cg = camPvl.findGroup("Resolution", Pvl::Traverse);
camstats->append(MakePair("MinimumResolution", cg["resolutionminimum"][0]));
camstats->append(MakePair("MaximumResolution", cg["resolutionmaximum"][0]));
cg = camPvl.findGroup("PhaseAngle", Pvl::Traverse);
camstats->append(MakePair("MinimumPhase", cg["phaseminimum"][0]));
camstats->append(MakePair("MaximumPhase", cg["phasemaximum"][0]));
cg = camPvl.findGroup("EmissionAngle", Pvl::Traverse);
camstats->append(MakePair("MinimumEmission", cg["emissionminimum"][0]));
camstats->append(MakePair("MaximumEmission", cg["emissionmaximum"][0]));
cg = camPvl.findGroup("IncidenceAngle", Pvl::Traverse);
camstats->append(MakePair("MinimumIncidence", cg["incidenceminimum"][0]));
camstats->append(MakePair("MaximumIncidence", cg["incidencemaximum"][0]));
cg = camPvl.findGroup("LocalSolarTime", Pvl::Traverse);
camstats->append(MakePair("LocalTimeMinimum", cg["localsolartimeMinimum"][0]));
camstats->append(MakePair("LocalTimeMaximum", cg["localsolartimeMaximum"][0]));
}
// Compute statistics for entire cube
if(ui.GetBoolean("STATISTICS")) {
statistics = new QList< QPair<QString, QString> >;
LineManager iline(*incube);
Statistics stats;
Progress progress;
progress.SetText("Statistics...");
progress.SetMaximumSteps(incube->lineCount()*incube->bandCount());
progress.CheckStatus();
iline.SetLine(1);
for(; !iline.end() ; iline.next()) {
incube->read(iline);
stats.AddData(iline.DoubleBuffer(), iline.size());
progress.CheckStatus();
}
// Compute stats of entire cube
double nPixels = stats.TotalPixels();
double nullpercent = (stats.NullPixels() / (nPixels)) * 100;
double hispercent = (stats.HisPixels() / (nPixels)) * 100;
double hrspercent = (stats.HrsPixels() / (nPixels)) * 100;
double lispercent = (stats.LisPixels() / (nPixels)) * 100;
double lrspercent = (stats.LrsPixels() / (nPixels)) * 100;
//.........这里部分代码省略.........
示例12: IsisMain
void IsisMain() {
// Get user interface
UserInterface &ui = Application::GetUserInterface();
bool register_ignored = ui.GetBoolean("REGISTERIGNOREDONLY");
// Open the files list in a SerialNumberList for
// reference by SerialNumber
SerialNumberList files(ui.GetFilename("FILES"));
// Create a ControlNet from the input file
ControlNet inNet(ui.GetFilename("CNET"));
// Create an AutoReg from the template file
Pvl pvl(ui.GetFilename("TEMPLATE"));
AutoReg *ar = AutoRegFactory::Create(pvl);
// Create the output ControlNet
ControlNet outNet;
outNet.SetType(inNet.Type());
outNet.SetUserName(Application::UserName());
outNet.SetDescription(inNet.Description());
outNet.SetCreatedDate(iTime::CurrentLocalTime());
outNet.SetTarget(inNet.Target());
outNet.SetNetworkId(inNet.NetworkId());
Progress progress;
progress.SetMaximumSteps(inNet.Size());
progress.CheckStatus();
int ignored=0, unmeasured=0, registered=0, unregistered=0, validated=0;
CubeManager cubeMgr;
cubeMgr.SetNumOpenCubes(50);
// Register the points and create a new
// ControlNet containing the refined measurements
for (int i=0; i<inNet.Size(); i++) {
ControlPoint &inPoint = inNet[i];
ControlPoint outPoint;
outPoint.SetType(inPoint.Type());
outPoint.SetId(inPoint.Id());
outPoint.SetUniversalGround(inPoint.UniversalLatitude(), inPoint.UniversalLongitude(), inPoint.Radius());
outPoint.SetHeld(inPoint.Held());
outPoint.SetIgnore(inPoint.Ignore());
// CHECK TO SEE IF THE CONTROL POINT SHOULD BE REGISTERED
// "Ignore" point and we are not registering ignored
if (inPoint.Ignore() && !register_ignored){
ignored++;
// add "Ignored" to network only if indicated
if (ui.GetBoolean("OUTPUTIGNORED")) {
// only include appropriate control measures
for (int j = 0; j < inPoint.Size(); j++) {
if (inPoint[j].IsMeasured()){
outPoint.Add(inPoint[j]);
}
else{
unmeasured++;
if (ui.GetBoolean("OUTPUTUNMEASURED")){
outPoint.Add(inPoint[j]);
}
}
}
// only add this point if OUTPUTIGNORED
outNet.Add(outPoint);
}
// go to next control point
continue;
}
// Not "Ignore" point (i.e. "valid") and we are only registering "Ignored"
else if (!inPoint.Ignore() && register_ignored) {
// add all "valid" points to network
// only include appropriate control measures
for (int j = 0; j < inPoint.Size(); j++) {
if (inPoint[j].IsMeasured()){
outPoint.Add(inPoint[j]);
}
else{
unmeasured++;
if (ui.GetBoolean("OUTPUTUNMEASURED")) {
outPoint.Add(inPoint[j]);
}
}
}
// add this point since it is not ignored
outNet.Add(outPoint);
// go to next control point
continue;
}
// "Ignore" point or "valid" point to be registered
else { // if ( (inPoint.Ignore() && register_ignored) || (!inPoint.Ignore() && !register_ignored ) ) {
if (inPoint.Ignore()) { outPoint.SetIgnore(false); }
ControlMeasure &patternCM = inPoint[inPoint.ReferenceIndex()];
Cube &patternCube = *cubeMgr.OpenCube(files.Filename(patternCM.CubeSerialNumber()));
ar->PatternChip()->TackCube(patternCM.Sample(), patternCM.Line());
//.........这里部分代码省略.........
示例13: IsisMain
/** The ISIS smtk main application */
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
// Open the first cube. It is the left hand image.
Cube lhImage;
CubeAttributeInput &attLeft = ui.GetInputAttribute("FROM");
vector<QString> bandLeft = attLeft.bands();
lhImage.setVirtualBands(bandLeft);
lhImage.open(ui.GetFileName("FROM"),"r");
// Open the second cube, it is geomertricallty altered. We will be matching the
// first to this one by attempting to compute a sample/line offsets
Cube rhImage;
CubeAttributeInput &attRight = ui.GetInputAttribute("MATCH");
vector<QString> bandRight = attRight.bands();
rhImage.setVirtualBands(bandRight);
rhImage.open(ui.GetFileName("MATCH"),"r");
// Ensure only single bands
if (lhImage.bandCount() != 1 || rhImage.bandCount() != 1) {
QString msg = "Input Cubes must have only one band!";
throw IException(IException::User,msg,_FILEINFO_);
}
// Both images must have a Camera and can also have a Projection. We will
// only deal with a Camera, however as a projected, non-mosaicked image
// uses a Projection internal to the Camera object.
Camera *lhCamera = NULL;
Camera *rhCamera = NULL;
try {
lhCamera = lhImage.camera();
rhCamera = rhImage.camera();
}
catch (IException &ie) {
QString msg = "Both input images must have a camera";
throw IException(ie, IException::User, msg, _FILEINFO_);
}
// Since we are generating a DEM, we must turn off any existing
// DEM that may have been initialized with spiceinit.
lhCamera->IgnoreElevationModel(true);
rhCamera->IgnoreElevationModel(true);
// Get serial number
QString serialLeft = SerialNumber::Compose(lhImage, true);
QString serialRight = SerialNumber::Compose(rhImage, true);
// This still precludes band to band registrations.
if (serialLeft == serialRight) {
QString sLeft = FileName(lhImage.fileName()).name();
QString sRight = FileName(rhImage.fileName()).name();
if (sLeft == sRight) {
QString msg = "Cube Serial Numbers must be unique - FROM=" + serialLeft +
", MATCH=" + serialRight;
throw IException(IException::User,msg,_FILEINFO_);
}
serialLeft = sLeft;
serialRight = sRight;
}
Progress prog;
prog.SetText("Finding Initial Seeds");
int nl = lhImage.lineCount();
int ns = lhImage.sampleCount();
BigInt numAttemptedInitialPoints = 0;
// Declare Gruen matcher
SmtkMatcher matcher(ui.GetFileName("REGDEF"), &lhImage, &rhImage);
// Get line/sample linc/sinc parameters
int space = ui.GetInteger("SPACE");
int linc (space), sinc(space);
// Do we have a seed points from a control net file?
bool useseed = ui.WasEntered("CNET");
// Base points on an input cnet
SmtkQStack gstack;
double lastEigen(0.0);
if (useseed) {
ControlNet cnet(ui.GetFileName("CNET"));
prog.SetMaximumSteps(cnet.GetNumPoints());
prog.CheckStatus();
gstack.reserve(cnet.GetNumPoints());
for (int cpIndex = 0; cpIndex < cnet.GetNumPoints(); cpIndex ++) {
ControlPoint *cp = cnet.GetPoint(cpIndex);
if (!cp->IsIgnored()) {
ControlMeasure *cmLeft(0), *cmRight(0);
for(int cmIndex = 0; cmIndex < cp->GetNumMeasures(); cmIndex ++) {
ControlMeasure *cm = cp->GetMeasure(cmIndex);
if (!cm->IsIgnored()) {
if (cm->GetCubeSerialNumber() == serialLeft)
cmLeft = cp->GetMeasure(cmIndex);
if (cm->GetCubeSerialNumber() == serialRight)
cmRight = cp->GetMeasure(cmIndex);
//.........这里部分代码省略.........
示例14: IsisMain
// Main program
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
if( !ui.WasEntered("FROMLIST") && ui.WasEntered("TOLIST") ) {
std::string msg = "To create a [TOLIST] the [FROMLIST] parameter must be provided.";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
// Gets the input parameters
ControlNet outNet( ui.GetFilename("CNET") );
FileList inList;
if( ui.WasEntered("FROMLIST") ) {
inList = ui.GetFilename("FROMLIST");
}
bool noIgnore = ui.GetBoolean("NOIGNORE");
bool noHeld = ui.GetBoolean("NOHELD");
bool noSingleMeasure = ui.GetBoolean("NOSINGLEMEASURES");
bool noMeasureless = ui.GetBoolean("NOMEASURELESS");
bool noTolerancePoints = ui.GetBoolean("TOLERANCE");
bool reference = ui.GetBoolean("REFERENCE");
bool ground = ui.GetBoolean("GROUND");
bool cubePoints = ui.WasEntered("CUBEPOINTS");
bool cubeMeasures = ui.GetBoolean("CUBEMEASURES");
bool pointsEntered = ui.WasEntered("POINTLIST");
bool latLon = ui.GetBoolean("LATLON");
if( !(noIgnore || noHeld || noSingleMeasure || noMeasureless || noTolerancePoints ||
reference || ground || cubePoints || pointsEntered || latLon) ) {
std::string msg = "At least one filter must be selected [";
msg += "NOIGNORE,NOHELD,NOSINGLEMEASURE,TOLERANCE,REFERENCE,GROUND,CUBEPOINTS,";
msg += "CUBEMEASURES,POINTLIST,LATLON]";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
else if( cubeMeasures && !cubePoints ) {
std::string msg = "When CUBEMEASURES is selected, CUBEPOINTS must be given";
msg += " a list of cubes.";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
// Set up the Serial Number to Filename mapping
map<iString,iString> sn2filename;
for( int cubeIndex=0; cubeIndex < (int)inList.size(); cubeIndex ++ ) {
iString sn = SerialNumber::Compose( inList[cubeIndex] );
sn2filename[sn] = inList[cubeIndex];
}
Progress progress;
progress.SetMaximumSteps(outNet.Size());
progress.CheckStatus();
// Set up verctor records of how points/measures are removed
PvlKeyword ignoredPoints( "IgnoredPoints" );
PvlKeyword ignoredMeasures( "IgnoredMeasures" );
PvlKeyword heldPoints( "HeldPoints" );
PvlKeyword singleMeasurePoints( "SingleMeasurePoints" );
PvlKeyword measurelessPoints( "MeasurelessPoints" );
PvlKeyword tolerancePoints( "TolerancePoints" );
PvlKeyword nonReferenceMeasures( "NonReferenseMeasures" );
PvlKeyword nonGroundPoints( "NonGroundPoints" );
PvlKeyword nonCubePoints( "NonCubePoints" );
PvlKeyword nonCubeMeasures( "NonCubeMeasures" );
PvlKeyword noMeasurePoints( "NoMeasurePoints" );
PvlKeyword nonListedPoints( "NonListedPoints" );
PvlKeyword nonLatLonPoints( "LatLonOutOfRangePoints" );
PvlKeyword cannotGenerateLatLonPoints( "NoLatLonPoints" );
// Set up comparison data
vector<iString> serialNumbers;
if( cubePoints ) {
FileList cubeList( ui.GetFilename("CUBEPOINTS") );
for( int cubeIndex=0; cubeIndex < (int)cubeList.size(); cubeIndex ++ ) {
iString sn = SerialNumber::Compose( cubeList[cubeIndex] );
serialNumbers.push_back( sn );
}
}
double tolerance = 0.0;
if( noTolerancePoints ) {
tolerance = ui.GetDouble("PIXELTOLERANCE");
}
// Set up extracted network values
if( ui.WasEntered("NETWORKID") )
outNet.SetNetworkId( ui.GetString("NETWORKID") );
outNet.SetUserName( Isis::Application::UserName() );
outNet.SetDescription( ui.GetString("DESCRIPTION") );
for(int cp=outNet.Size()-1; cp >= 0; cp --) {
progress.CheckStatus();
// Do preliminary exclusion checks
if( noIgnore && outNet[cp].Ignore() ) {
ignoredPoints += outNet[cp].Id();
outNet.Delete(cp);
continue;
//.........这里部分代码省略.........
示例15: IsisMain
void IsisMain() {
Process p;
// Get the list of names of input CCD cubes to stitch together
FileList flist;
UserInterface &ui = Application::GetUserInterface();
flist.Read(ui.GetFilename("FROMLIST"));
if (flist.size() < 1) {
string msg = "The list file[" + ui.GetFilename("FROMLIST") +
" does not contain any filenames";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
string projection("Equirectangular");
if(ui.WasEntered("MAP")) {
Pvl mapfile(ui.GetFilename("MAP"));
projection = (string) mapfile.FindGroup("Mapping")["ProjectionName"];
}
if(ui.WasEntered("PROJECTION")) {
projection = ui.GetString("PROJECTION");
}
// Gather other user inputs to projection
string lattype = ui.GetString("LATTYPE");
string londir = ui.GetString("LONDIR");
string londom = ui.GetString("LONDOM");
int digits = ui.GetInteger("PRECISION");
// Fix them for mapping group
lattype = (lattype == "PLANETOCENTRIC") ? "Planetocentric" : "Planetographic";
londir = (londir == "POSITIVEEAST") ? "PositiveEast" : "PositiveWest";
Progress prog;
prog.SetMaximumSteps(flist.size());
prog.CheckStatus();
Statistics scaleStat;
Statistics longitudeStat;
Statistics latitudeStat;
Statistics equiRadStat;
Statistics poleRadStat;
PvlObject fileset("FileSet");
// Save major equitorial and polar radii for last occuring
double eqRad;
double eq2Rad;
double poleRad;
string target("Unknown");
for (unsigned int i = 0 ; i < flist.size() ; i++) {
// Set the input image, get the camera model, and a basic mapping
// group
Cube cube;
cube.Open(flist[i]);
int lines = cube.Lines();
int samples = cube.Samples();
PvlObject fmap("File");
fmap += PvlKeyword("Name",flist[i]);
fmap += PvlKeyword("Lines", lines);
fmap += PvlKeyword("Samples", samples);
Camera *cam = cube.Camera();
Pvl mapping;
cam->BasicMapping(mapping);
PvlGroup &mapgrp = mapping.FindGroup("Mapping");
mapgrp.AddKeyword(PvlKeyword("ProjectionName",projection),Pvl::Replace);
mapgrp.AddKeyword(PvlKeyword("LatitudeType",lattype),Pvl::Replace);
mapgrp.AddKeyword(PvlKeyword("LongitudeDirection",londir),Pvl::Replace);
mapgrp.AddKeyword(PvlKeyword("LongitudeDomain",londom),Pvl::Replace);
// Get the radii
double radii[3];
cam->Radii(radii);
eqRad = radii[0] * 1000.0;
eq2Rad = radii[1] * 1000.0;
poleRad = radii[2] * 1000.0;
target = cam->Target();
equiRadStat.AddData(&eqRad, 1);
poleRadStat.AddData(&poleRad, 1);
// Get resolution
double lowres = cam->LowestImageResolution();
double hires = cam->HighestImageResolution();
scaleStat.AddData(&lowres, 1);
scaleStat.AddData(&hires, 1);
double pixres = (lowres+hires)/2.0;
double scale = Scale(pixres, poleRad, eqRad);
mapgrp.AddKeyword(PvlKeyword("PixelResolution",pixres),Pvl::Replace);
mapgrp.AddKeyword(PvlKeyword("Scale",scale,"pixels/degree"),Pvl::Replace);
mapgrp += PvlKeyword("MinPixelResolution",lowres,"meters");
mapgrp += PvlKeyword("MaxPixelResolution",hires,"meters");
// Get the universal ground range
//.........这里部分代码省略.........