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

IFU mode improvements, continued #890

Merged
merged 10 commits into from
Sep 12, 2024

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Jul 26, 2024

Continues IFU model improvements work started in #770.

  • Adds a framework for, in IFU mode, after the initial PSF calculation completes calling a function to apply some transformation (e.g. a broadening convolution kernel) to improve the IFU model fidelity.
  • For now, implements an initial placeholder version of that for NIRSpec and MIRI each as a simple Gaussian convolution kernel. This will be improved subsequently.
  • Adds unit test functions for both NIRSpec and MIRI.
  • Minor improvements to logging outputs etc, incidental as part of testing and verifying the above

To Do: Note, these are deferred to future PRs, not in this one.

@mperrin mperrin self-assigned this Jul 26, 2024
@pep8speaks
Copy link

pep8speaks commented Jul 26, 2024

Hello @mperrin, Thank you for updating !

Line 564:1: E101 indentation contains mixed spaces and tabs
Line 567:1: E101 indentation contains mixed spaces and tabs
Line 568:1: E101 indentation contains mixed spaces and tabs
Line 570:1: E101 indentation contains mixed spaces and tabs
Line 616:91: E225 missing whitespace around operator
Line 616:91: W504 line break after binary operator
Line 642:1: E101 indentation contains mixed spaces and tabs
Line 643:1: E101 indentation contains mixed spaces and tabs
Line 645:55: E226 missing whitespace around arithmetic operator
Line 645:66: E226 missing whitespace around arithmetic operator
Line 645:71: E226 missing whitespace around arithmetic operator
Line 645:126: E501 line too long (138 > 125 characters)
Line 647:31: E226 missing whitespace around arithmetic operator
Line 648:35: E226 missing whitespace around arithmetic operator
Line 653:6: E111 indentation is not a multiple of four
Line 653:6: E117 over-indented
Line 665:6: E111 indentation is not a multiple of four
Line 669:6: E111 indentation is not a multiple of four
Line 670:10: E111 indentation is not a multiple of four
Line 671:6: E111 indentation is not a multiple of four
Line 672:10: E111 indentation is not a multiple of four
Line 673:10: E111 indentation is not a multiple of four
Line 674:10: E111 indentation is not a multiple of four
Line 675:6: E111 indentation is not a multiple of four

Line 120:1: E302 expected 2 blank lines, found 1

Line 2074:19: E126 continuation line over-indented for hanging indent
Line 2075:13: E131 continuation line unaligned for hanging indent

Comment last updated at 2024-09-12 12:02:40 UTC

@mperrin
Copy link
Collaborator Author

mperrin commented Jul 26, 2024

@patapisp FYI, I have started moving functionality from your PR #691 to this one for the MIRI MRS PSF models. I don't know if you might have some time to help check it, or to advise things that I should look at to check the result myself? I know you're busy and time is short but let me know if there might be time we could chat on this soon. Cheers!

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 82.19178% with 13 lines in your changes missing coverage. Please review.

Project coverage is 62.13%. Comparing base (b536111) to head (be50906).
Report is 162 commits behind head on develop.

Files Patch % Lines
webbpsf/match_data.py 0.00% 9 Missing ⚠️
webbpsf/detectors.py 92.85% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #890      +/-   ##
===========================================
+ Coverage    59.20%   62.13%   +2.92%     
===========================================
  Files           16       15       -1     
  Lines         6955     7003      +48     
===========================================
+ Hits          4118     4351     +233     
+ Misses        2837     2652     -185     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@obi-wan76 obi-wan76 self-requested a review July 31, 2024 20:34
@patapisp
Copy link

@mperrin happy to check it out and test it.

Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

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

Just a minor typo in the description and a couple of minor header information fixes. Everything else looks good, I tried the gaussian, empirical and None. Results are as expected including information inside the fits header

webbpsf/detectors.py Outdated Show resolved Hide resolved
webbpsf/detectors.py Outdated Show resolved Hide resolved
webbpsf/detectors.py Outdated Show resolved Hide resolved
@mperrin
Copy link
Collaborator Author

mperrin commented Sep 11, 2024

@obi-wan76 Thanks for the review, and catching the couple little things to fix. All fixed and pushed now.

@obi-wan76
Copy link
Collaborator

@obi-wan76 Thanks for the review, and catching the couple little things to fix. All fixed and pushed now.

@mperrin I don't see the changes, did you push your latest fix?

if model_type.lower() == 'gaussian':
# Very simple model just as a Gaussian convolution kernel
sigma = constants.INSTRUMENT_IFU_BROADENING_PARAMETERS['MIRI']['sigma']
hdulist[ext].header['IFUBSIGM'] = (sigma, "[arcsec] IFU PSF broadening Gaussian sigma")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see the changes, thanks!

@obi-wan76 obi-wan76 merged commit 2c128b5 into spacetelescope:develop Sep 12, 2024
8 checks passed
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.

4 participants