Commit 299df1f5 authored by Jeannie Backer's avatar Jeannie Backer
Browse files

Updated from trunk

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6440 41f8697f-d340-4b68-9986-7bafba869bb8
parents 00aa70eb 7da88644
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -174,7 +174,8 @@ Group = DataDirectory
  Mgs          = $ISIS3DATA/mgs
  Mro          = $ISIS3DATA/mro
  Near         = $ISIS3DATA/near
  NewHorizons  = $ISIS3DATA/newhorizons
  # When setting this back to the normal area, do not forget objs/Preferences
  NewHorizons  = $ISIS3DATA/../datalocal/newhorizons
  Odyssey      = $ISIS3DATA/odyssey
  Rolo         = $ISIS3DATA/rolo
  Smart1       = $ISIS3DATA/smart1
+0 −1
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ namespace Isis {
  void CameraPointInfo::SetCube(const QString &cubeFileName) {
    m_currentCube = m_usedCubes->OpenCube(cubeFileName);
    m_camera = m_currentCube->camera();
    m_camera->IgnoreProjection(true);
  }


+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ Group = DataDirectory
  Messenger    = $ISIS3DATA/messenger
  Mgs          = $ISIS3DATA/mgs
  Mro          = $ISIS3DATA/mro
  NewHorizons  = $ISIS3DATA/newhorizons
  NewHorizons  = $ISIS3DATA/../datalocal/newhorizons
  Near         = $ISIS3DATA/near
  Odyssey      = $ISIS3DATA/odyssey
  Rolo         = $ISIS3DATA/rolo
+80 −12
Original line number Diff line number Diff line
#include "Isis.h"

#include <cstdio>
#include <QString>

#include "ProcessImportPds.h"

#include "UserInterface.h"
#include "CubeAttribute.h"
#include "FileName.h"
#include "IException.h"
#include "iTime.h"
#include "ProcessImportPds.h"
#include "UserInterface.h"

#include <cstdio>
#include <QString>
#include <QByteArray>
#include <QFileInfo>
#include <QFile>





using namespace std;
using namespace Isis;
@@ -17,8 +23,9 @@ bool summed;

Cube *summedOutput;

void TranslateData(Buffer &inData);
void TranslateLabels(Pvl &pdsLabel, Cube *ocube);
void translateData(Buffer &inData);
void translateLabels(Pvl &pdsLabel, Cube *ocube);
void fixPvl(QString fileName);

void IsisMain() {

@@ -31,7 +38,15 @@ void IsisMain() {
  FileName inFile = ui.GetFileName("FROM");
  FileName out = ui.GetFileName("TO");



  fixPvl(inFile.toString());




  // Make sure it is a Galileo SSI image

  Pvl lab(inFile.expanded());

  //Checks if in file is rdr
@@ -99,11 +114,11 @@ void IsisMain() {
    summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands());
    summedOutput->setPixelType(p.PixelType());
    summedOutput->create(ui.GetFileName("TO"));
    p.StartProcess(TranslateData);
    p.StartProcess(translateData);
    ocube = summedOutput;
  }

  TranslateLabels(pdsLabel, ocube);
  translateLabels(pdsLabel, ocube);
  p.EndProcess();

  if (summed) {
@@ -114,11 +129,64 @@ void IsisMain() {
  return;
}

void TranslateData(Buffer &inData) {


/**
  * This fixes a problem with some of the Pvl files where a comment
  * was left open.  If the file has this error, the comment is closed
  * and the file is saved.  If the file does not, it's closed without
  * changing anything.
  *
  * @param fileName  The full path + file name of the Pvl file
  *     being checked
  *
  */



void fixPvl(QString fileName){

    QFile pvlFile;

    pvlFile.setFileName(fileName);
    pvlFile.open(QFile::ReadWrite | QFile::Text);

    //Read the Pvl file into a byte array
    QByteArray fileData = pvlFile.readAll();

    //Is this one of the messed up files?
    if (!fileData.contains(QByteArray("/* Image Object /") ) ){
            pvlFile.close();

     //No - so return without doing anything
     return;

    }

    //Otherwise, edit the file in place

    fileData.replace(QByteArray("/* Image Object /"),QByteArray("/* Image Object */"));

    pvlFile.seek(0);
    pvlFile.write(fileData);
    pvlFile.close();


}









void translateData(Buffer &inData) {
  summedOutput->write(inData);
}

void TranslateLabels(Pvl &pdsLabel, Cube *ocube) {
void translateLabels(Pvl &pdsLabel, Cube *ocube) {
  // Get the directory where the MOC translation tables are.
  PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory");

+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@
       contains "SSI-4-REDR-V1.0").  Modified code to set as FULL summing 
       mode if FRAMEMODE=AUTO and the image is reconstructed.
    </change>
    <change name="Tyler Wilson" date="2015-10-02">
       Added the fixPvl function that fixes Pvl files from orbit I24 which have
       a comment tag that is not closed off.  #Ref 2344
    </change>


  </history>

  <category>
Loading