Add 'first' and 'last' moasicking modes to reproject_and_coadd #383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andlast
options forcombine_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
![image](https://private-user-images.githubusercontent.com/23462789/263427858-308d8d82-65c2-4f2d-83ad-161118266001.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDg1ODYsIm5iZiI6MTcyMDEwODI4NiwicGF0aCI6Ii8yMzQ2Mjc4OS8yNjM0Mjc4NTgtMzA4ZDhkODItNjVjMi00ZjJkLTgzYWQtMTYxMTE4MjY2MDAxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE1NTEyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxYmMwZDM0MTZkM2NlOTBjYmEzNWYxZjE3ODRkMzI1ZjhkY2Q2OGFkMDFkOWZlOGY2YTQ5ZTQyYmZmMDkzMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.heReiEV4rEzxkb3nvJhjluCNBkZHKXSpSzP8Xjs9-XY)
combine_function="mean"
(make it full-size to see the star ghosting):With
![image](https://private-user-images.githubusercontent.com/23462789/263427892-95e5dfa4-67ec-45f9-bb27-14764e812502.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDg1ODYsIm5iZiI6MTcyMDEwODI4NiwicGF0aCI6Ii8yMzQ2Mjc4OS8yNjM0Mjc4OTItOTVlNWRmYTQtNjdlYy00NWY5LWJiMjctMTQ3NjRlODEyNTAyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE1NTEyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc4ZjcyZWM3YjY2ZTA2NTE3NzYwZWI0MjQxOGQyM2Y3OTY0Zjc1NjA0N2NlZjlmNGM0ZDVhMjc3YTE1ODU3OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JLFghzaQ7R9hZJ-8utHH2uG2iqxgZEa2WC0XsHHNTXo)
combine_function="first"
: