Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New backplane options for SunIllumination and SurfaceObliqueDetectorResolution have been added to phocube #5488

Merged
merged 12 commits into from
Jul 26, 2024

Conversation

kledmundson
Copy link
Contributor

Description

SunIllumination and SurfaceObliqueDetectorResolution backplane options have been added to the phocube application. Documentation (including an example) and gtests have been added to address these additions. A small (118K) cube has been added to ..isis/tests/data/phocube to support the new gtests. The University of Arizona OSIRIS-REx Image Processing group have added these additional backplanes to their version of phocube.

The SunIlluminationMask (or shadow mask), is particularly useful for small irregular bodies (e.g. comets, asteroids) where terrain may be occluded from solar illumination at the surface intersection point at a given pixel. A pixel in the SunIlluminationMask backplane is either 0 (occluded) or 1 (illuminated), as determined by ray tracing. The existing Oblique Detector Resolution backplane is computed using the local emission angle from the shape model whereas the new Surface Oblique Detector Resolution backplane is computed using the emission angle as determined from the ellipsoid, producing a smoother data plane.

Related Issue

#5467

How Has This Been Validated?

Results of ctest suite...

ctest -R Phocube --output-on-failure

Test project /Users/kledmundson/ISISDev/phocube/Apr082024/ISIS3/build
Start 1493: DefaultCube.FunctionalTestPhocubeDefault
1/11 Test #1493: DefaultCube.FunctionalTestPhocubeDefault ........................ Passed 1.87 sec
Start 1494: DefaultCube.FunctionalTestPhocubeAllBands
2/11 Test #1494: DefaultCube.FunctionalTestPhocubeAllBands ....................... Passed 4.40 sec
Start 1495: DefaultCube.FunctionalTestPhocubeSpecialPixels
3/11 Test #1495: DefaultCube.FunctionalTestPhocubeSpecialPixels .................. Passed 1.74 sec
Start 1496: DefaultCube.FunctionalTestPhocubeMosaic
4/11 Test #1496: DefaultCube.FunctionalTestPhocubeMosaic ......................... Passed 1.74 sec
Start 1497: DefaultCube.FunctionalTestPhocubeNoBandBin
5/11 Test #1497: DefaultCube.FunctionalTestPhocubeNoBandBin ...................... Passed 1.86 sec
Start 1498: DefaultCube.FunctionalTestPhocubeAllDnBands
6/11 Test #1498: DefaultCube.FunctionalTestPhocubeAllDnBands ..................... Passed 1.85 sec
Start 1775: TempTestingFiles.UnitTestMarciCameraPhocubeBandChange
7/11 Test #1775: TempTestingFiles.UnitTestMarciCameraPhocubeBandChange ........... Passed 0.85 sec
Start 2082: OffBodyCube.FunctionalTestPhocubeOffBody
8/11 Test #2082: OffBodyCube.FunctionalTestPhocubeOffBody ........................ Passed 0.90 sec
Start 2083: MiniRFCube.FunctionalTestPhocubeMiniRF
9/11 Test #2083: MiniRFCube.FunctionalTestPhocubeMiniRF .......................... Passed 0.92 sec
Start 2084: Phocube.FunctionalTestPhocubeSunIlluminationMask
10/11 Test #2084: Phocube.FunctionalTestPhocubeSunIlluminationMask ................ Passed 7.95 sec
Start 2085: Phocube.FunctionalTestPhocubeSurfaceObliqueDetectorResolution
11/11 Test #2085: Phocube.FunctionalTestPhocubeSurfaceObliqueDetectorResolution ... Passed 6.83 sec

100% tests passed, 0 tests failed out of 11

Total Test time (real) = 31.11 sec

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Infrastructure change (changes to things like CI or the build system that do not impact users)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added myself to the .zenodo.json document.
  • I have added my user impacting change to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

KrisBecker and others added 7 commits April 19, 2024 15:33
phocube
 * Added robust implementation to determine solar illumination on body considering terrain occlusion
* Added app test for this option
* Updated documentation describing this new feature
* phocube - This new plane is in addition to the existing ObliqueDetectorResolution. The difference is ObliqueDetectorResolution uses the local (shape model) emission angle and SurfaceObliqueDetectorResolution uses the emission angle calculated from the ellipsoid.

Signed-off-by: Kris J. Becker <kbecker@orex.lpl.arizona.edu>
…EDETECTORRESOLUTION backplanes. Added gtests for these options. Updated documentation and added an example. Addresses DOI-USGS#5467.
…d via cherry-pick from U. of Arizona codebase. Addresses DOI-USGS#5467.
…ANGELOG.md for phocube backplane additions. Addresses DOI-USGS#5467.
@kledmundson
Copy link
Contributor Author

For what it's worth I have run the entire test suite on this branch (OSX 12.7. 5 Monterey), comparing to ISIS dev as a baseline (also run on OSX). Test failures were identical between the two and are shown below...

Module Test Failures
891 - cassini_module_test_vims (Failed)
906 - clementine_module_test_clementine (Failed)
913 - dawn_module_test_dawn (Failed)
937 - hayabusa_module_test_fullframe (Failed)
938 - hayabusa_module_test_subframe (Failed)
983 - lro_module_test_lroc (Failed)
1025 - mex_module_test_hrsc (Failed)
1040 - mgs_module_test_moc (Failed)
1091 - mro_module_test_hirise (Failed)
1115 - osirisrex_module_test_mapcam (Failed)

App Test Failures
365 - ascii2isis_app_test_errors (Failed)
437 - cubeit_app_test_badinputs (Failed)
652 - phoemplocal_app_test_case01 (Failed)
699 - ringscam2map_app_test_combination4 (Failed)
702 - ringscam2map_app_test_matchmap (Failed)
723 - skyrange_app_test_default (Failed)
739 - spicefit_app_test_default (Failed)
740 - spiceinit_app_test_shapemodel (Failed)
798 - deltack_app_test_directVIMS (Failed)
899 - clemhirescal_app_test_default (Failed)
900 - clemnircal_app_test_default (Failed)
903 - clemuvviscal_app_test_filters (Failed)
904 - clemuvviscal_app_test_noTemp (Failed)
905 - clemuvviscal_app_test_uncompressed (Failed)
933 - hyb1pds4gen_app_test_amicaitokawa2diof (Failed)
934 - hyb1pds4gen_app_test_mars (Failed)
935 - hyb1pds4gen_app_test_nirsitokawa3drefl (Failed)
1014 - mdiscal_app_test_warnings (Failed)
1017 - mdisedrinfo_app_test_default (Failed)
1018 - mdisedrinfo_app_test_kernelchk (Failed)
1019 - mdisedrinfo_app_test_multi (Failed)
1069 - hijitter_app_test_default (Failed)
1070 - hijitter_app_test_withCrop (Failed)
1100 - thmbasemap1_app_test_dayonly (Failed)
1101 - thmbasemap1_app_test_nightonly (Failed)

Unit Test Failures
78 - isis_unit_test_Cube (Failed)
142 - isis_unit_test_JP2Importer (Failed)
143 - isis_unit_test_Kernels (Failed)
178 - isis_unit_test_NaifDskShape (Failed)
185 - isis_unit_test_NumericalApproximation (Failed)

Other Test Failures
299 - DefaultCube.FunctionalTestCaminfoCsv (Timeout)
637 - TempTestingFiles.Mvic2IsisTestTdiMode (Failed)
638 - TempTestingFiles.Mvic2IsisTestPanMode (Failed)
639 - TempTestingFiles.Mvic2IsisTestFrameMode (Failed)
640 - TempTestingFiles.Mvic2IsisTestUncalibrated (Failed)
650 - TempTestingFiles.FunctionalTestStd2isisJp2 (Failed)
660 - TempTestingFiles.UnitTestImageImporterStd2IsisJp2 (Failed)
736 - MroCtxCube.FunctionalTestCtxcalMonthlyFlatfile (Failed)
834 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KGray (Failed)
835 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KU16 (Failed)
836 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KS16 (Failed)
846 - SmallARGBCube.FunctionalTestsIsis2StdJpeg2KRGB (Failed)
847 - SmallARGBCube.FunctionalTestsIsis2StdJpeg2KARGB (Failed)
977 - Spiceinit.TestSpiceinitPredictAndReconCk (Failed)

@amystamile-usgs
Copy link
Contributor

Unable to run tests due to merge conflicts.

@kledmundson
Copy link
Contributor Author

kledmundson commented Jul 16, 2024 via email

@amystamile-usgs
Copy link
Contributor

Tests passing for this PR. Ready for a review. @acpaquette Do you have time to look at this PR?

Copy link
Collaborator

@acpaquette acpaquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, couple things to address then this can get merged

Comment on lines 625 to 628
double emission = cam->EmissionAngle() * DEG2RAD;
if ( emission < HALFPI ) {
out[index] = cam->DetectorResolution() / cos(emission);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be replaced with the following?

out[index] = cam->ObliqueDetectorResolution(useLocal=false);

This should be the original math before it was changed to default to use the local emission

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kledmundson Apologies for any confusion, the set of 4 lines I highlighted here can be replaced with the ObliqueDetectorResolution call. So this:

double emission = cam->EmissionAngle() * DEG2RAD;
if ( emission < HALFPI ) {
    out[index] = cam->ObliqueDetectorResolution(false) / cos(emission);
}

Should become this:

out[index] = cam->ObliqueDetectorResolution(false);

As the code in the camera function looks like this:

    if(!HasSurfaceIntersection()) {
      return Isis::Null;
    }

    double thetaRad;
    double emissionDeg;

    if(useLocal) {
      Angle phase, emission, incidence;
      bool success;

      LocalPhotometricAngles(phase, incidence, emission, success);
      emissionDeg = (success) ? emission.degrees() : Isis::Null;
    }
    else {
      emissionDeg = EmissionAngle();
    }

    thetaRad = emissionDeg*DEG2RAD;

    if (thetaRad < HALFPI) {
      return DetectorResolution()/cos(thetaRad);

    }

    return Isis::Null;

So if we run with useLocal set to false we run the following:

    if(!HasSurfaceIntersection()) {
      return Isis::Null;
    }

    double thetaRad;
    double emissionDeg;

    emissionDeg = EmissionAngle();
    thetaRad = emissionDeg*DEG2RAD;

    if (thetaRad < HALFPI) {
      return DetectorResolution()/cos(thetaRad);

    }

    return Isis::Null;

isis/src/base/apps/phocube/phocube.xml Outdated Show resolved Hide resolved
@kledmundson
Copy link
Contributor Author

kledmundson commented Jul 23, 2024 via email

kledmundson and others added 3 commits July 23, 2024 15:28
…->ObliqueDetectorResolution(false), where "false" refers to the useLocal parameter; and 2) fixed typo in phocube.xml. Addresses DOI-USGS#5467.
@kledmundson
Copy link
Contributor Author

kledmundson commented Jul 23, 2024 via email

@kledmundson
Copy link
Contributor Author

Actually, now this test is failing...

FunctionalTestPhocubeSurfaceObliqueDetectorResolution

Looking at it now.

@amystamile-usgs
Copy link
Contributor

Tests look good with recent changes.

@acpaquette acpaquette merged commit 87b7704 into DOI-USGS:dev Jul 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants