Unverified Commit e70d885c authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Merge pull request #113 from jessemapel/socetkeys

Added ellipsoid values to socetlinescankeywords. Fixes #5362.
parents 30bf967b d95a0cb6
Loading
Loading
Loading
Loading
+36 −15
Original line number Diff line number Diff line
@@ -694,6 +694,27 @@ void IsisMain() {
  toStrm << "SENSOR_TYPE USGSAstroLineScanner" << endl;
  toStrm << "SENSOR_MODE UNKNOWN" << endl;

  Distance targetRadii[3];
  if (cube.label()->hasGroup("Mapping")) {
    PvlGroup &mappingGroup = cube.label()->findGroup("Mapping");
    targetRadii[0].setMeters(toDouble(mappingGroup["EquatorialRadius"][0]));
    targetRadii[2].setMeters(toDouble(mappingGroup["PolarRadius"][0]));
  }
  else {
    try {
      cam->radii(targetRadii);
    }
    catch (IException &e) {
      QString msg = "Failed to get target body radii from cube.";
      throw IException(e, IException::Programmer, msg, _FILEINFO_);
    }
  }
  double eccentricity = 1.0 - (targetRadii[2].meters() * targetRadii[2].meters())
                            / (targetRadii[0].meters() * targetRadii[0].meters());
  eccentricity = sqrt(eccentricity);
  toStrm << "SEMI_MAJOR_AXIS  " << targetRadii[0].meters() << "\n";
  toStrm << "ECCENTRICITY     " << eccentricity << "\n";

  toStrm << "FOCAL " << focal << endl;

  toStrm << "ATMCO";
+4 −1
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@
      the pixel-location of the input image's center ephemeris time, and (4) compute spacecraft
      velocity values instead of using SPICE velocity data blobs.  Fixes #1672.
    </change>
    <change name="Jesse Mapel" date="2018-03-23">
      Added SEMI_MAJOR_AXIS and ECCENTRICITY to the output. Fixes #5362.
    </change>
  </history>

  <groups>