@@ -67,6 +67,64 @@ TEST(DaleTest, AppLevelPSF) {
6767}
6868
6969
70+ TEST (DaleTest, AppLevelPSFWithAllNames) {
71+ // Get the test name
72+ string testName = ::testing::UnitTest::GetInstance ()->current_test_info ()->name ();
73+
74+ // Create a unique directory for this test case
75+ path testDir = current_path () / testName;
76+ string testdir = testDir.string ();
77+
78+ // create test dir
79+ std::filesystem::create_directory (testDir);
80+
81+ // copy over from gold_standard to test dir
82+ std::filesystem::copy (goldDir/" refim_point_wterm_vlad.psf" , testDir/" refim_point_wterm_vlad.psf" , copy_options::recursive);
83+ std::filesystem::copy (goldDir/" refim_point_wterm_vlad.weight" , testDir/" refim_point_wterm_vlad.weight" , copy_options::recursive);
84+ std::filesystem::copy (goldDir/" refim_point_wterm_vlad.sumwt" , testDir/" refim_point_wterm_vlad.sumwt" , copy_options::recursive);
85+
86+ // Step into test dir
87+ std::filesystem::current_path (testDir);
88+
89+ // note, workdir, psfcutoff and facets are actually not used un acme
90+ string imageName=" refim_point_wterm_vlad.psf" , normtype=" flatnoise" , imType=" psf" ;
91+ string wtImageName=" refim_point_wterm_vlad.weight" , sowImageName=" refim_point_wterm_vlad.sumwt" ;
92+ float pblimit=0.005 , psfcutoff=0.35 ;
93+ bool computePB = true ;
94+ bool normalize_weight = true ;
95+
96+ Dale::dale (imageName,
97+ wtImageName, sowImageName,
98+ normtype, imType, pblimit,
99+ // psfcutoff,
100+ computePB);// normalize_weight);
101+
102+
103+ // Check that the .psf is generated
104+ path p1 (" refim_point_wterm_vlad.psf" );
105+ path p2 (" refim_point_wterm_vlad.pb" );
106+ bool ans = exists (p1) && exists (p2) ;
107+
108+ EXPECT_TRUE ( ans );
109+
110+ float tol = 0.05 ;
111+ float goldValLoc0 = 1 ;
112+ float goldValLoc1 = -0.0070736 ;
113+
114+ PagedImage<Float> psfimage (" refim_point_wterm_vlad.psf" );
115+ EXPECT_NEAR (psfimage (IPosition (4 ,1024 ,1024 ,0 ,0 )), goldValLoc0, tol);
116+ EXPECT_NEAR (psfimage (IPosition (4 ,1050 ,1050 ,0 ,0 )), goldValLoc1, tol);
117+
118+ PagedImage<Float> pbimage (" refim_point_wterm_vlad.pb" );
119+ EXPECT_NEAR (pbimage (IPosition (4 ,1024 ,1024 ,0 ,0 )), goldValLoc0, tol);
120+
121+ // move to parent directory
122+ std::filesystem::current_path (testDir.parent_path ());
123+
124+ remove_all (testDir);
125+ }
126+
127+
70128TEST (DaleTest, AppLevelResidual) {
71129 // Get the test name
72130 string testName = ::testing::UnitTest::GetInstance ()->current_test_info ()->name ();
0 commit comments