Unverified Commit 5c7ef966 authored by Kristin Berry's avatar Kristin Berry Committed by GitHub
Browse files

Update tgocassisrdrgen to export footprint information (#4508)

* Update translation files to support Archive footprint keywords

* Fix spacing issue for output corner values

* Update output order

* Update to handle order issue in a cleaner way

* Add CHANGELOG

* Fix no output for footprint issue
parent e4896355
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ release.
- Added a new dark current correction to hical that works with the higher temperatures recent images are captured at. Use the new config file, $ISISDATA/mro/calibration/hical.0023_darkrate.conf, to enable the new dark current correction over the old dark current correction. Runs of hical without the new dark current correction will also produce an extra line in the output log indicating that the ZeroDarkRate module is disabled. [#4324](https://github.com/USGS-Astrogeology/ISIS3/issues/4324)

### Changed
- Added the ability to export footprint information from a CaSSIS ISIS Cube label to the generated output PDS4 label in tgocassisrdrgen. [#4473](https://github.com/USGS-Astrogeology/ISIS3/issues/4473)
- isisVarInit.py no longer writes a "cat" statement by default to the activate scripts which cause the ISIS version information to be written on conda activate.  This can be included in those scripts via a command line option to isisVarInit.py.  Also, a quiet option is provided to isisVarInit.py to suppress its own writing to standard out, if needed.

### Fixed
+88 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
# history 2018-05-22 Kaitlyn Lee - Moved mosaic keywords to tgoCassisExportMosaic.trn.
# history 2018-06-18 Jeannie Backer - Look for ObservationId in Archive group
# history 2019-06-12 Kristin Berry - Removed CaSSIS_Header for non-PDS4 compliance.
# history 2021-06-07 Kristin Berry  - Added footprint information. 

#Group = FileName
#  Auto
@@ -678,3 +679,90 @@ End_Group
#  OutputPosition  = (Product_Observational, CaSSIS_Header, PEHK_HEADER)
#  Translation     = (*, *)
#End_Group

# Export Footprint Coordinates 

Group = Corner1Lattiude
  Auto
  Optional
  InputKey        = Corner1Latitude
  InputPosition   = (IsisCube, Archive)
  OutputSiblings =  ("geom:reference_pixel_location|Lower Left Corner")
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept)
  Translation     = (*, *)
End_Group

Group = Corner1Longitude
  Auto
  Optional
  InputKey        = Corner1Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept)
  Translation     = (*, *)
End_Group

Group = Corner2Lattiude
  Auto
  Optional
  InputKey        = Corner2Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept2)
  OutputSiblings = ("geom:reference_pixel_location|Lower Right Corner")
  Translation     = (*, *)
End_Group

Group = Corner2Longitude
  Auto
  Optional
  InputKey        = Corner2Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept2)
  Translation     = (*, *)
End_Group

Group = Corner3Lattiude
  Auto
  Optional
  InputKey        = Corner3Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept3)
  OutputSiblings  = ("geom:reference_pixel_location|Upper Left Corner")
  Translation     = (*, *)
End_Group

Group = Corner3Longitude
  Auto
  Optional
  InputKey        = Corner3Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept3)
  Translation     = (*, *)
End_Group

Group = Corner4Lattiude
  Auto
  Optional
  InputKey        = Corner4Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept4)
  OutputSiblings  = ("geom:reference_pixel_location|Upper Right Corner")
  Translation     = (*, *)
End_Group

Group = Corner4Longitude
  Auto
  Optional
  InputKey        = Corner4Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept4)
  Translation     = (*, *)
End_Group
+88 −1
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@
#                                    as it now depends on whether a 2D or 3D image is being exported. 
# history 2020-09-22 Kristin Berry - Added stitched browse product LID and UID in Observation_Context
#                                    and added information about SPICE kernels to labels
# history 2021-06-07 Kristin Berry  - Added footprint information. 


Group = LidVid
  Auto
@@ -198,6 +200,92 @@ Group = PhaseAngle
  Translation     = (*, *)
End_Group

# Export Footprint Coordinates 

Group = Corner1Lattiude
  Auto
  Optional
  InputKey        = Corner1Latitude
  InputPosition   = (IsisCube, Archive)
  OutputSiblings =  ("geom:reference_pixel_location|Lower Left Corner")
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept)
  Translation     = (*, *)
End_Group

Group = Corner1Longitude
  Auto
  Optional
  InputKey        = Corner1Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept)
  Translation     = (*, *)
End_Group

Group = Corner2Lattiude
  Auto
  Optional
  InputKey        = Corner2Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept2)
  OutputSiblings = ("geom:reference_pixel_location|Lower Right Corner")
  Translation     = (*, *)
End_Group

Group = Corner2Longitude
  Auto
  Optional
  InputKey        = Corner2Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept2)
  Translation     = (*, *)
End_Group

Group = Corner3Lattiude
  Auto
  Optional
  InputKey        = Corner3Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept3)
  OutputSiblings  = ("geom:reference_pixel_location|Upper Left Corner")
  Translation     = (*, *)
End_Group

Group = Corner3Longitude
  Auto
  Optional
  InputKey        = Corner3Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept3)
  Translation     = (*, *)
End_Group

Group = Corner4Lattiude
  Auto
  Optional
  InputKey        = Corner4Latitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_latitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, new@geom:Pixel_Intercept4)
  OutputSiblings  = ("geom:reference_pixel_location|Upper Right Corner")
  Translation     = (*, *)
End_Group

Group = Corner4Longitude
  Auto
  Optional
  InputKey        = Corner4Longitude
  InputPosition   = (IsisCube, Archive)
  OutputName      = geom:pixel_longitude
  OutputPosition  = (Product_Observational, Observation_Area, Discipline_Area, geom:Geometry, geom:Geometry_Orbiter, geom:Surface_Geometry, geom:Surface_Geometry_Specific, geom:Footprint_Vertices, geom:Pixel_Intercept4)
  Translation     = (*, *)
End_Group

Group = SmithedMetakernel
  Auto
  Optional
@@ -549,4 +637,3 @@ End_Group


+39 −0
Original line number Diff line number Diff line
@@ -191,6 +191,45 @@ void IsisMain() {
    focalLengthNode.removeAttribute("unit");
  }

  // Fix the footprint section's output structure
  QStringList xmlPath2;
  xmlPath2 << "Observation_Area"
          << "Discipline_Area"
          << "geom:Geometry"
          << "geom:Geometry_Orbiter"
          << "geom:Surface_Geometry"
          << "geom:Surface_Geometry_Specific"
          << "geom:Footprint_Vertices"
          << "geom:Pixel_Intercept";
  QDomElement pixelInterceptNode = process.getElement(xmlPath2, observationNode);

  if(pixelInterceptNode.hasChildNodes()) {
    QDomElement pixelInterceptNode2 = pixelInterceptNode.nextSiblingElement();
    QDomElement pixelInterceptNode3 = pixelInterceptNode2.nextSiblingElement();
    QDomElement pixelInterceptNode4 = pixelInterceptNode3.nextSiblingElement();

    pixelInterceptNode.insertAfter(pixelInterceptNode.firstChildElement("geom:pixel_latitude"), pixelInterceptNode.firstChildElement("geom:reference_pixel_location"));
    pixelInterceptNode2.insertAfter(pixelInterceptNode2.firstChildElement("geom:pixel_latitude"), pixelInterceptNode2.firstChildElement("geom:reference_pixel_location"));
    pixelInterceptNode3.insertAfter(pixelInterceptNode3.firstChildElement("geom:pixel_latitude"), pixelInterceptNode3.firstChildElement("geom:reference_pixel_location"));
    pixelInterceptNode4.insertAfter(pixelInterceptNode4.firstChildElement("geom:pixel_latitude"), pixelInterceptNode4.firstChildElement("geom:reference_pixel_location"));
    
    pixelInterceptNode2.setTagName("geom:Pixel_Intercept");
    pixelInterceptNode3.setTagName("geom:Pixel_Intercept");
    pixelInterceptNode4.setTagName("geom:Pixel_Intercept");
  }
  else {
  QStringList xmlPathFootprint;
  xmlPathFootprint << "Observation_Area"
                   << "Discipline_Area"
                   << "geom:Geometry"
                   << "geom:Geometry_Orbiter"
                   << "geom:Surface_Geometry"
                   << "geom:Surface_Geometry_Specific"
                   << "geom:Footprint_Vertices";
    QDomElement footprintNode = process.getElement(xmlPathFootprint, observationNode);
    footprintNode.parentNode().removeChild(footprintNode);
  }

  QString outFile = ui.GetFileName("TO");

  process.WritePds4(outFile);