Commit 8eebb8b2 authored by Kristin Berry's avatar Kristin Berry
Browse files

Added new application rosvirtis2isis to ingest Rosetta VIRTIS-M images. References #3888

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7723 41f8697f-d340-4b68-9986-7bafba869bb8
parent f79117d2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -39,6 +39,20 @@ namespace Isis {
    p_degree = degree;
  }


  /**
   * Create a PolynomialUnivariate object 
   *  
   * @param degree The order/degree of the polynomial 
   * @param coeffs a list of the coefficients  
   */
   PolynomialUnivariate::PolynomialUnivariate(int degree, std::vector<double> coeffs) :
    Isis::Basis1VariableFunction("PolynomialUnivariate", (degree + 1)) {
     p_degree = degree;
     SetCoefficients(coeffs);
   }


   /**
   * This is the the overriding virtual function that provides the expansion of
   * the two input variables into the polynomial equation.
+3 −0
Original line number Diff line number Diff line
@@ -46,11 +46,14 @@ namespace Isis {
   *   @history 2008-01-11 Tracie Sucharski - Renamed from Poly1D, add derivative methods.
   *   @history 2008-02-05 Jeannie Walldren - Renamed from Polynomial1Variable.
   *   @history 2015-02-20 Jeannie Backer - Improved error messages.
   *   @history 2016-11-10 Kristin Berry - Added additional convenience constructor which
   *                                       accepts a vector of coeffs. References #3888. 
   */

  class PolynomialUnivariate : public Isis::Basis1VariableFunction {
    public:
      PolynomialUnivariate(int degree);
      PolynomialUnivariate(int degree, std::vector<double> coeffs);

      //! Destroys the PolynomialUnivariate object
      ~PolynomialUnivariate() {};
+21 −7
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ namespace Isis {
   * This method returns the number of data trailer bytes
   */
  int ProcessImport::DataTrailerBytes() const {
    return p_fileTrailerBytes;
    return p_dataTrailerBytes; 
  }


@@ -1374,7 +1374,6 @@ namespace Isis {
    }
    else {
      fin.seekg(p_fileHeaderBytes+p_suffixData, ios_base::beg);

    }

    // Check the last io
@@ -1490,7 +1489,6 @@ namespace Isis {
              }
              break;
            case Isis::Double:
              //cout << "Double"  << endl;
              (*out)[samp] = (double)swapper.Double((double *)in+samp);
              break;
            default:
@@ -1689,7 +1687,6 @@ namespace Isis {
        // Space for storing prefix and suffix data pointers
        vector<char *> tempPre, tempPost;


        // Handle any line prefix bytes
        pos = fin.tellg();
        if (p_saveDataPre) {
@@ -2052,6 +2049,23 @@ namespace Isis {

      } // End band loop

      pos = fin.tellg();
      if (p_saveDataTrailer) {
        p_dataTrailer.push_back(new char[p_dataTrailerBytes]);
        fin.read(p_dataTrailer.back(), p_dataTrailerBytes);
      }
      else {
        fin.seekg(p_dataTrailerBytes, ios_base::cur);
      }

      // Check the last io
      if (!fin.good()) {
        QString msg = "Cannot read file [" + p_inFile + "]. Position [" +
                     toString((int)pos) + "]. Byte count [" +
                     toString(p_fileHeaderBytes) + "]" ;
        throw IException(IException::Io, msg, _FILEINFO_);
      }

      p_progress->CheckStatus();

    } // End line loop
+3 −1
Original line number Diff line number Diff line
@@ -149,7 +149,9 @@ namespace Isis {
   *   @history 2016-04-20 Jeannie Backer - Merged Janet Barret's changes to handle SignedInteger
   *                           imports. Brought code closer to coding standards.
   *   @history 2016-04-21 Makayla Shepherd - Added UnsignedWord pixel type handling.
   *
   *   @history 2017-05-29 Kristin Berry - Added support for data trailers in BIP files and fixed
   *                            a typo so that DataTrailerBytes() will return the correct value.
   *                            References #3888.
   *
   */
  class ProcessImport : public Isis::Process {
+20 −24
Original line number Diff line number Diff line
@@ -203,28 +203,20 @@ namespace Isis {
    //core data type is VAX_REAL

    try {

      PvlObject obj = p_pdsLabel.findObject("QUBE");
      PvlKeyword coreKey = obj.findKeyword("CORE_ITEM_TYPE");
      PvlKeyword suffixKey = obj.findKeyword("BAND_SUFFIX_ITEM_TYPE");
      //if ( (coreKey[0] == "VAX_REAL") && (suffixKey[0] =="VAX_REAL") )

      if (coreKey[0] == "VAX_REAL") {

        ProcessImport::SetVAXConvert(true);
      }

    }
    catch (IException &e) {


    }



    Isis::PvlTranslationManager pdsXlater(p_pdsLabel, trnsStrm);


    // Check to see if we are dealing with a JPEG2000 file
    QString str;
    if (pdsXlater.InputHasKeyword("PdsEncodingType")) {
@@ -260,8 +252,6 @@ namespace Isis {
    }




    // Call the correct label processing
    if ((allowedTypes & Image) == Image && pdsXlater.InputHasKeyword("PdsTypeImage")) {

@@ -726,6 +716,9 @@ namespace Isis {
    SetDataSuffixBytes(suffix);

    str = pdsXlater.Translate("SuffixItemSize");

    // Only set DataTrailerBytes if we haven't already set it elsewhere. (It's inialized to 0.)
    if (DataTrailerBytes() == 0) {
      int trailer = toInt(str);
      str = pdsXlater.Translate("AxisSuffixCount", 1);
      trailer *= toInt(str);
@@ -733,6 +726,9 @@ namespace Isis {
      trailer *= toInt(str);
      trailer += suffix;
      SetDataTrailerBytes(trailer); 
    }

    SaveDataTrailer();

    ProcessPixelBitandType(pdsXlater);

Loading