Skip to content

Commit

Permalink
Updated do_imfit_tests to check output against updated references fil…
Browse files Browse the repository at this point in the history
…es (macOS x86-64 outputs)
  • Loading branch information
perwin committed Jun 20, 2024
1 parent fab106b commit 00a9884
Show file tree
Hide file tree
Showing 15 changed files with 696 additions and 26 deletions.
24 changes: 12 additions & 12 deletions do_imfit_tests
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ echo -n "*** Diff comparison with archives: first test... "
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout2 temptest/test_dump2 --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout2 temptest/test_dump2 --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (take 2)... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout3 temptest/test_dump3 --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout3 temptest/test_dump3 --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (N-M simplex fit)... "
Expand All @@ -226,28 +226,28 @@ then
fi

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (L-M fit with --loud)... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout3d temptest/test_dump3d --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout3d temptest/test_dump3d --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (L-M fit with --loud, fixed parameter)... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout3d2 temptest/test_dump3d2 --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout3d2 temptest/test_dump3d2 --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (L-M fit using sigma map)... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout3e temptest/test_dump3e --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: tiny SDSS cutout image (L-M fit using variance map)... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout3e2 temptest/test_dump3e2 --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout3e2 temptest/test_dump3e2 --skip-last=3
STATUS+=$?


echo -n "*** Diff comparison with archives: fit to larger (rectangular) SDSS image w/ PSF convolution... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout4 temptest/test_dump4 --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout4 temptest/test_dump4 --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: same, but using counts/sec image + --exptime option... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout4b temptest/test_dump4b --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout4b temptest/test_dump4b --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: chisquare-only calculation... "
Expand Down Expand Up @@ -290,22 +290,22 @@ STATUS+=$?

echo -n "*** Diff comparison with archives: Poisson-MLR-stat fit to problematic image (+ L-M solver)... "
tail -n 18 temptest/test_dump5d > temptest/test_dump5d_tail
./python/diff_printouts.py tests/imfit_reference/imfit_textout5d_tail temptest/test_dump5d_tail --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout5d_tail temptest/test_dump5d_tail --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: bootstrap-resampling output... "
tail -n 7 temptest/temp_bootstrap_output.dat > temptest/temp_bootstrap_output_tail
./python/diff_printouts.py tests/bootstrap_output_seed10_tail.dat temptest/temp_bootstrap_output_tail
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/bootstrap_output_seed10_tail.dat temptest/temp_bootstrap_output_tail
STATUS+=$?

echo -n "*** Diff comparison with archives: bootstrap-resampling printout (with image offset)... "
tail -n 18 temptest/test_dump5e > temptest/test_dump5e_tail
./python/diff_printouts.py tests/imfit_reference/imfit_textout5e_tail temptest/test_dump5e_tail --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout5e_tail temptest/test_dump5e_tail --skip-last=3
STATUS+=$?

echo -n "*** Diff comparison with archives: bootstrap-resampling output (with image offset)... "
tail -n 7 temptest/temp_bootstrap_output2.dat > temptest/temp_bootstrap_output2_tail
./python/diff_printouts.py tests/bootstrap_output_seed10_2_tail.dat temptest/temp_bootstrap_output2_tail
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/bootstrap_output_seed10_2_tail.dat temptest/temp_bootstrap_output2_tail
STATUS+=$?


Expand Down Expand Up @@ -400,7 +400,7 @@ fi


echo -n "*** Diff comparison with archives: fitting with bicubic-interpolated PSF image... "
./python/diff_printouts.py tests/imfit_reference/imfit_textout8a temptest/test_dump8a --skip-last=3
./python/diff_printouts.py tests/imfit_reference/macos_x86-64/imfit_textout8a temptest/test_dump8a --skip-last=3
STATUS+=$?


Expand Down
7 changes: 0 additions & 7 deletions tests/bootstrap_output_seed10_2_tail.dat

This file was deleted.

7 changes: 0 additions & 7 deletions tests/bootstrap_output_seed10_tail.dat

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Bootstrap resampling output (5 iterations requested):
# X0_1 Y0_1 PA_1 ell_1 n_1 I_e_1 r_e_1
32.94726551 34.12621527 18.03158181 0.2333425815 2.321036457 22.04684347 56.50895582
33.00120115 34.07993250 18.19980518 0.2345082359 2.370800655 20.95445017 58.43736083
32.96236884 34.12467736 18.19960251 0.2352328136 2.431600328 19.59597255 61.31643342
33.00436662 34.08148751 17.97633490 0.2363263502 2.355999091 21.08248554 58.39570695
32.96361379 34.07080346 18.65985525 0.2316460605 2.336338391 21.77805224 56.91927431
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Bootstrap resampling output (5 iterations requested):
# X0_1 Y0_1 PA_1 ell_1 n_1 I_e_1 r_e_1
32.95308050 34.11944163 18.01701865 0.2328484183 2.415204213 19.68006019 61.34187501
32.90890710 34.09187402 18.67735766 0.2367431340 2.384060118 20.18404995 60.52670153
32.93601461 34.02577178 18.31447793 0.2332945762 2.369359219 20.62288987 59.41423744
32.96227662 34.10840801 18.41373693 0.2352079600 2.404208278 20.09082986 60.45350721
32.92217910 34.05858507 17.96043499 0.2432690140 2.334375758 21.21359851 58.76094479
57 changes: 57 additions & 0 deletions tests/imfit_reference/macos_x86-64/imfit_textout2
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Image file = tests/ic3478rss_64x64.fits
configuration file = tests/imfit_reference/imfit_config_ic3478_64x64.dat
original sky level = 130.1 ADU
gain = 4.725 e-/ADU
read noise = 4.3 e-
Reading data image ("tests/ic3478rss_64x64.fits") ...
naxis1 [# pixels/row] = 64, naxis2 [# pixels/col] = 64; nPixels_tot = 4096
* No PSF image supplied -- no image convolution will be done!
* No noise image supplied ... will generate noise image from input data image.
Function: Sersic
7 total parameters
Model Object: 4096 data values (pixels)
ModelObject: mask vector applied to weight vector. (4096 valid pixels remain)
7 free parameters (4089 degrees of freedom)
Estimated memory use: 458752 bytes (448.0 KB)

Performing fit by minimizing chi^2 (data-based errors):
Calling Levenberg-Marquardt solver ...
mpfit iteration 1: fit statistic = 263212.803059
mpfit iteration 2: fit statistic = 38837.128651
mpfit iteration 3: fit statistic = 16396.742094
mpfit iteration 4: fit statistic = 15914.301369
mpfit iteration 5: fit statistic = 12632.941400
mpfit iteration 6: fit statistic = 12632.237160
mpfit iteration 7: fit statistic = 8036.249910
mpfit iteration 8: fit statistic = 5002.948200
mpfit iteration 9: fit statistic = 4569.384236
mpfit iteration 10: fit statistic = 4555.953001
mpfit iteration 11: fit statistic = 4555.947657
mpfit iteration 12: fit statistic = 4555.947654

*** mpfit status = 1 -- SUCCESS: Convergence in fit-statistic value.
CHI-SQUARE = 4555.947654 (4089 DOF)
INITIAL CHI^2 = 494330.961892
NPAR = 7
NFREE = 7
NPEGGED = 0
NITER = 13
NFEV = 98

Reduced Chi^2 = 1.114196
AIC = 4569.975051, BIC = 4614.172017

X0 32.9439 # +/- 0.0128
Y0 34.0933 # +/- 0.0156
FUNCTION Sersic
PA 18.2612 # +/- 0.30986 deg (CCW from +y axis)
ell 0.235989 # +/- 0.0023165
n 2.40028 # +/- 0.018072
I_e 20.0094 # +/- 0.40396 counts/pixel
r_e 60.7612 # +/- 0.86063 pixels

Saving best-fit parameters in file "bestfit_parameters_imfit.dat"

(Elapsed time: 0.035381 sec for fit, 0.037554 sec total)
Done!

57 changes: 57 additions & 0 deletions tests/imfit_reference/macos_x86-64/imfit_textout3
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Image file = tests/ic3478rss_64x64.fits
configuration file = tests/imfit_reference/imfit_config_ic3478_64x64b.dat
Value from config file: gain = 4.725000 e-/ADU
Value from config file: read noise = 4.300000 e-
Value from config file: original sky = 130.100000
Reading data image ("tests/ic3478rss_64x64.fits") ...
naxis1 [# pixels/row] = 64, naxis2 [# pixels/col] = 64; nPixels_tot = 4096
* No PSF image supplied -- no image convolution will be done!
* No noise image supplied ... will generate noise image from input data image.
Function: Sersic
7 total parameters
Model Object: 4096 data values (pixels)
ModelObject: mask vector applied to weight vector. (4096 valid pixels remain)
7 free parameters (4089 degrees of freedom)
Estimated memory use: 458752 bytes (448.0 KB)

Performing fit by minimizing chi^2 (data-based errors):
Calling Levenberg-Marquardt solver ...
mpfit iteration 1: fit statistic = 263212.803059
mpfit iteration 2: fit statistic = 38837.128651
mpfit iteration 3: fit statistic = 16396.742094
mpfit iteration 4: fit statistic = 15914.301369
mpfit iteration 5: fit statistic = 12632.941400
mpfit iteration 6: fit statistic = 12632.237160
mpfit iteration 7: fit statistic = 8036.249910
mpfit iteration 8: fit statistic = 5002.948200
mpfit iteration 9: fit statistic = 4569.384236
mpfit iteration 10: fit statistic = 4555.953001
mpfit iteration 11: fit statistic = 4555.947657
mpfit iteration 12: fit statistic = 4555.947654

*** mpfit status = 1 -- SUCCESS: Convergence in fit-statistic value.
CHI-SQUARE = 4555.947654 (4089 DOF)
INITIAL CHI^2 = 494330.961892
NPAR = 7
NFREE = 7
NPEGGED = 0
NITER = 13
NFEV = 98

Reduced Chi^2 = 1.114196
AIC = 4569.975051, BIC = 4614.172017

X0 32.9439 # +/- 0.0128
Y0 34.0933 # +/- 0.0156
FUNCTION Sersic
PA 18.2612 # +/- 0.30986 deg (CCW from +y axis)
ell 0.235989 # +/- 0.0023165
n 2.40028 # +/- 0.018072
I_e 20.0094 # +/- 0.40396 counts/pixel
r_e 60.7612 # +/- 0.86063 pixels

Saving best-fit parameters in file "bestfit_parameters_imfit.dat"

(Elapsed time: 0.036661 sec for fit, 0.038524 sec total)
Done!

153 changes: 153 additions & 0 deletions tests/imfit_reference/macos_x86-64/imfit_textout3d
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
Image file = tests/ic3478rss_64x64.fits
configuration file = tests/imfit_reference/imfit_config_ic3478_64x64b.dat
Value from config file: gain = 4.725000 e-/ADU
Value from config file: read noise = 4.300000 e-
Value from config file: original sky = 130.100000
Reading data image ("tests/ic3478rss_64x64.fits") ...
naxis1 [# pixels/row] = 64, naxis2 [# pixels/col] = 64; nPixels_tot = 4096
* No PSF image supplied -- no image convolution will be done!
* No noise image supplied ... will generate noise image from input data image.
Function: Sersic
7 total parameters
Model Object: 4096 data values (pixels)
ModelObject: mask vector applied to weight vector. (4096 valid pixels remain)
7 free parameters (4089 degrees of freedom)
Estimated memory use: 458752 bytes (448.0 KB)

Performing fit by minimizing chi^2 (data-based errors):
Calling Levenberg-Marquardt solver ...
mpfit iteration 1: fit statistic = 263212.803059
X0 32.3912
Y0 32.7346
FUNCTION Sersic
PA 18.0332 # deg (CCW from +y axis)
ell 0
n 1.81654
I_e 19.043 # counts/pixel
r_e 30.4484 # pixels
mpfit iteration 2: fit statistic = 38837.128651
X0 32.8246
Y0 33.5074
FUNCTION Sersic
PA 18.0332 # deg (CCW from +y axis)
ell 0
n 2.20493
I_e 24.7011 # counts/pixel
r_e 38.3852 # pixels
mpfit iteration 3: fit statistic = 16396.742094
X0 32.9992
Y0 34.0253
FUNCTION Sersic
PA 25.3509 # deg (CCW from +y axis)
ell 0
n 2.40435
I_e 19.0899 # counts/pixel
r_e 51.3035 # pixels
mpfit iteration 4: fit statistic = 15914.301369
X0 32.9958
Y0 34.0292
FUNCTION Sersic
PA 90 # deg (CCW from +y axis)
ell 0
n 2.40632
I_e 19.1018 # counts/pixel
r_e 51.481 # pixels
mpfit iteration 5: fit statistic = 12632.941400
X0 32.9480
Y0 34.0851
FUNCTION Sersic
PA 90 # deg (CCW from +y axis)
ell 0
n 2.43403
I_e 19.2689 # counts/pixel
r_e 53.9773 # pixels
mpfit iteration 6: fit statistic = 12632.237160
X0 32.9485
Y0 34.0895
FUNCTION Sersic
PA 0 # deg (CCW from +y axis)
ell 0
n 2.43444
I_e 19.2547 # counts/pixel
r_e 53.9852 # pixels
mpfit iteration 7: fit statistic = 8036.249910
X0 32.9468
Y0 34.0973
FUNCTION Sersic
PA 0.00311914 # deg (CCW from +y axis)
ell 0.18689
n 2.39424
I_e 20.3117 # counts/pixel
r_e 56.873 # pixels
mpfit iteration 8: fit statistic = 5002.948200
X0 32.9462
Y0 34.0948
FUNCTION Sersic
PA 22.3975 # deg (CCW from +y axis)
ell 0.194004
n 2.41769
I_e 19.5831 # counts/pixel
r_e 59.8389 # pixels
mpfit iteration 9: fit statistic = 4569.384236
X0 32.9434
Y0 34.0951
FUNCTION Sersic
PA 17.2139 # deg (CCW from +y axis)
ell 0.235027
n 2.40359
I_e 19.9373 # counts/pixel
r_e 60.7908 # pixels
mpfit iteration 10: fit statistic = 4555.953001
X0 32.9442
Y0 34.0933
FUNCTION Sersic
PA 18.2648 # deg (CCW from +y axis)
ell 0.23583
n 2.4004
I_e 20.0071 # counts/pixel
r_e 60.7584 # pixels
mpfit iteration 11: fit statistic = 4555.947657
X0 32.9440
Y0 34.0933
FUNCTION Sersic
PA 18.2612 # deg (CCW from +y axis)
ell 0.235989
n 2.4003
I_e 20.009 # counts/pixel
r_e 60.7621 # pixels
mpfit iteration 12: fit statistic = 4555.947654
X0 32.9439
Y0 34.0933
FUNCTION Sersic
PA 18.2612 # deg (CCW from +y axis)
ell 0.235989
n 2.40028
I_e 20.0094 # counts/pixel
r_e 60.7612 # pixels

*** mpfit status = 1 -- SUCCESS: Convergence in fit-statistic value.
CHI-SQUARE = 4555.947654 (4089 DOF)
INITIAL CHI^2 = 494330.961892
NPAR = 7
NFREE = 7
NPEGGED = 0
NITER = 13
NFEV = 98

Reduced Chi^2 = 1.114196
AIC = 4569.975051, BIC = 4614.172017

X0 32.9439 # +/- 0.0128
Y0 34.0933 # +/- 0.0156
FUNCTION Sersic
PA 18.2612 # +/- 0.30986 deg (CCW from +y axis)
ell 0.235989 # +/- 0.0023165
n 2.40028 # +/- 0.018072
I_e 20.0094 # +/- 0.40396 counts/pixel
r_e 60.7612 # +/- 0.86063 pixels

Saving best-fit parameters in file "bestfit_parameters_imfit.dat"

(Elapsed time: 0.035436 sec for fit, 0.037478 sec total)
Done!

Loading

0 comments on commit 00a9884

Please sign in to comment.