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

Add support for new sensing point and target phase map #937

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

obi-wan76
Copy link
Collaborator

@obi-wan76 obi-wan76 commented Nov 30, 2024

This PR adds support for the upcoming new field point in the wavefront sensing maintenance program
Rationale:
Around December 2024 the wavefront sensing and control maintenance program will start using a new field point as we changed from NIRCAm A3 FP1 to NIRCam A1 FP6. The reason for this change is to reduce the effect of persistence that could affect nircam observations that are schedule right after the sensing program observations that use a bright target.

  1. For this PR we generated a new webbpsf target phase map from the official phase map created by Randal Telfer using the sensing images collected during PID= 04556, observation007. The official target phase map has been release under: PRDOPSFLT-047/WAS_ConfigXML/FLIGHT_2564021O/3_was_conf_fa_trg_phase_maps.fits (extension PHASE_37). This new webbpsf target phase map is named : wss_target_phase_fp6.fits.

For this PR we need pysiaf 0.23.3 that uses PRDOPSSOC-067. This release is the one that add support for the new NIRCam apertures, namely:
pps_aper detector subarray exp_type filter
NRCA1_FP6 NRCA1 SUB8FP6A NRC_IMAGE F212N
NRCA1_FP6_SUB8 NRCA1 SUB8FP6A NRC_IMAGE F212N
NRCA1_FP6_SUB64 NRCA1 SUB64FP6A NRC_TACQ F212N

The new target phase file, wss_target_phase_fp6.fits, is under webbpsf-data-source (internal only); this file is just an upscaled version of the original phase map 3_was_conf_fa_trg_phase_maps.fits (256x256) to a 1024x1024 size in order to match webbpsf default 1024x1024 JWST pupil.

This is a comparison of the target phase map, current (left) and new (right)
image
siaf

@pep8speaks
Copy link

pep8speaks commented Nov 30, 2024

Hello @obi-wan76, Thank you for updating !

Line 1070:67: E231 missing whitespace after ','
Line 1072:25: W292 no newline at end of file

Comment last updated at 2024-12-04 13:41:29 UTC

@obi-wan76
Copy link
Collaborator Author

obi-wan76 commented Dec 1, 2024

This is an example by using load_wss_opd with the new target phase map. For the OPD I used PID 4556 Obs. 7 in order to create an OPD using WAS. Then I replaced the aperture name "NRCA1_FULL" to "NRCA1_FP6" in order to match the SIAF aperture name.
image

…perture under the new field point PRDOPSSOC-067
@obi-wan76 obi-wan76 requested a review from mperrin December 2, 2024 02:54
@obi-wan76
Copy link
Collaborator Author

For testing. Here is an OPD file created using PID 4556 Obs. 7 (test of new field point) with the correct aperture name as expected from SIAF. This file can be add to the webbpsf-data folder, under MAST_JWST_WSS_OPDs. Then you can simply load this file:

nrc = webbpsf.NIRCam()
nrc.filter='F200W'
nrc.detector = 'NRCB2'
nrc.detector_position = (1024,1024)
nrc.load_wss_opd('R2024120101-NRCA1_FP6-0.fits', plot = True)

Note that this is not an official MAST OPD, this file is for testing only.
R2024120101-NRCA1_FP6-0.fits.zip

Copy link
Collaborator

@mperrin mperrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together, and getting the data files ready too! I think the code can be simplified significantly by writing a utility function to avoid so much code repetition. See comments...

webbpsf/trending.py Outdated Show resolved Hide resolved
webbpsf/trending.py Show resolved Hide resolved
webbpsf/trending.py Show resolved Hide resolved
webbpsf/webbpsf_core.py Outdated Show resolved Hide resolved
…better handle the use of the correct target phase maps based on the NIRCAM aperture
Copy link
Collaborator

@mperrin mperrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good overall. I wanted to check one thing about the requirements: I think it should be <= instead of < for the current pysiaf 0.24.1. Yes?

Also, we should also update the dependency versions in pyproject.toml too. (That's the more official way to specify the dependencies in the latest standards for python packaging, and pyproject.toml is what pip uses when computing dependencies unless you explicitly tell it to install using the requirements.txt file.)

One additional optional suggested small revision, see comment below about a minor runtime efficiency improvement.

requirements.txt Outdated Show resolved Hide resolved
webbpsf/trending.py Outdated Show resolved Hide resolved
… necesary it also fix pysiaf requirements including in pyprojecttoml
@obi-wan76
Copy link
Collaborator Author

Also, we should also update the dependency versions in pyproject.toml too. (That's the more official way to specify the dependencies in the latest standards for python packaging, and pyproject.toml is what pip uses when computing dependencies unless you explicitly tell it to install using the requirements.txt file.)

I added the dependency on pyproject.toml

Copy link
Collaborator

@mperrin mperrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks!

@obi-wan76 obi-wan76 merged commit aec66ba into develop Dec 4, 2024
15 checks passed
@mperrin mperrin deleted the new_WFSC_field_point branch December 6, 2024 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants