mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
aperturePhotometer_test.cpp
Go to the documentation of this file.
1/** \file aperturePhotometer_test.cpp
2 * \brief Tests for the aperturePhotometer production API.
3 */
4
5#include "../../catch2/catch.hpp"
6
8
9/** \defgroup aperturePhotometer_unit_tests aperturePhotometer Unit Tests
10 * \ingroup improc_unit_tests
11 */
12
13namespace unitTest::improc_aperturePhotometer_test
14{
15
16/** \brief Verifies cumulative photometry through mx::improc::aperturePhotometer::cumPhot.
17 *
18 * \ingroup aperturePhotometer_unit_tests
19 * \todo Add mask and background-annulus cases for mx::improc::aperturePhotometer::cumPhot.
20 */
21TEST_CASE( "aperturePhotometer accumulates a centered image", "[improc::aperturePhotometer]" )
22{
25 std::vector<double> cumulative;
26
27 image.setOnes();
28
29 REQUIRE( photometer.resize( image.rows(), image.cols() ) == 0 );
30 REQUIRE( photometer.cumPhot( cumulative, image ) == 0 );
31 REQUIRE( cumulative.size() == 3 );
32 CHECK( cumulative[0] == 1.0 );
33 CHECK( cumulative[1] == 5.0 );
34 CHECK( cumulative[2] == 9.0 );
35}
36
37} // namespace unitTest::improc_aperturePhotometer_test
Class for conducting aperture photometry on an image.
Class for performing aperture photometry on images.
int resize(int sizeX, int sizeY, realT xcen, realT ycen)
Resize the photometer, recalculating the radius vector and index image.
int cumPhot(std::vector< realT > &cumPhot, eigenImage< realT > &im, realT maxr=0)
Get the cumulative photometry of an image as a function of radius.
TEST_CASE("aperturePhotometer accumulates a centered image", "[improc::aperturePhotometer]")
Verifies cumulative photometry through mx::improc::aperturePhotometer::cumPhot.
Eigen::Array< scalarT, -1, -1 > eigenImage
Definition of the eigenImage type, which is an alias for Eigen::Array.