Skip to content

Conversation

wtbarnes
Copy link
Member

@wtbarnes wtbarnes commented Jun 23, 2025

This addresses part of the refactor of sunpy.map.GenericMap on top of ndcube.NDCube. See Map-NDCube Refactor (view) for more details.

This PR adds two corrections to the way the CD matrix is constructed when unwrapping a WCS object to a FITS WCS in the case where a rebinning operation is being performed:

  1. This adds a correction factor for rebinning to the CD matrix in the resulting FITS WCS upon unwrapping as is already done in Map, https://github.com/sunpy/sunpy/blob/1a2f071811327e03c0c92914f30bbbdadebd02fb/sunpy/map/mapbase.py#L2289-L2292
  2. This adds the correction to the non-diagonal PC matrix elements consistent with what is done in sunpy.map.GenericMap.superpixel, i.e. https://github.com/sunpy/sunpy/blob/1a2f071811327e03c0c92914f30bbbdadebd02fb/sunpy/map/mapbase.py#L2293-L2295.

TODOs

  • Explanatory comments
  • Unit test
  • Integration test

@Cadair Cadair moved this from Todo to In Progress in Map-NDCube Refactor Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants