8000 JP-1489: Allow calc_gwcs_pixmap to compute NaNs for drizzle by jdavies-st · Pull Request #5217 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JP-1489: Allow calc_gwcs_pixmap to compute NaNs for drizzle #5217

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

Merged
merged 3 commits into from
Aug 5, 2020

Conversation

jdavies-st
Copy link
Collaborator
@jdavies-st jdavies-st commented Aug 3, 2020

Replacing NaNs with -1 in the pixel mapping for drizzle was causing these artifacts. When this was originally implemented, drizzle pixmap barfed when there were NaNs in the pixmap.

And of course the reason this is showing up only in NIRSpec, as that NIRSpec is the only instrument where the WCS produces NaNs for pixels in the WCS bounding box. This is why we did not see it elsewhere.

See below for what the fix does for single-resampled s2d files in calwebb_spec2 for NIRSpec MOS data:

Screen Shot 2020-08-05 at 11 23 08 AM

Resolves #5013 / JP-1489

@codecov
Copy link
codecov bot commented Aug 3, 2020

Codecov Report

Merging #5217 into master will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5217      +/-   ##
==========================================
- Coverage   52.45%   52.43%   -0.03%     
==========================================
  Files         406      406              
  Lines       36335    36371      +36     
  Branches     5629     5630       +1     
==========================================
+ Hits        19061    19072      +11     
- Misses      16099    16124      +25     
  Partials     1175     1175              
Flag Coverage Δ
#unit 52.43% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jwst/outlier_detection/outlier_detection.py 39.26% <0.00%> (-0.19%) ⬇️
jwst/resample/resample_utils.py 53.01% <ø> (-0.56%) ⬇️
jwst/pipeline/calwebb_spec2.py 33.33% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46844ac...e6d2ca5. Read the comment docs.

@jdavies-st jdavies-st added this to the Build 7.6 milestone Aug 3, 2020
@jdavies-st jdavies-st self-assigned this Aug 3, 2020
@jdavies-st jdavies-st marked this pull request as ready for review August 5, 2020 14:32
@jdavies-st jdavies-st requested a review from hbushouse August 5, 2020 15:38
# other value. -1 is not optimal and may have side effects. But this is
# what we've been doing up until now, so more investigation is needed
# before a change is made. Preferably, fix tblot in drizzle.
pixmap[np.isnan(pixmap)] = -1
Copy link
Collaborator

Choose a reason for hiding this comment

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

So have you seen any bad side effects from this addition, since the same thing was causing a problem in forward drizzling?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, of course now that I think about it a bit more, I guess this really isn't a new thing for blotting. It was already there due to the resetting of pixmap values in resample_utils? And hence all you're doing is preserving that pre-existing behavior for blotting?

Copy link
Collaborator Author
@jdavies-st jdavies-st Aug 5, 2020

Choose a reason for hiding this comment

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

Well, this is what it was doing before for all pixmap creation. Since we don't want it generally, but need it specifically for blotting, I moved it out of calc_gwcs_pixmap and put it here for blotting only.

I think it would be good to look at this, but I think there are other issue in outlier detection that are preventing good testing of this at the moment. So basically this line of code just keeps the status quo for blotting in outlier detection, for good or bad.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's what I figured out post-comment.

Copy link
Collaborator
@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

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

Looks OK to me. Please add a change log entry.

@jdavies-st jdavies-st merged commit d38b706 into spacetelescope:master Aug 5, 2020
@jdavies-st jdavies-st deleted the JP-1489-resample-spec branch August 5, 2020 18:15
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.

resample_spec results for NIRSpec MOS data still contain artifacts
2 participants
0