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 'first' and 'last' moasicking modes to reproject_and_coadd #383

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

svank
Copy link
Contributor

@svank svank commented Aug 26, 2023

Again with WISPR and reproject_and_coadd, merging the image data in the overlap region isn't the most desirable thing to do, for two reasons. First, the WISPR L3 images don't always have a well-matched background level (because of how much processing it takes to get to L3), so at the small overlap region between the two FOVs, taking a mean of the two images gives a visible seam on either side. Second, there's sometimes a time offset between images from the two images, so if I'm building the composite in HPC coordinates, the stars are offset by a few pixels and produce ghosting in the overlap region. (If I build the composite in RA/Dec coordinates, that should stop being a problem, but then I need to think about how that offsets the coronal structures and how to make an HPC WCS for my RA/Dec composite frame.)

The match_background option helps hide the seams, but it's not perfect.

This PR adds first and last options for combine_function, which provide a simple stacking mode. In overlap regions, either the first or the last of the input images that cover any pixel determines the output value for that pixel. For the WISPR case, this artistic choice makes one seam more obvious, but hides the second seam and the star misalignment.

With combine_function="mean" (make it full-size to see the star ghosting):
image

With combine_function="first":
image

@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #383 (9f62ba2) into main (afca2f2) will increase coverage by 0.06%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   93.86%   93.92%   +0.06%     
==========================================
  Files          24       24              
  Lines         847      856       +9     
==========================================
+ Hits          795      804       +9     
  Misses         52       52              
Files Changed Coverage Δ
reproject/mosaicking/coadd.py 92.40% <90.90%> (+0.97%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@astrofrog
Copy link
Member

The wheel failures are unrelated, they are in Python 3.12 and not due to reproject itself.

@astrofrog astrofrog merged commit 661963d into astropy:main Sep 7, 2023
18 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants