Skip to content

Commit

Permalink
Added files for do_makemultimages_test.sh, which (mostly) passes
Browse files Browse the repository at this point in the history
  • Loading branch information
perwin committed Jun 23, 2024
1 parent ad8e47c commit 0644cc1
Show file tree
Hide file tree
Showing 30 changed files with 441 additions and 29 deletions.
58 changes: 29 additions & 29 deletions do_makemultimages_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,45 +50,45 @@ rm temptest/multimage_diff-sizes*.fits
rm temptest/multimage-with-imageinfo_*.fits

# 3 images, one function block, using --image-info
./makemultimages tests_for_makemultimage/config_for_globalparams.txt -o temptest/multimage-with-imageinfo --image-info=tests_for_makemultimage/imageinfo_3image.txt > temptest/test_dump2
./makemultimages tests/makemultimages_reference/config_for_globalparams.txt -o temptest/multimage-with-imageinfo --image-info=tests/makemultimages_reference/imageinfo_3image.txt > temptest/test_dump2

./makemultimages tests_for_makemultimage/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_b --image-info=tests_for_makemultimage/imageinfo_3image_b.txt > temptest/test_dump2b
./makemultimages tests/makemultimages_reference/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_b --image-info=tests/makemultimages_reference/imageinfo_3image_b.txt > temptest/test_dump2b

./makemultimages tests_for_makemultimage/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_c --image-info=tests_for_makemultimage/imageinfo_3image_c.txt > temptest/test_dump2c
./makemultimages tests/makemultimages_reference/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_c --image-info=tests/makemultimages_reference/imageinfo_3image_c.txt > temptest/test_dump2c

./makemultimages tests_for_makemultimage/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_d --image-info=tests_for_makemultimage/imageinfo_3image_d.txt > temptest/test_dump2d
./makemultimages tests/makemultimages_reference/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_d --image-info=tests/makemultimages_reference/imageinfo_3image_d.txt > temptest/test_dump2d

./makemultimages tests_for_makemultimage/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_e --image-info=tests_for_makemultimage/imageinfo_3image_e.txt > temptest/test_dump2d
./makemultimages tests/makemultimages_reference/config_for_globalparams.txt -o temptest/multimage-with-imageinfo_e --image-info=tests/makemultimages_reference/imageinfo_3image_e.txt > temptest/test_dump2d


# model with two function blocks, 3 images (offsets only), using --image-info
./makemultimages tests_for_makemultimage/config_for_globalparams_2blocks.txt -o temptest/multimage-with-imageinfo_2blocks --image-info=tests_for_makemultimage/imageinfo_3image.txt > temptest/test_dump3
./makemultimages tests/makemultimages_reference/config_for_globalparams_2blocks.txt -o temptest/multimage-with-imageinfo_2blocks --image-info=tests/makemultimages_reference/imageinfo_3image.txt > temptest/test_dump3


# model with 2 images, different sizes, using --image-info
./makemultimages tests_for_makemultimage/config_for_globalparams_mult-sizes.txt -o temptest/multimage_diff-sizes --image-info=tests_for_makemultimage/imageinfo_2sizes.txt > temptest/test_dump5
./makemultimages tests/makemultimages_reference/config_for_globalparams_mult-sizes.txt -o temptest/multimage_diff-sizes --image-info=tests/makemultimages_reference/imageinfo_2sizes.txt > temptest/test_dump5

# model with 3 images, different sizes, 1st and 3rd with PSF, using --image-info
./makemultimages tests_for_makemultimage/config_for_globalparams_mult-sizes.txt -o temptest/multimage_diff-sizes-psf --image-info=tests_for_makemultimage/imageinfo_3sizes-with-psf.txt > temptest/test_dump6
./makemultimages tests/makemultimages_reference/config_for_globalparams_mult-sizes.txt -o temptest/multimage_diff-sizes-psf --image-info=tests/makemultimages_reference/imageinfo_3sizes-with-psf.txt > temptest/test_dump6

# tests of PSF oversampling [NO COMPARISON WITH REFERENCE YET]
./makemultimages tests/makeimage_reference/config_makeimage_gauss-oversample.dat --image-info tests_for_makemultimage/imageinfo_2sizes-with-oversampled-psf.txt -o temptest/multimage_osamp > temptest/test_dump7a
./makemultimages tests/makeimage_reference/config_makeimage_gauss-oversample.dat --image-info tests/makemultimages_reference/imageinfo_2sizes-with-oversampled-psf.txt -o temptest/multimage_osamp > temptest/test_dump7a

# tests of multi-region PSF oversampling [NO COMPARISON WITH REFERENCE YET]
./makemultimages tests/makeimage_reference/config_makeimage_gauss-oversample.dat --image-info tests_for_makemultimage/imageinfo_2sizes-with-2oversampled-psf.txt -o temptest/multimage_2osamp > temptest/test_dump7b
./makemultimages tests/makeimage_reference/config_makeimage_gauss-oversample.dat --image-info tests/makemultimages_reference/imageinfo_2sizes-with-2oversampled-psf.txt -o temptest/multimage_2osamp > temptest/test_dump7b




echo ""

echo -n "*** Diff comparison with archives: printing function list... "
if (diff --brief temptest/test_dump0 tests/makemultimages_textout0)
if (diff --brief temptest/test_dump0 tests/makemultimages_reference/makemultimages_textout0)
then
echo " OK"
else
echo "Diff output:"
diff temptest/test_dump0 tests/makemultimages_textout0
diff temptest/test_dump0 tests/makemultimages_reference/makemultimages_textout0
STATUS+=1
fi

Expand All @@ -97,23 +97,23 @@ echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_0.
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_0.fits tests/multimagetest_0.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_0.fits tests/makemultimages_reference/multimagetest_0.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_1... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_1.fits tests/multimagetest_1.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_1.fits tests/makemultimages_reference/multimagetest_1.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2.fits tests/multimagetest_2.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2.fits tests/makemultimages_reference/multimagetest_2.fits
STATUS+=$?
fi

Expand All @@ -122,23 +122,23 @@ echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_b_
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_b_2.fits tests/multimagetest_2b.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_b_2.fits tests/makemultimages_reference/multimagetest_2b.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_c_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_c_2.fits tests/multimagetest_2c.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_c_2.fits tests/makemultimages_reference/multimagetest_2c.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_d_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_d_2.fits tests/multimagetest_2d.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_d_2.fits tests/makemultimages_reference/multimagetest_2d.fits
STATUS+=$?
fi

Expand All @@ -147,15 +147,15 @@ echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_e_
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_e_1.fits tests/multimagetest_1.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_e_1.fits tests/makemultimages_reference/multimagetest_1.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_e_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_e_2.fits tests/multimagetest_2d.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_e_2.fits tests/makemultimages_reference/multimagetest_2d.fits
STATUS+=$?
fi

Expand All @@ -164,42 +164,42 @@ echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_2b
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_0.fits tests/multimagetest_2blocks_0.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_0.fits tests/makemultimages_reference/multimagetest_2blocks_0.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_2blocks_1... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_1.fits tests/multimagetest_2blocks_offset_1.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_1.fits tests/makemultimages_reference/multimagetest_2blocks_offset_1.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage-with-imageinfo_2blocks_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_2.fits tests/multimagetest_2blocks_offset_2.fits
./python/compare_fits_files.py temptest/multimage-with-imageinfo_2blocks_2.fits tests/makemultimages_reference/multimagetest_2blocks_offset_2.fits
STATUS+=$?
fi


# archive images generated by
# makeimage[v1.4] -c tests_for_makemultimage/config_for_globalparams_2sizes.txt
# makeimage[v1.4] -c tests/makemultimages_reference/config_for_globalparams_2sizes.txt
echo -n "*** Diff comparison of image with archives: multimage_diff-sizes_0... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage_diff-sizes_0.fits tests/multimagetest_diff-sizes_0.fits
./python/compare_fits_files.py temptest/multimage_diff-sizes_0.fits tests/makemultimages_reference/multimagetest_diff-sizes_0.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage_diff-sizes_1... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage_diff-sizes_1.fits tests/multimagetest_diff-sizes_1.fits
./python/compare_fits_files.py temptest/multimage_diff-sizes_1.fits tests/makemultimages_reference/multimagetest_diff-sizes_1.fits
STATUS+=$?
fi

Expand All @@ -210,23 +210,23 @@ echo -n "*** Diff comparison of image with archives: multimage_diff-sizes-psf_0.
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_0.fits tests/multimagetest_diff-sizes-psf_0.fits
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_0.fits tests/makemultimages_reference/multimagetest_diff-sizes-psf_0.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage_diff-sizes-psf_1... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_1.fits tests/multimagetest_diff-sizes-psf_1.fits
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_1.fits tests/makemultimages_reference/multimagetest_diff-sizes-psf_1.fits
STATUS+=$?
fi

echo -n "*** Diff comparison of image with archives: multimage_diff-sizes-psf_2... "
if [ $do_fits_tests = "1" ]
then
echo ""
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_2.fits tests/multimagetest_diff-sizes-psf_2.fits
./python/compare_fits_files.py temptest/multimage_diff-sizes-psf_2.fits tests/makemultimages_reference/multimagetest_diff-sizes-psf_2.fits
STATUS+=$?
fi

Expand Down
14 changes: 14 additions & 0 deletions tests/makemultimages_reference/config_for_globalparams.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# first function set: exponential + sersic, at (x0,y0) = (1,1)
X0 31.0 0,4 # x-coordinate
Y0 31.0 0,4
FUNCTION Exponential # here is a comment
PA 95.0 0,180 # this means we restrict PA to 0 <= PA <= 180
ell 0.45 0,1
I_0 90.0 0,1000
h 15.0 0,1000
FUNCTION Sersic
PA 90.0
ell 0.2
n 2.5
I_e 10.0
r_e 10.0
22 changes: 22 additions & 0 deletions tests/makemultimages_reference/config_for_globalparams_2blocks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# first function set: exponential + sersic, at (x0,y0) = (1,1)
X0 31.0 0,4 # x-coordinate
Y0 31.0 0,4
FUNCTION Exponential # here is a comment
PA 95.0 0,180 # this means we restrict PA to 0 <= PA <= 180
ell 0.45 0,1
I_0 90.0 0,1000
h 15.0 0,1000
FUNCTION Sersic
PA 90.0
ell 0.2
n 2.5
I_e 10.0
r_e 10.0

X0 50.0
Y0 45.0
FUNCTION Gaussian
PA 0
ell 0.5
I_0 100.0
sigma 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
NCOLS 32
NROWS 32
# first function set: exponential + sersic, at (x0,y0) = (1,1)
X0 10.0 0,4 # x-coordinate
Y0 20.0 0,4
FUNCTION Exponential # here is a comment
PA 95.0 0,180 # this means we restrict PA to 0 <= PA <= 180
ell 0.45 0,1
I_0 90.0 0,1000
h 15.0 0,1000
FUNCTION Sersic
PA 90.0
ell 0.2
n 2.5
I_e 10.0
r_e 10.0
Binary file added tests/makemultimages_reference/flatsky_64x64.fits
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# image-info file for testing makemultimages
#
# First is the reference image, for which we leave things like weight, PIXEL_SCALE,
# FLUX_SCALE, and IMAGE_PA unspecified so they assume their default values
# image-name weight
IMAGE_START
NCOLS 200
NROWS 200

# now we have the second image
IMAGE_START
NCOLS 200
NROWS 200
PSF tests/psf_standard.fits
OVERSAMPLED_PSF tests/psf_oversamp.fits
OVERSAMPLED_REGION 100:110,100:110
OVERSAMPLED_REGION 40:45,30:40
OVERSAMPLE_SCALE 3
PIXEL_SCALE 1.0 fixed # pixels in this image are PIXEL_SCALE * reference image
IMAGE_PA 0.0 fixed
FLUX_SCALE 1.0 fixed
X0 105.2377
Y0 105.4582
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# image-info file for testing makemultimages
#
# First is the reference image, for which we leave things like weight, PIXEL_SCALE,
# FLUX_SCALE, and IMAGE_PA unspecified so they assume their default values
# image-name weight
IMAGE_START
NCOLS 200
NROWS 200

# now we have the second image
IMAGE_START
NCOLS 200
NROWS 200
PSF tests/psf_standard.fits
OVERSAMPLED_PSF tests/psf_oversamp.fits
OVERSAMPLED_REGION 100:110,100:110
OVERSAMPLE_SCALE 3
PIXEL_SCALE 1.0 fixed # pixels in this image are PIXEL_SCALE * reference image
IMAGE_PA 0.0 fixed
FLUX_SCALE 1.0 fixed
X0 105.2377
Y0 105.4582
24 changes: 24 additions & 0 deletions tests/makemultimages_reference/imageinfo_2sizes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# First is the reference image, for which we leave things like weight, PIXEL_SCALE,
# FLUX_SCALE, and IMAGE_PA unspecified so they assume their default values
# image-name weight
IMAGE_START
DATA n100_2mass.fit
NCOLS 32
NROWS 32
GAIN 2.3
READNOISE 4.5
ORIGINAL_SKY 11.344

# now we have the second image
IMAGE_START
DATA n100_hst-acs-wfc_ss.fits[250:350,200:300] 1.0
NCOLS 40
NROWS 40
GAIN 1.5
READNOISE 0.6
ORIGINAL_SKY 2.359
PIXEL_SCALE 1.0 fixed # pixels in this image are PIXEL_SCALE * reference image
IMAGE_PA 0.0 fixed
FLUX_SCALE 10.0 fixed
X0 20
Y0 30
38 changes: 38 additions & 0 deletions tests/makemultimages_reference/imageinfo_3image.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# First is the reference image, for which we leave things like weight, PIXEL_SCALE,
# FLUX_SCALE, and IMAGE_PA unspecified so they assume their default values
# image-name weight
IMAGE_START
DATA n100_2mass.fit
NCOLS 64
NROWS 64
GAIN 2.3
READNOISE 4.5
ORIGINAL_SKY 11.344

# now we have the second image
IMAGE_START
DATA n100_hst-acs-wfc_ss.fits[250:350,200:300] 1.0
NCOLS 64
NROWS 64
GAIN 1.5
READNOISE 0.6
ORIGINAL_SKY 2.359
PIXEL_SCALE 1.0 fixed # pixels in this image are PIXEL_SCALE * reference image
IMAGE_PA 0.0 fixed
FLUX_SCALE 1.0 fixed
X0 40
Y0 40

# third image
IMAGE_START
DATA n100_hst-acs-wfc_ss.fits[250:350,200:300] 1.0
NCOLS 64
NROWS 64
GAIN 1.0
READNOISE 0.6
ORIGINAL_SKY 2.359
PIXEL_SCALE 1.0 fixed # pixels in this image are PIXEL_SCALE * reference image
IMAGE_PA 0.0 fixed # this image is rotated 22.4 deg CCW w.r.t. reference image
FLUX_SCALE 1.0 10,20 # flux should be multiplied by FLUX_SCALE
X0 10
Y0 20
Loading

0 comments on commit 0644cc1

Please sign in to comment.