Unverified Commit b533e743 authored by AustinSanders's avatar AustinSanders Committed by GitHub
Browse files

Updates LroWideAngleCamera::GetVector to search for stored keywords (#4741)

* updated GetVector to search for stored keywords

* Initialize distortion coefficients to 0 to prevent segfaults

* Add a print statement to exception

* Replaced try/catch with explicit condition check
parent c9f5f8d6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1240,7 +1240,8 @@ namespace Isis {
          result = toInt(storedKeyword[index]);
        }
      }
      catch(IException &) {
      catch(IException &e) {
        e.print();
      }
    }

+12 −2
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ namespace Isis {
    // Setup focal plane and distortion maps
    LroWideAngleCameraFocalPlaneMap *fplane = new LroWideAngleCameraFocalPlaneMap(this, naifIkCode());
    LroWideAngleCameraDistortionMap *distort = new LroWideAngleCameraDistortionMap(this, naifIkCode());

    for ( int i = 0 ; i < filtNames.size() ; i++ ) {
      fplane->addFilter(filterIKCode.get(filtNames[i].toInt()));
      distort->addFilter(filterIKCode.get(filtNames[i].toInt()));
@@ -291,9 +292,18 @@ namespace Isis {
    }

    if (nvals <= 0) {
      PvlObject NaifKeywords = getStoredNaifKeywords();
      if (!NaifKeywords.hasKeyword(key)){
        QString mess = "Kernel pool keyword " + key + " not found!";
        throw IException(IException::Programmer, mess, _FILEINFO_);
      }
      PvlKeyword kw = NaifKeywords[key];
      IntParameterList parms;
      for (int i = 0; i<kw.size(); i++){
        parms.push_back(toInt(kw[i]));
      }
      return parms;
    }

    IntParameterList parms;
    for (int i = 0 ; i < nvals ; i++) {
+5 −1
Original line number Diff line number Diff line
@@ -33,7 +33,11 @@ namespace Isis {
  LroWideAngleCameraDistortionMap::LroWideAngleCameraDistortionMap(Camera *parent,
                                                                   int naifIkCode) :
                                                                   CameraDistortionMap(parent) {
    SetDistortion(naifIkCode);
    // Initialize distortion coefficients to 0 to avoid segfaults
    QString odkkey = "INS" + toString(naifIkCode) + "_OD_K";
    for (int i = 0; i < 3; ++i) {
      p_odk.push_back(0);
    }
  }