From 1567a71a9ebafd925f8ee4c17cc0aca720105f12 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Mon, 14 Mar 2022 16:05:05 +0100 Subject: [PATCH] Add unit test for GSkyMap::correlate() method (#3440) --- test/test_GSky.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/test_GSky.cpp b/test/test_GSky.cpp index cca3990..de5f5ee 100644 --- a/test/test_GSky.cpp +++ b/test/test_GSky.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * test_GSky.cpp - Test sky module * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2021 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -1489,6 +1489,21 @@ void TestGSky::test_GSkyMap(void) } test_value(sum_smooth2, ref_smooth, "Check GAUSSIAN smoothing"); + // Load map for correlation + GSkyMap map_correlate(sky_map); + + // Correlate map using DISK kernel + GSkyMap map_correlate1 = map_correlate; + map_correlate1.correlate("DISK", 0.2); + map_correlate1.save("test_map_correlate_disk.fits", true); + + // Compute sum of correlated sky map + double sum_correlate1 = 0.0; + for (int pix = 0; pix < map_correlate1.npix(); ++pix) { + sum_correlate1 += map_correlate1(pix); + } + test_value(sum_correlate1, 322194236.407357, "Check DISK correlation"); + // Trim the skymap based on pixels int startx = 2; int stopx = 5; -- libgit2 0.21.4