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

RCAL-832 L3 Generation #137

Merged
merged 25 commits into from
Sep 3, 2024
Merged

Conversation

PaulHuwe
Copy link
Collaborator

@PaulHuwe PaulHuwe commented Aug 7, 2024

This ticket adds Level 3 Mosaic simulation and tests.

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 83.66337% with 33 lines in your changes missing coverage. Please review.

Project coverage is 89.24%. Comparing base (d4af8fd) to head (81028a8).
Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
romanisim/l3.py 86.55% 25 Missing ⚠️
romanisim/util.py 0.00% 4 Missing ⚠️
romanisim/wcs.py 66.66% 3 Missing ⚠️
romanisim/image.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   89.95%   89.24%   -0.72%     
==========================================
  Files          17       17              
  Lines        1792     2073     +281     
==========================================
+ Hits         1612     1850     +238     
- Misses        180      223      +43     

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

@PaulHuwe PaulHuwe marked this pull request as ready for review August 30, 2024 23:31
@PaulHuwe PaulHuwe requested a review from a team as a code owner August 30, 2024 23:31
@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Sep 2, 2024

@zacharyburnett I have been trying to debug the failures above, to no avail. Is this something you can shed some light one?

@zacharyburnett
Copy link
Collaborator

zacharyburnett commented Sep 3, 2024

ah, both build.yml and the ReadTheDocs build are failing because importing romanisim checks for WEBBPSF_PATH which is not set. Could we remove that check / only check if modules are actually used?

EDIT: upon further inspection it looks like the check is in webbpsf itself. I'm not sure how to handle that; perhaps a dummy WEBBPSF_PATH env var will work

Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

I left a few comments inline. I think I would delete the two tests involving comparisons against 20**2 * max(image), and I think you should get the build working, probably by removing the pixel_scale bit that depends on webbpsf. Don't worry about the other comments; I'll take it from here.

if bandpass is None:
bandpass = roman.getBandpasses(AB_zeropoint=True)[galsim_filter_name]

# Create initial galsim image (x & y are flipped)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think these are actually flipped? https://galsim-developers.github.io/GalSim/_build/html/image_class.html (ncol, nrow) sounds like ny, nx to me, which is the same as shape?

romanisim/l3.py Show resolved Hide resolved
sky_level = roman.getSkyLevel(bandpass, world_pos=mos_cent_pos, exptime=1)
sky_level *= (1.0 + roman.stray_light_fraction)
sky_mosaic = image * 0
wcs.makeSkyImage(sky_mosaic, sky_level)
Copy link
Collaborator

Choose a reason for hiding this comment

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

One subtlety I hadn't though about now is that makeSkyImage makes images in electrons / pixel. L3 skies can have weird pixel sizes and should be in MJy / sr. So there are probably some conversions here to get this right.

romanisim/tests/test_l3.py Outdated Show resolved Hide resolved
romanisim/tests/test_l3.py Outdated Show resolved Hide resolved
romanisim/parameters.py Outdated Show resolved Hide resolved
@schlafly
Copy link
Collaborator

schlafly commented Sep 3, 2024

Great, thanks. Can you also confirm what is intended for the L3 test with the 20**2, and then let's go ahead and merge?

@zacharyburnett
Copy link
Collaborator

just one warning when building the docs now:

... romanisim/wcs.py:docstring of romanisim.wcs.get_mosaic_wcs:5: ERROR: Unexpected indentation.

@PaulHuwe PaulHuwe merged commit 0943e87 into spacetelescope:main Sep 3, 2024
20 of 22 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.

3 participants