Skip to content

Commit

Permalink
Merge branch 'dev' into footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
scsides authored Jul 15, 2022
2 parents 179fff5 + 9b10811 commit c3a4814
Show file tree
Hide file tree
Showing 74 changed files with 5,557 additions and 1,416 deletions.
3 changes: 3 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
{
"name": "Barrett, Janet"
},
{
"name": "Bauck, Kirsten"
},
{
"name": "Bauers, Joni"
},
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ release.
- Updated the LRO photometry application Lronacpho, to use by default the current 2019 photometric model (LROC_Empirical). The model's coefficients are found in the PVL file that exists in the LRO data/mission/calibration directory. If the old parameter file is provided, the old algorithm(2014) will be used. This functionality is desired for calculation comparisons. Issue: [#4512](https://github.com/USGS-Astrogeology/ISIS3/issues/4512), PR: [#4519](https://github.com/USGS-Astrogeology/ISIS3/pull/4519)
- Added a new application, framestitch, for stitching even and odd push frame images back together prior to processing in other applications. [4924](https://github.com/USGS-Astrogeology/ISIS3/issues/4924)
- Corrected issue where footprintinit would fail with a segmentation error. [4943](https://github.com/USGS-Astrogeology/ISIS3/issues/4943)
- Added changes to lronaccal to use time-dependent dark files for dark correction and use of specific dark files for images with exp code of zero. Also added GTests for lronaccal and refactored code to make callable. Added 3 truth cubes to testing directory. PR[#4520](https://github.com/USGS-Astrogeology/ISIS3/pull/4520)

### Changed
- Updated the LRO calibration application Lrowaccal to add a units label to the RadiometricType keyword of the Radiometry group in the output cube label if the RadiometricType parameter is Radiance. No functionality is changed if the RadiometricType parameter is IOF. Lrowaccal has also been refactored to be callable for testing purposes. Issue: [#4939](https://github.com/USGS-Astrogeology/ISIS3/issues/4939), PR: [#4940](https://github.com/USGS-Astrogeology/ISIS3/pull/4940)
Expand All @@ -52,6 +53,8 @@ release.
- Added check to determine if poles were a valid projection point in ImagePolygon when generating footprint for a map projected image. [#4390](https://github.com/USGS-Astrogeology/ISIS3/issues/4390)
- Fixed the Mars Express HRSC SRC camera and serial number to use the StartTime instead of the StartClockCount [#4803](https://github.com/USGS-Astrogeology/ISIS3/issues/4803)
- Fixed algorithm for applying rolling shutter jitter. Matches implementation in USGSCSM.
- Fixed isis2std incorrectly outputing signed 16 bit tiff files. [#4897](https://github.com/USGS-Astrogeology/ISIS3/issues/4897)
- Fixed CNetCombinePt logging functionality such that only merged points are included in the log. [#4973](https://github.com/USGS-Astrogeology/ISIS3/issues/4973)


## [7.0.0] - 2022-02-11
Expand Down
61 changes: 61 additions & 0 deletions SensorUtilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.10)
project(sensorutilities VERSION 0.0.1 DESCRIPTION "SensorUtilities library")

set(CMAKE_CXX_STANDARD 11)

include(GNUInstallDirs)

set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
endif()

set(SENSOR_UTILITIES_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(SENSOR_UTILITIES_INSTALL_INCLUDE_DIR "include/sensorutilities")
set(SENSOR_UTILITIES_HEADER_FILES "${SENSOR_UTILITIES_INCLUDE_DIR}/SensorUtilities.h"
"${SENSOR_UTILITIES_INCLUDE_DIR}/MathUtils.h")

add_library(sensorutilities SHARED
"${CMAKE_CURRENT_SOURCE_DIR}/src/MathUtils.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/SensorUtilities.cpp")

target_include_directories(sensorutilities
PUBLIC
$<BUILD_INTERFACE:${SENSOR_UTILITIES_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

install(FILES ${SENSOR_UTILITIES_HEADER_FILES} DESTINATION ${SENSOR_UTILITIES_INSTALL_INCLUDE_DIR})
install(TARGETS sensorutilities
EXPORT sensorutilitiesConfig
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION include)
export(TARGETS sensorutilities
NAMESPACE sensorutilities::
FILE "${CMAKE_CURRENT_BINARY_DIR}/sensorutilitiesConfig.cmake")
install(EXPORT sensorutilitiesConfig
NAMESPACE sensorutilities::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})


option (SENSOR_UTILITIES_BUILD_TESTS "Build the tests for the SensorUtilities Library" ON)

if(SENSOR_UTILITIES_BUILD_TESTS)

enable_testing()

add_executable(SensorUtilitiesTests
"${CMAKE_CURRENT_SOURCE_DIR}/tests/MathUtilsTests.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/tests/SensorUtilitiesTests.cpp")

target_link_libraries(SensorUtilitiesTests
gmock_main
sensorutilities)

include(GoogleTest)
gtest_discover_tests(SensorUtilitiesTests
TEST_PREFIX SensorUtilities.)
else()
message(STATUS "Skipping Tests")
endif()
155 changes: 155 additions & 0 deletions SensorUtilities/include/MathUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#ifndef MathUtils_H
#define MathUtils_H

#include <vector>

namespace SensorUtilities {

/**
* Structure for a 2-dimensional spherical ground point.
* Latitude and longitude are in radians.
* Longitude is planeto-centric, positive east, and in [-pi, pi].
*/
struct GroundPt2D {
double lat;
double lon;
};


/**
* Structure for a 3-dimensional spherical ground point.
* Latitude and longitude are in radians.
* Longitude is planeto-centric, positive east, and in [-pi, pi].
* Radius is in meters.
*/
struct GroundPt3D {
double lat;
double lon;
double radius;
};


/**
* Structure for a point in an image.
* The line and sample origin is the upper-left corner at (0, 0).
* The first band in the image is 0.
*/
struct ImagePt {
double line;
double sample;
int band;
};


/**
* Structure for a 3-dimensional rectangular point or vector.
* Distances are in meters.
*/
struct Vec {
double x;
double y;
double z;

/**
* Construct a vector from 3 values
*/
Vec(double a, double b, double c);

/**
* Construct a vector from an array with at least 3 values.
* The data is copied into the structure.
*/
Vec(const double data[3]);

/**
* Create a std::vector from the structure.
* The data in the std:vector is a copy.
*/
operator std::vector<double>() const;
};


bool operator==(const GroundPt2D& lhs, const GroundPt2D& rhs);


bool operator==(const GroundPt3D& lhs, const GroundPt3D& rhs);


bool operator==(const ImagePt& lhs, const ImagePt& rhs);


bool operator==(const Vec& lhs, const Vec& rhs);


Vec operator+(const Vec& lhs, const Vec& rhs);


Vec operator-(const Vec& lhs, const Vec& rhs);


/**
* Compute the separation angle between the vectors defined by three points.
* The separation angle is the angle inscribed by the points
* A, B, and C as follows:
*
* A
* /
* /
* B - - - C
*
* @param aPt The first point
* @param bPt The middle point
* @param cPt The second point
*
* @return The separation angle in radians between 0 and pi
*/
double sepAngle(Vec aPt, Vec bPt, Vec cPt);


/**
* Compute the separation angle between two vectors
*
* @param aVec The first vector
* @param bVec The second vector
*
* @return The separation angle in radians between 0 and pi
*/
double sepAngle(Vec aVec, Vec bVec);


/**
* Compute the magnitude of a vector
*/
double magnitude(Vec vec);


/**
* Compute the distance between two points in 3d space
*/
double distance(Vec start, Vec stop);


/**
* Convert spherical coordinates to rectangular coordinates
*
* @param spherical The spherical coordinate as geocentric latitude, longitude, radius
*
* @return The rectangular coordinate as x, y, z
*/
Vec sphericalToRect(GroundPt3D spherical);


/**
* Convert rectangular coordinates to spherical coordinates.
* Returns 0, 0, 0 if the input is the zero vector.
*
* @param rectangular The rectangular coordinate as x, y, z
*
* @return The spherical coordinate as geocentric latitude, longitude, radius
*/
GroundPt3D rectToSpherical(Vec rectangular);

}

#endif

Loading

0 comments on commit c3a4814

Please sign in to comment.