-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JP-2259: Tweakreg source finding (#8203)
Co-authored-by: Ned Molter <emolter@stsci.edu> Co-authored-by: Howard Bushouse <bushouse@stsci.edu>
- Loading branch information
1 parent
c176ff3
commit cf7400b
Showing
7 changed files
with
364 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import pytest | ||
from astropy.io import ascii | ||
from numpy.testing import assert_allclose | ||
|
||
from stdatamodels.jwst import datamodels | ||
from jwst.tweakreg import tweakreg_catalog | ||
|
||
|
||
@pytest.mark.bigdata | ||
@pytest.mark.parametrize("starfinder", ["iraf", "segmentation"], ) | ||
def test_tweakreg_catalog_starfinder_alternatives(rtdata, starfinder): | ||
''' | ||
Test that the IRAF and segmentation star finders give expected results for undersampled NIRISS data | ||
It is well known that DAOStarFinder gives bad results so is not included in this test | ||
''' | ||
|
||
stem = "jw01088003001_01101_00005" | ||
rtdata.get_data(f"niriss/imaging/{stem}_nis_cal.fits") | ||
model = datamodels.ImageModel(rtdata.input) | ||
catalog = tweakreg_catalog.make_tweakreg_catalog( | ||
model, 2.5, 10.0, starfinder=starfinder, starfinder_kwargs={ | ||
'brightest': None, | ||
'sharphi': 3.0, | ||
'minsep_fwhm': 2.5, | ||
'sigma_radius': 2.5, | ||
}) | ||
rtdata.get_truth(f"truth/test_niriss_sourcefind/{stem}_{starfinder}_cat.ecsv") | ||
catalog_truth = ascii.read(rtdata.truth) | ||
|
||
# rtol is larger than default because of numerical differences on Linux vs MacOS | ||
assert_allclose(catalog['xcentroid'], catalog_truth['xcentroid'], rtol=1e-3) | ||
assert_allclose(catalog['ycentroid'], catalog_truth['ycentroid'], rtol=1e-3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.