Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JP-3153: post-commissioning AMI3 updates #7862

Merged
merged 211 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
0d99777
Added keywords read in from datamodel and stored in NIRISS object for…
rcooper295 Mar 23, 2023
181ea52
commented out now-unused code including throughput ref file use, to b…
rcooper295 Mar 23, 2023
75bc713
Updated filter/source spectrum combination, expand data dimensions if…
rcooper295 Mar 23, 2023
6691c9c
Run on 3d files: fringefitter contains two methods fit_fringes_all an…
rcooper295 Mar 23, 2023
5e83124
functions for filter/source combination, etc copied from ImPlaneIA
rcooper295 Mar 23, 2023
79c002e
added step args affine2d, bandpass, src, firstfew, chooseholes, usebp…
rcooper295 Mar 30, 2023
68c923f
updates to weighted_operations, matrix_operations to use bad pixel mask
rcooper295 Apr 4, 2023
e78db33
fixed typos
rcooper295 Apr 4, 2023
80fd458
Pipeline adaptation of fourier bad pixel fix added, and usage of dq m…
rcooper295 May 18, 2023
2957ba4
additional bad pixels >10 sigma from median image added to DQ array f…
rcooper295 Jun 9, 2023
d9275fb
first commit of code prepare data to write to stdatamodels AmiOIModel
rcooper295 Jul 28, 2023
49e5ecc
changes to test new datamodel. made residual calculation consistent b…
rcooper295 Jul 28, 2023
c752f5e
Changes to write out AmiOIModel, multi still in progress, cleaning ne…
rcooper295 Aug 11, 2023
7ed6d3d
uncommented asn rule changes to use 3d inputs for AMI exposures
rcooper295 Aug 17, 2023
4b9496c
minor code and comment cleanup
rcooper295 Aug 18, 2023
09304af
pistons and pist_err columns now included in oifits array extension
rcooper295 Aug 22, 2023
f719f8c
removed unused Calibrate class. Some aspects may be added back later
rcooper295 Aug 18, 2023
d8a6f39
Added new CalibOifits class, using new AmiOIModel structure
rcooper295 Aug 18, 2023
16d0fcc
replaced use of AmiLgModel with AmiOIModel in ami_normalize step
rcooper295 Aug 21, 2023
d1debab
modify dtype of oi array for calibrated oifits files
rcooper295 Aug 23, 2023
31cb58f
add calibrator name to calibrated oifits header
rcooper295 Aug 23, 2023
c66ebf0
Changes to try to write out to new amilgfitmodel
rcooper295 Aug 23, 2023
1d68f70
Updates to write out multi-integration oifits files
rcooper295 Aug 24, 2023
4962e96
add skip=True to spec block of ami_average step to turn it off in the…
rcooper295 Aug 24, 2023
4fd8e19
update input arguments in spec, models returned from step call
rcooper295 Aug 30, 2023
759da90
print statements replaced with logging, minor comment cleanup
rcooper295 Aug 30, 2023
1cd4986
style fixes: removed unused imports, etc
rcooper295 Aug 31, 2023
0be6f61
Docstrings and minor cleanup
rcooper295 Sep 1, 2023
5640e2d
more minor style changes
rcooper295 Sep 1, 2023
992f021
even more minor style changes
rcooper295 Sep 1, 2023
4ce089c
removed parentheses in spec block that caused parsing error
rcooper295 Sep 5, 2023
7b23b83
WIP updates to calwebb_ami3 to use restructured flow skipping average…
rcooper295 Sep 5, 2023
1a4b306
Updated ami_analyze documentation
rcooper295 Sep 6, 2023
ce47f61
More RTD updates to ami_analyze and ami_normalize
rcooper295 Sep 6, 2023
8ced088
WIP address docs build issue caused by missing WEBBPSF_PATH
rcooper295 Sep 7, 2023
4897855
removed references to throughput ref file in docs
rcooper295 Sep 7, 2023
7977ff0
RTD updates about AMI products (WIP)
rcooper295 Sep 12, 2023
caf97dc
fix 'malformed tables'
rcooper295 Sep 12, 2023
064338c
calwebb_ami3 pipeline working with updated steps
rcooper295 Sep 14, 2023
4178691
ami3 pipeline and ami average docs updates
rcooper295 Sep 21, 2023
cdcb76a
copy input header keywords to all three outputs
rcooper295 Nov 2, 2023
77917d2
updated docs with agreed-upon file suffixes and extensions for OIFITS…
rcooper295 Nov 21, 2023
738561b
one more RTD update
rcooper295 Dec 4, 2023
e0058a3
file suffixes updated in calwebb_ami3
rcooper295 Dec 8, 2023
7bb1f06
set ami suffix based on result index
braingram Jan 24, 2024
0edffe2
Save amianalyze outputs with correct suffixes by overriding save_mode…
rcooper295 Jan 24, 2024
1d950c9
update ci to use webbpsf cache like romancal
braingram Jan 24, 2024
9f9112d
remove unused import
braingram Jan 24, 2024
55f3716
add new deps
braingram Jan 24, 2024
643adf2
attempt to get webbpsf cache to download
braingram Jan 24, 2024
716ee8f
bump astroquery min
braingram Jan 24, 2024
afd83a5
Updated ami3 reg test to follow restructured stage and test new outputs
rcooper295 Jan 30, 2024
e36a6ca
added webbpsf path to jenkinsRT for testing
rcooper295 Feb 5, 2024
e23116c
update regtest for new files
braingram Feb 5, 2024
23171b4
use simpson to avoid warnings
braingram Feb 5, 2024
fc0e8b3
remove is comparison using flatdqm
braingram Feb 5, 2024
b13bd31
Correct NaNs in median image used to find rotation. Add 'fudge' facto…
rcooper295 Feb 9, 2024
c923c38
Use updated throughput reference files instead of WebbPSF data files
rcooper295 Feb 28, 2024
97c1255
Use new nrm reference file for pupil mask used in bp_fix instead of W…
rcooper295 Mar 1, 2024
293297b
Replaced use of verbose argument with logging in filter source spectr…
rcooper295 Mar 1, 2024
55c44de
Fixed typo, STA_INDEX now 1-indexed as required for OIFITS
rcooper295 Mar 1, 2024
ef8ecfd
Removed use of astroquery to get target information, now using input …
rcooper295 Mar 1, 2024
3a14e04
style fixes, removed unused imports
rcooper295 Mar 7, 2024
f01d730
pass WEBBPSF_PATH to test env
braingram Feb 9, 2024
d2927d2
refine test error matches
braingram Feb 9, 2024
2d903ca
replace DataModel check with datamodel.open
braingram Feb 9, 2024
1f2de6a
add test for even oversample
braingram Feb 9, 2024
601ee9b
add test for get_filt_spec
braingram Feb 9, 2024
ebe9721
add get_src_spec test
braingram Feb 9, 2024
faa7da4
prefix private cdmatrix_to_sky with underscore
braingram Feb 9, 2024
d949485
cleanup spacing, remove commented code
braingram Feb 13, 2024
0ef76a0
remove verbose and plot
braingram Feb 13, 2024
7396b08
more code cleanup
braingram Feb 13, 2024
cf9e773
simplify oifits
braingram Feb 13, 2024
a389e0b
fix style
braingram Feb 13, 2024
ea6404a
clean up oifits docstrings
braingram Feb 13, 2024
4f90b51
add minimal fake model
braingram Feb 13, 2024
6cce41e
remove astroquery
braingram Feb 13, 2024
8736baa
add a few more unit tests
braingram Feb 13, 2024
3bb2ee0
update tests
braingram Mar 7, 2024
b7491ae
remove unused import
braingram Mar 7, 2024
2cd418d
remove previous CI changes for webbpsf data
braingram Mar 7, 2024
baff9bf
update a few variable names
braingram Mar 8, 2024
7d191f3
docs updates to use throughput and nrm reference files
rcooper295 Mar 8, 2024
de1f9c1
remove use of src (source spectral type) input argument that relied o…
rcooper295 Mar 8, 2024
1cfc87f
remove stsynphot dependency and unit tests
rcooper295 Mar 8, 2024
559dd9a
undoing mask definition change that hasn't been tested enough
rcooper295 Mar 8, 2024
1536827
style fixes
rcooper295 Mar 8, 2024
fcc0f33
RTD style fix
rcooper295 Mar 8, 2024
7d57b88
update suffix lists for ami
braingram Mar 11, 2024
91a0ab3
mock nrm ref in unit test
braingram Mar 11, 2024
9e7c9a4
updated science products descriptions with correct suffixes
rcooper295 Mar 11, 2024
1bcd9d3
changelog entry
rcooper295 Mar 11, 2024
383d33c
docs formatting fix
rcooper295 Mar 11, 2024
b77cb4b
RTD product types updated
rcooper295 Mar 11, 2024
999e20d
Update docs/jwst/ami_analyze/description.rst
rcooper295 Mar 12, 2024
8d9917d
Apply suggestions from code review
rcooper295 Mar 12, 2024
5419bcd
Small tweaks in response to review, mostly docstrings
rcooper295 Mar 12, 2024
dceb251
Apply more small suggestions from code review
rcooper295 Mar 12, 2024
efcaa38
Moved bandpass logic to utils function handle_bandpass() to enable un…
rcooper295 Mar 12, 2024
d82be12
Simplified (removed) unnecessary use of fudge factor in hexagon trans…
rcooper295 Mar 12, 2024
caf9ac1
Further code cleanup in response to review
rcooper295 Mar 12, 2024
5cf8d4d
Style fixes
rcooper295 Mar 12, 2024
87fa68e
clean up FringeFitter kwargs
braingram Mar 13, 2024
6b40dc1
add weighted_operations unit test
braingram Mar 13, 2024
a967fb7
update test data to avoid divide by zero
braingram Mar 13, 2024
d8deb8d
add rcond to lstsq to silence FutureWarning
braingram Mar 13, 2024
2beb9cd
Added keywords read in from datamodel and stored in NIRISS object for…
rcooper295 Mar 23, 2023
72d90aa
commented out now-unused code including throughput ref file use, to b…
rcooper295 Mar 23, 2023
ee67411
Updated filter/source spectrum combination, expand data dimensions if…
rcooper295 Mar 23, 2023
27b25de
Run on 3d files: fringefitter contains two methods fit_fringes_all an…
rcooper295 Mar 23, 2023
0fcfefc
functions for filter/source combination, etc copied from ImPlaneIA
rcooper295 Mar 23, 2023
445c998
added step args affine2d, bandpass, src, firstfew, chooseholes, usebp…
rcooper295 Mar 30, 2023
28408fe
updates to weighted_operations, matrix_operations to use bad pixel mask
rcooper295 Apr 4, 2023
8c4a52e
fixed typos
rcooper295 Apr 4, 2023
e08ea2a
Pipeline adaptation of fourier bad pixel fix added, and usage of dq m…
rcooper295 May 18, 2023
150b1fb
additional bad pixels >10 sigma from median image added to DQ array f…
rcooper295 Jun 9, 2023
3ae8d7e
first commit of code prepare data to write to stdatamodels AmiOIModel
rcooper295 Jul 28, 2023
4bd2df5
changes to test new datamodel. made residual calculation consistent b…
rcooper295 Jul 28, 2023
a1e00cb
Changes to write out AmiOIModel, multi still in progress, cleaning ne…
rcooper295 Aug 11, 2023
c3b4a74
minor code and comment cleanup
rcooper295 Aug 18, 2023
3bff704
pistons and pist_err columns now included in oifits array extension
rcooper295 Aug 22, 2023
784f108
removed unused Calibrate class. Some aspects may be added back later
rcooper295 Aug 18, 2023
8f993ef
Added new CalibOifits class, using new AmiOIModel structure
rcooper295 Aug 18, 2023
224bf52
replaced use of AmiLgModel with AmiOIModel in ami_normalize step
rcooper295 Aug 21, 2023
4f80060
modify dtype of oi array for calibrated oifits files
rcooper295 Aug 23, 2023
fe35858
add calibrator name to calibrated oifits header
rcooper295 Aug 23, 2023
bed50dc
Changes to try to write out to new amilgfitmodel
rcooper295 Aug 23, 2023
e42449f
Updates to write out multi-integration oifits files
rcooper295 Aug 24, 2023
7b2c434
update input arguments in spec, models returned from step call
rcooper295 Aug 30, 2023
b135e4f
print statements replaced with logging, minor comment cleanup
rcooper295 Aug 30, 2023
7732b47
style fixes: removed unused imports, etc
rcooper295 Aug 31, 2023
93c2a00
Docstrings and minor cleanup
rcooper295 Sep 1, 2023
633e261
more minor style changes
rcooper295 Sep 1, 2023
c7e1450
even more minor style changes
rcooper295 Sep 1, 2023
78502a4
removed parentheses in spec block that caused parsing error
rcooper295 Sep 5, 2023
60c21e9
WIP updates to calwebb_ami3 to use restructured flow skipping average…
rcooper295 Sep 5, 2023
bcecbad
Updated ami_analyze documentation
rcooper295 Sep 6, 2023
7a38158
More RTD updates to ami_analyze and ami_normalize
rcooper295 Sep 6, 2023
e51d196
WIP address docs build issue caused by missing WEBBPSF_PATH
rcooper295 Sep 7, 2023
ff4f338
RTD updates about AMI products (WIP)
rcooper295 Sep 12, 2023
4876c9f
fix 'malformed tables'
rcooper295 Sep 12, 2023
b5f3d1e
calwebb_ami3 pipeline working with updated steps
rcooper295 Sep 14, 2023
82808b0
ami3 pipeline and ami average docs updates
rcooper295 Sep 21, 2023
5648300
copy input header keywords to all three outputs
rcooper295 Nov 2, 2023
01887f3
updated docs with agreed-upon file suffixes and extensions for OIFITS…
rcooper295 Nov 21, 2023
eafa494
one more RTD update
rcooper295 Dec 4, 2023
ee03e90
file suffixes updated in calwebb_ami3
rcooper295 Dec 8, 2023
7d78d07
set ami suffix based on result index
braingram Jan 24, 2024
9921c60
Save amianalyze outputs with correct suffixes by overriding save_mode…
rcooper295 Jan 24, 2024
289efe8
update ci to use webbpsf cache like romancal
braingram Jan 24, 2024
2d5a146
remove unused import
braingram Jan 24, 2024
d24f4bc
add new deps
braingram Jan 24, 2024
7c5e29c
attempt to get webbpsf cache to download
braingram Jan 24, 2024
aeedfda
bump astroquery min
braingram Jan 24, 2024
5e635ae
Updated ami3 reg test to follow restructured stage and test new outputs
rcooper295 Jan 30, 2024
d6a9671
added webbpsf path to jenkinsRT for testing
rcooper295 Feb 5, 2024
f09cdd9
update regtest for new files
braingram Feb 5, 2024
196f49e
use simpson to avoid warnings
braingram Feb 5, 2024
99d1817
remove is comparison using flatdqm
braingram Feb 5, 2024
3534079
Correct NaNs in median image used to find rotation. Add 'fudge' facto…
rcooper295 Feb 9, 2024
1a04ca8
Use updated throughput reference files instead of WebbPSF data files
rcooper295 Feb 28, 2024
efbaa38
Use new nrm reference file for pupil mask used in bp_fix instead of W…
rcooper295 Mar 1, 2024
cf9092b
Replaced use of verbose argument with logging in filter source spectr…
rcooper295 Mar 1, 2024
ad5a456
Fixed typo, STA_INDEX now 1-indexed as required for OIFITS
rcooper295 Mar 1, 2024
33fb26e
Removed use of astroquery to get target information, now using input …
rcooper295 Mar 1, 2024
c64f634
style fixes, removed unused imports
rcooper295 Mar 7, 2024
ae517c6
pass WEBBPSF_PATH to test env
braingram Feb 9, 2024
4622246
refine test error matches
braingram Feb 9, 2024
22bcd01
replace DataModel check with datamodel.open
braingram Feb 9, 2024
13d0a75
add test for even oversample
braingram Feb 9, 2024
84d8b3f
add test for get_filt_spec
braingram Feb 9, 2024
b028e9d
add get_src_spec test
braingram Feb 9, 2024
76efc5d
prefix private cdmatrix_to_sky with underscore
braingram Feb 9, 2024
9a74cdd
cleanup spacing, remove commented code
braingram Feb 13, 2024
88293a0
remove verbose and plot
braingram Feb 13, 2024
f1d53ea
more code cleanup
braingram Feb 13, 2024
2970a26
simplify oifits
braingram Feb 13, 2024
7c08706
fix style
braingram Feb 13, 2024
3084041
clean up oifits docstrings
braingram Feb 13, 2024
911931f
add minimal fake model
braingram Feb 13, 2024
e6634c7
remove astroquery
braingram Feb 13, 2024
8efc42e
add a few more unit tests
braingram Feb 13, 2024
bb52e12
update tests
braingram Mar 7, 2024
92edb03
remove unused import
braingram Mar 7, 2024
d38ff15
remove previous CI changes for webbpsf data
braingram Mar 7, 2024
2941ff2
update a few variable names
braingram Mar 8, 2024
dae230e
docs updates to use throughput and nrm reference files
rcooper295 Mar 8, 2024
af626cc
remove use of src (source spectral type) input argument that relied o…
rcooper295 Mar 8, 2024
4401a72
remove stsynphot dependency and unit tests
rcooper295 Mar 8, 2024
934000d
undoing mask definition change that hasn't been tested enough
rcooper295 Mar 8, 2024
e2aded1
style fixes
rcooper295 Mar 8, 2024
630a13d
RTD style fix
rcooper295 Mar 8, 2024
11aa9b6
update suffix lists for ami
braingram Mar 11, 2024
db48fd8
mock nrm ref in unit test
braingram Mar 11, 2024
44f9bdd
updated science products descriptions with correct suffixes
rcooper295 Mar 11, 2024
699edcf
docs formatting fix
rcooper295 Mar 11, 2024
85fe5e2
Update docs/jwst/ami_analyze/description.rst
rcooper295 Mar 12, 2024
7095188
Apply suggestions from code review
rcooper295 Mar 12, 2024
74e24d7
Small tweaks in response to review, mostly docstrings
rcooper295 Mar 12, 2024
0edb871
Apply more small suggestions from code review
rcooper295 Mar 12, 2024
1853a99
Moved bandpass logic to utils function handle_bandpass() to enable un…
rcooper295 Mar 12, 2024
8deec17
Simplified (removed) unnecessary use of fudge factor in hexagon trans…
rcooper295 Mar 12, 2024
0513fd7
Further code cleanup in response to review
rcooper295 Mar 12, 2024
cb38ee0
Style fixes
rcooper295 Mar 12, 2024
a5de01a
Remove 'short summary' header from all docstrings and other minor doc…
rcooper295 Mar 15, 2024
51126a5
removed unused module to get webbpsf filter info and associated test
rcooper295 Mar 15, 2024
815f036
style fix, remove unused import
rcooper295 Mar 18, 2024
ba0c110
small documentation update
rcooper295 Mar 21, 2024
829eb5e
remove unused import
braingram Mar 25, 2024
f49415b
replace changelog entry
braingram Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a few more unit tests
braingram committed Mar 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8736baa8f3fb9d40ea5132714002dc956d67aa4d
23 changes: 23 additions & 0 deletions jwst/ami/tests/test_ami_utils.py
Original file line number Diff line number Diff line change
@@ -44,3 +44,26 @@ def test_get_src_spec_default():
assert isinstance(spec, SourceSpectrum)
# check model expression for matching teff
re.match(r".*T_eff=(?P<teff>[0-9]+)", spec.meta["expr"]).group("teff") == "9500"


@pytest.mark.parametrize("shape, center", [
((10, 10), (4.5, 4.5)),
((11, 11), (5, 5)),
])
def test_centerpoint(shape, center):
assert utils.centerpoint(shape) == center


def test_find_centroid():
arr = np.zeros((30, 30), dtype='f4')
arr[15, 15] = 1
thresh = 0.02
assert np.allclose(utils.find_centroid(arr, thresh), (0.5, 0.5))


@pytest.mark.parametrize("mas, rad", [
(206264.8062471, 0.001),
(103132403.12355, 0.5),
])
def test_mas2rad(mas, rad):
assert np.isclose(utils.mas2rad(mas), rad)