Commit 9800a727 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@7094 41f8697f-d340-4b68-9986-7bafba869bb8
parent 928ba92d
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -7,10 +7,14 @@
#include "Camera.h"
#include "CameraPointInfo.h"
#include "CSVReader.h"
#include "Distance.h"
#include "IException.h"
#include "iTime.h"
#include "Longitude.h"
#include "Progress.h"
#include "PvlGroup.h"
#include "SpecialPixel.h"
#include "TProjection.h"

using namespace std;
using namespace Isis;
@@ -21,17 +25,28 @@ QList<PvlGroup *> getCameraPointInfo(const UserInterface &ui,
                                    CameraPointInfo &campt);
void writePoints(const UserInterface &ui, QList<PvlGroup*> camPoints);




void IsisMain() {
  UserInterface &ui = Application::GetUserInterface();
  
  // Setup our input cube
  CameraPointInfo campt;

  QString fileFormat = ui.GetString("FORMAT");
  if(fileFormat=="PVL")
      campt.SetCSVOutput(false);
  else
      campt.SetCSVOutput(true);

  campt.SetCube(ui.GetFileName("FROM") + "+" + ui.GetInputAttribute("FROM").toString());

  // Grab the provided points (coordinates)
  QList< QPair<double, double> > points = getPoints(ui, ui.WasEntered("COORDLIST"));
  
  // Get the camera point info for coordiante

  QList<PvlGroup*> camPoints = getCameraPointInfo(ui, points, campt);
  
  writePoints(ui, camPoints);
@@ -209,6 +224,8 @@ void writePoints(const UserInterface &ui, QList<PvlGroup*> camPoints) {
          os << endl;
        }
        


        for (int i = 0; i < (*point).keywords(); i++) {
          if ((*point)[i].size() == 3) {
            os << (QString)(*point)[i][0] << ","
+43 −46
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<application name="campt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
<application name="campt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
  <brief>
    Computes geometric and photometric information at a given pixel location
  </brief>
@@ -35,8 +37,8 @@
    <p> 
    The following is a partial list of coordinates computed in the <i>campt</i> application:<br />
    <br />
    <b>Geometric Information</b>: <def>Latitude</def>, <def>Longitude</def>, <def 
    link="Line Resolution">Resolution</def> <br />
    <b>Geometric Information</b>: <def>Latitude</def>, <def>Longitude</def>, <def>Oblique Detector Resolution</def>, 
       <def>Line Resolution</def>, <def>Oblique Line Resolution</def> <br />
    <br />
    <b>Photometric Information</b>: <def link="Phase Angle">Phase</def>, 
    <def link="Emission Angle">Emission</def>, and <def link="Incidence 
@@ -66,56 +68,51 @@ Group = GroundPoint
  <def>Sample</def>                     = 1.0
  <def>Line</def>                       = 1.0
  <def link="Digital Number">PixelValue</def>                 = 0.0607816
  <def link="Right Ascension">RightAscension</def>             = 65.749350916052 &lt;DEGREE&gt;
  <def>Declination</def>                = -18.390093214966 &lt;DEGREE&gt;
  <def link="Planetocentric Latitude">PlanetocentricLatitude</def>     = 34.444196777763 &lt;DEGREE&gt;
  <def link="Planetographic Latitude">PlanetographicLatitude</def>     = 34.760399604837 &lt;DEGREE&gt;
  <def link="Positive East Longitude">PositiveEastLongitude</def>      = 223.84999971299 &lt;DEGREE&gt;
  <def link="Positive West Longitude">PositiveWestLongitude</def>      = 136.15000028701 &lt;DEGREE&gt;
  <def link="Body Fixed Coordinate">BodyFixedCoordinate</def>        = (-2015.9595225544, -1936.6155808127, 1917.2574858384) &lt;KM&gt;
  <def link="Local Radius">LocalRadius</def>                = 3389756.4767145 &lt;M&gt;
  <def link="Sample Resolution">SampleResolution</def>           = 536.05556350077 &lt;M&gt;
  <def link="Line Resolution">LineResolution</def>             = 536.05556350077 &lt;M&gt;

  <def link="Right Ascension">RightAscension</def>             = 65.749350916052
  <def>Declination</def>                = -18.390093214966
  <def link="Planetocentric Latitude">PlanetocentricLatitude</def>     = 34.444196777763
  <def link="Planetographic Latitude">PlanetographicLatitude</def>     = 34.760399604837
  <def link="Positive East Longitude">PositiveEastLongitude</def>      = 223.84999971299
  <def link="Positive West Longitude">PositiveWestLongitude</def>      = 136.15000028701
  <def link="Body Fixed Coordinate">BodyFixedCoordinate</def>        = (-2015.9595225544, -1936.6155808127, 1917.2574858384) &lt;km&gt;
  <def link="Local Radius">LocalRadius</def>                = 3389756.4767145 &lt;m&gt;
  <def link="Sample Resolution">SampleResolution</def>           = 536.05556350077 &lt;m/pixel&gt;
  <def link="Line Resolution">LineResolution</def>             = 536.05556350077 &lt;m/pixel&gt;
  <def link="Oblique Detector Resolution">ObliqueDetectorResolution</def>  = 151.26661909292 &lt;m/pixel&gt;
  <def link="Oblique Pixel Resolution">ObliquePixelResolution</def>     = 605.06647637166 &lt;m/pixel&gt;
  <def link="Oblique Line Resolution">ObliqueLineResolution</def>      = 605.06647637166 &lt;m/pixel&gt;
  <def link="Oblique Sample Resolution">ObliqueSampleResolution</def>    = 605.06647637166 &lt;m/pixel&gt;
  # Spacecraft Information
  SpacecraftPosition         = (-2025.6211429076, -2130.1417975758, 2009.318879871) &lt;KM&gt;
  <def link="Spacecraft Azimuth">SpacecraftAzimuth</def>          = 0.006855593033889 &lt;DEGREE&gt;
  <def link="Slant Distance">SlantDistance</def>              = 214.52515878961 &lt;KM&gt;
  <def link="Target Center Distance">TargetCenterDistance</def>       = 3560.6189705415 &lt;KM&gt;
  <def link="SubSpacecraft Latitude">SubSpacecraftLatitude</def>      = 34.354896748841 &lt;DEGREE&gt;
  <def link="SubSpacecraft Longitude">SubSpacecraftLongitude</def>     = 226.44072947174 &lt;DEGREE&gt;
  SpacecraftAltitude         = 170.83335389965 &lt;KM&gt;
  <def link="Off Nadir Angle">OffNadirAngle</def>              = 36.149255932304 &lt;DEGREE&gt;
  <def link="SubSpacecraft Ground Azimuth">SubSpacecraftGroundAzimuth</def> = 91.64525294858 &lt;DEGREE&gt;
  SpacecraftPosition         = (-2025.6211429076, -2130.1417975758, 2009.318879871) &lt;km&gt;
  <def link="Spacecraft Azimuth">SpacecraftAzimuth</def>          = 0.006855593033889
  <def link="Slant Distance">SlantDistance</def>              = 214.52515878961 &lt;km&gt;
  <def link="Target Center Distance">TargetCenterDistance</def>       = 3560.6189705415 &lt;km&gt;
  <def link="SubSpacecraft Latitude">SubSpacecraftLatitude</def>      = 34.354896748841
  <def link="SubSpacecraft Longitude">SubSpacecraftLongitude</def>     = 226.44072947174
  SpacecraftAltitude         = 170.83335389965 &lt;km&gt;
  <def link="Off Nadir Angle">OffNadirAngle</def>              = 36.149255932304
  <def link="SubSpacecraft Ground Azimuth">SubSpacecraftGroundAzimuth</def> = 91.64525294858

  # Sun Information
  SunPosition                = (-177337948.13839, 112957442.69098, -33704752.205292) &lt;KM&gt;
  <def link="Sun Azimuth">SubSolarAzimuth</def>            = 172.30460990873 &lt;DEGREE&gt;
  SunPosition                = (-177337948.13839, 112957442.69098, -33704752.205292) &lt;km&gt;
  <def link="Sun Azimuth">SubSolarAzimuth</def>            = 172.30460990873
  SolarDistance             = 1.4234246174889 &lt;AU&gt;
  <def link="SubSolar Latitude">SubSolarLatitude</def>           = -9.1071705738361 &lt;DEGREE&gt;
  <def link="SubSolar Longitude">SubSolarLongitude</def>          = 147.50443340123 &lt;DEGREE&gt;
  <def link="Subsolar Ground Azimuth">SubSolarGroundAzimuth</def>      = 254.69139701227 &lt;DEGREE&gt;
  <def link="SubSolar Latitude">SubSolarLatitude</def>           = -9.1071705738361
  <def link="SubSolar Longitude">SubSolarLongitude</def>          = 147.50443340123
  <def link="Subsolar Ground Azimuth">SubSolarGroundAzimuth</def>      = 254.69139701227

  # Illumination and Other
  <def link="Phase Angle">Phase</def>                      = 120.59515694473 &lt;DEGREE&gt;
  <def link="Incidence Angle">Incidence</def>                  = 84.106289446623 &lt;DEGREE&gt;
  <def link="Emission Angle">Emission</def>                   = 38.288719431206 &lt;DEGREE&gt;
  <def link="North Azimuth">NorthAzimuth</def>               = 261.46910874636 &lt;DEGREE&gt;
  <def link="Phase Angle">Phase</def>                      = 120.59515694473
  <def link="Incidence Angle">Incidence</def>                  = 84.106289446623
  <def link="Emission Angle">Emission</def>                   = 38.288719431206
  <def link="North Azimuth">NorthAzimuth</def>               = 261.46910874636

  # Time
  <def link="Ephemeris Time">EphemerisTime</def>              = -69382819.160519 &lt;seconds&gt;
  <def>UTC</def>                        = 1997-10-20T10:58:37.6570806
  LocalSolarTime             = 17.089704420784 &lt;hour&gt;
  <def link="Solar Longitude">SolarLongitude</def>             = 201.83159041209 &lt;DEGREE&gt;
  <def link="Solar Longitude">SolarLongitude</def>             = 201.83159041209
  Error                      = NULL
  
  # Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.
  LookDirectionBodyFixed     = (0.95457395414683, 0.074906840825054,
                                -0.28840515124058) &lt;DEGREE&gt;
  LookDirectionJ2000         = (0.5482662642052, -0.25280984110143,
                                -0.797177074292) &lt;DEGREE&gt;
  LookDirectionCamera        = (0.0040987946596217, -0.6021663586021,
                                0.79836011702128) &lt;DEGREE&gt;
End_Group
    </pre>
    
@@ -208,11 +205,11 @@ End_Group
    <change name="Ian Humphrey" date="2015-03-03">
      Updated documentation. References #1449.
    </change>
    <change name="Curtis Rose" date="2016-06-29">
      Added units to many of the outputs of the PVL. Fixes #3979.
    </change>
    <change name="Curtis Rose" date="2016-08-01">
      Added spacecraft look direction unit vectors in Body Fixed, J200, and Camera Coordinate Systems. Fixes #4180.
    <change name="Tyler Wilson" date="2016-08-17">      
      Checked in new test data, and added support for changes made to the CameraPointInfo
      and Camera classes that incorporate new estimates for Pixel/Line/Sample/Detetctor resolution
      and now allow a developer to control the order in which fields are output in both PVL and
      CSV format.  References #476, #4100.
    </change>
  </history>

+19 −2
Original line number Diff line number Diff line
@@ -112,7 +112,21 @@ void IsisMain() {
           "NorthAzimuthMinimum," <<
           "NorthAzimuthMaximum," <<
           "NorthAzimuthAverage," <<
           "NorthAzimuthStandardDeviation," << endl;
           "NorthAzimuthStandardDeviation," <<
           "ObliqueResolutionMinimum," <<
           "ObliqueResolutionMaximum," <<
           "ObliqueResolutionAverage," <<
           "ObliqueResolutionStandardDeviation," <<
           "ObliqueLineResolutionMinimum," <<
           "ObliqueLineResolutionMaximum," <<
           "ObliqueLineResolutionAverage," <<
           "ObliqueLineResolutionStandardDeviation," <<
           "ObliqueSampleResolutionMinimum," <<
           "ObliqueSampleResolutionMaximum," <<
           "ObliqueSampleResolutionAverage," <<
           "ObliqueSampleResolutionStandardDeviation," << endl;


      }
      os << FileName(from).expanded() << ",";
      //call the function to write out the values for each group
@@ -128,6 +142,9 @@ void IsisMain() {
      writeFlat(os, camStats.getLocalSolarTimeStat());
      writeFlat(os, camStats.getLocalRaduisStat());
      writeFlat(os, camStats.getNorthAzimuthStat());
      writeFlat(os,camStats.getObliqueResStat());
      writeFlat(os,camStats.getObliqueLineResStat());
      writeFlat(os,camStats.getObliqueSampleResStat());
      os << endl;
    }
  }
@@ -137,7 +154,7 @@ void IsisMain() {
    QString cam_name = "CameraStatistics";

    //Creates new CameraStatistics Table
    TableField fname("Name", Isis::TableField::Text, 20);
    TableField fname("Name", Isis::TableField::Text, 45);
    TableField fmin("Minimum", Isis::TableField::Double);
    TableField fmax("Maximum", Isis::TableField::Double);
    TableField favg("Average", Isis::TableField::Double);
+19 −11
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<application name="camstats" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
<application name="camstats" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">

  <brief>
    Generates and outputs camera statistics for a cube in raw camera geometry
@@ -15,17 +16,20 @@
    average, and standard  deviation values.  The output groups are listed below:
    <blockquote>
    <ul>
      <li><def>Latitude</def></li>
      <li><def>Longitude</def></li>
      <li><def>Sample Resolution</def></li>
      <li><def>Line Resolution</def></li>
      <li><def link="Pixel Resolution">Resolution</def></li>
      <li><def link="Latitude">Latitude</def></li>
      <li><def link="Longitude">Longitude</def></li>
      <li><def link="Sample Resolution">Sample Resolution</def></li>
      <li><def link="Line Resolution">Line Resolution</def></li>
      <li><def link="Pixel Resolution">Pixel Resolution</def></li>
      <li><def link="Oblique Line Resolution">Oblique Line Resolution</def></li>
      <li><def link="Oblique Sample Resolution">Oblique Sample Resolution</def></li>
      <li><def link="Oblique Pixel Resolution">Oblique Pixel Resolution</def></li>
      <li><def>Aspect Ratio</def></li>
      <li><def>Phase Angle</def></li>
      <li><def>Emission Angle</def></li>
      <li><def>Incidence Angle</def></li>
      <li><def>Local Solar Time</def></li>
      <li><def>North Azimuth</def></li>
      <li><def link="Phase Angle">Phase Angle</def></li>
      <li><def link="Emission Angle">EmissionAngle</def></li>
      <li><def link="Incidence Angle">Incidence Angle</def></li>
      <li><def link="Local Solar Time">Local Solar Time</def></li>
      <li><def link="North Azimuth">North Azimuth</def></li>
    </ul>
    </blockquote>
    </p>
@@ -96,6 +100,10 @@
      documentation to clarify the existence and functioning of a few quirks. Addresses redmine
      ticket #175.
    </change>
    <change name="Tyler Wilson"  date="2016-08-17">
      Added statistics for ObliqueLineResolution/ObliqueSampleResolution,
      and Oblique Pixel Resolution. References #476, #4100.
    </change>
  </history>

  <category>
+77 −10
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ void IsisMain() {
  prog.CheckStatus();

  Statistics scaleStat;

  
  Statistics obliqueScaleStat;

  Statistics longitudeStat;
  Statistics latitudeStat;
  Statistics equiRadStat;
@@ -147,15 +151,51 @@ void IsisMain() {
      // Get resolution
      double lowres = cam->LowestImageResolution();
      double hires = cam->HighestImageResolution();
      scaleStat.AddData(&lowres, 1);

      
      double lowObliqueRes = cam->LowestObliqueImageResolution();


      
      double hiObliqueRes= cam->HighestObliqueImageResolution();


      scaleStat.AddData(&hires, 1);
      scaleStat.AddData(&lowres, 1);

      
      obliqueScaleStat.AddData(&hiObliqueRes,1);
      obliqueScaleStat.AddData(&lowObliqueRes,1);


      double pixres = (lowres + hires) / 2.0;

      
      //double obliquePixRes = (lowObliqueRes+hiObliqueRes)/2.0;

      double scale = Scale(pixres, poleRad, eqRad);

      
      //double obliqueScale = Scale(obliquePixRes,poleRad,eqRad);


      mapgrp.addKeyword(PvlKeyword("PixelResolution", toString(pixres)), Pvl::Replace);

      
      //mapgrp.addKeyword(PvlKeyword("ObliquePixelResolution", toString(obliquePixRes)),
      //                  Pvl::Replace);

      mapgrp.addKeyword(PvlKeyword("Scale", toString(scale), "pixels/degree"), Pvl::Replace);
      mapgrp += PvlKeyword("MinPixelResolution", toString(lowres), "meters");
      mapgrp += PvlKeyword("MaxPixelResolution", toString(hires), "meters");

      
      //mapgrp.addKeyword(PvlKeyword("ObliqueScale", toString(obliqueScale), "pixels/degree"),
      //                  Pvl::Replace);
      mapgrp += PvlKeyword("MinPixelResolution", toString(lowres), "meters/pixel");
      mapgrp += PvlKeyword("MaxPixelResolution", toString(hires), "meters/pixel");

      
      mapgrp += PvlKeyword("MinObliquePixelResolution", toString(lowObliqueRes), "meters/pixel");
      mapgrp += PvlKeyword("MaxObliquePixelResolution", toString(hiObliqueRes), "meters/pixel");

      // Get the universal ground range
      double minlat, maxlat, minlon, maxlon;
@@ -186,11 +226,16 @@ void IsisMain() {
//  Construct the output mapping group with statistics
  PvlGroup mapping("Mapping");
  double avgPixRes( (scaleStat.Minimum() + scaleStat.Maximum() ) / 2.0);

  
  //double avgObliquePixRes( (obliqueScaleStat.Minimum() + obliqueScaleStat.Maximum() ) / 2.0);

  double avgLat((latitudeStat.Minimum() + latitudeStat.Maximum()) / 2.0);
  double avgLon((longitudeStat.Minimum() + longitudeStat.Maximum()) / 2.0);
  double avgEqRad((equiRadStat.Minimum() + equiRadStat.Maximum()) / 2.0);
  double avgPoleRad((poleRadStat.Minimum() + poleRadStat.Maximum()) / 2.0);
  double scale  = Scale(avgPixRes, avgPoleRad, avgEqRad);
  //double obliqueScale = Scale(avgObliquePixRes,avgPoleRad,avgEqRad);

  mapping += PvlKeyword("ProjectionName", projection);
  mapping += PvlKeyword("TargetName", target);
@@ -200,15 +245,37 @@ void IsisMain() {
  mapping += PvlKeyword("LongitudeDirection", londir);
  mapping += PvlKeyword("LongitudeDomain", londom);
  mapping += PvlKeyword("PixelResolution", toString(SetRound(avgPixRes, digits)), "meters/pixel");

  
  //mapping += PvlKeyword("ObliquePixelResolution", toString(SetRound(avgObliquePixRes, digits)),
  //                      "meters/pixel");


  mapping += PvlKeyword("Scale", toString(SetRound(scale, digits)), "pixels/degree");
  mapping += PvlKeyword("MinPixelResolution", toString(scaleStat.Minimum()), "meters");
  mapping += PvlKeyword("MaxPixelResolution", toString(scaleStat.Maximum()), "meters");

  
  //mapping += PvlKeyword("ObliqueScale", toString(SetRound(obliqueScale, digits)), "pixels/degree");


  mapping += PvlKeyword("MinPixelResolution", toString(scaleStat.Minimum()), "meters/pixel");
  mapping += PvlKeyword("MaxPixelResolution", toString(scaleStat.Maximum()), "meters/pixel");

  
  mapping += PvlKeyword("MinObliquePixelResolution", toString(obliqueScaleStat.Minimum()),
                        "meters/pixel");
  mapping += PvlKeyword("MaxObliquePixelResolution", toString(obliqueScaleStat.Maximum()),
                        "meters/pixel");

  mapping += PvlKeyword("CenterLongitude", toString(SetRound(avgLon, digits)));
  mapping += PvlKeyword("CenterLatitude",  toString(SetRound(avgLat, digits)));
  mapping += PvlKeyword("MinimumLatitude", toString(MAX(SetFloor(latitudeStat.Minimum(), digits), -90.0)));
  mapping += PvlKeyword("MaximumLatitude", toString(MIN(SetCeil(latitudeStat.Maximum(), digits), 90.0)));
  mapping += PvlKeyword("MinimumLongitude", toString(MAX(SetFloor(longitudeStat.Minimum(), digits), -180.0)));
  mapping += PvlKeyword("MaximumLongitude", toString(MIN(SetCeil(longitudeStat.Maximum(), digits), 360.0)));
  mapping += PvlKeyword("MinimumLatitude", toString(MAX(SetFloor(latitudeStat.Minimum(),
                                                                 digits), -90.0)));
  mapping += PvlKeyword("MaximumLatitude", toString(MIN(SetCeil(latitudeStat.Maximum(),
                                                                 digits), 90.0)));
  mapping += PvlKeyword("MinimumLongitude", toString(MAX(SetFloor(longitudeStat.Minimum(),
                                                                  digits), -180.0)));
  mapping += PvlKeyword("MaximumLongitude", toString(MIN(SetCeil(longitudeStat.Maximum(),
                                                                 digits), 360.0)));

  PvlKeyword clat("PreciseCenterLongitude", toString(avgLon));
  clat.addComment("Actual Parameters without precision applied");
Loading