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

setup_sim_to_match_file gets confused by parallel SW/LW coronagraphy #751

Closed
mperrin opened this issue Oct 6, 2023 · 5 comments · Fixed by #752
Closed

setup_sim_to_match_file gets confused by parallel SW/LW coronagraphy #751

mperrin opened this issue Oct 6, 2023 · 5 comments · Fixed by #752
Assignees
Labels
bug Something isn't working

Comments

@mperrin
Copy link
Collaborator

mperrin commented Oct 6, 2023

nrc = webbpsf.setup_sim_to_match_file('01563/jw01563011001_03106_00001_nrca2_calints.fits')

This sets it up for NRCA5, but it should be NRCA2... I'll debug.

@mperrin mperrin added the bug Something isn't working label Oct 6, 2023
@mperrin mperrin self-assigned this Oct 6, 2023
@mperrin
Copy link
Collaborator Author

mperrin commented Oct 6, 2023

Also some bug with setting the detector is supposed to auto change the pixel scale but didnt...

@mperrin
Copy link
Collaborator Author

mperrin commented Oct 6, 2023

OK, this is because setting the image_mask attribute to "MASK335R" then invokes the code in NIRCam._update_aperturename() which currently is written to assume MASK335R is only ever used with LW, and so on.

There's a one-line fix for this in setup_sim_to_match_file to reset the aperture name after changing the image mask, which I'll do now.

But this makes me realize that it may no longer be useful or appropriate to have setting the image mask automatically switch to the nominal detector. For now I think we should not change the auto detector switching since that would be not back incompatible, but this could be discussed in the future.

@obi-wan76
Copy link
Collaborator

I just wanted to mention setup_sim_to_match_file issue, #726, which is more related with adding addition per-instrument checks when selecting the right pupil.

@mperrin
Copy link
Collaborator Author

mperrin commented Oct 6, 2023

@obi-wan76 can you give me specific filenames of observed data files that have the issues in #726? I can perhaps fold in fixes for those into this PR, but it would help to have test files to validate them on

@obi-wan76
Copy link
Collaborator

When the pupil is not a mask, then the filter is not set correctly. For example, any of our sensing observations, e.g., jw02726477001_02102_00001_nrca3_cal.fits, simulate an in-focus PSF F212N instead of the WL. Other combinations would be, pupil+filter = F164N+F150W2 that set the simulation with filter F150W2 instead of F164N. I think when the pupil is not MASK then set the filter as the pupil.

The other issue is setting the observation when pupil = MASKBAR inside the image header because there is no MASKBAR in webbpsf. So, it need to choose between MASKSWB and MASKLWB depending on the filter. For example, jw01538048001_03103_00001_nrca4_cal.fits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants