Repository navigation
Conversation
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
September 15, 2026 20:54
0060326 to
ef2727b
Compare
Cadair
changed the base branch from
map-refactor/ndcube-constructor
to
map-refactor/ndcube-base
September 15, 2026 20:57
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
September 15, 2026 20:57
ef2727b to
c1aa6ad
Compare
.wcs setter and test with SlicedLowLevelWCS
.wcs setter and test with SlicedLowLevelWCS.wcs setter which updates .meta
.wcs setter which updates .meta.wcs setter which updates .meta
alasdairwilson
force-pushed
the
map-refactor/wcs-setter
branch
from
September 16, 2026 13:00
4a21db6 to
4564caa
Compare
.wcs setter which updates .meta.wcs setter which updates .meta
samaloney
force-pushed
the
map-refactor/wcs-setter
branch
from
October 1, 2026 09:18
4564caa to
432ee94
Compare
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
October 14, 2026 18:15
432ee94 to
617b012
Compare
alasdairwilson
marked this pull request as ready for review
October 14, 2026 18:26
samaloney
force-pushed
the
map-refactor/wcs-setter
branch
from
October 15, 2026 15:03
617b012 to
c79f74a
Compare
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
October 15, 2026 15:36
55476fc to
f4a336c
Compare
samaloney
force-pushed
the
map-refactor/wcs-setter
branch
from
October 16, 2026 09:51
f4a336c to
26ab995
Compare
samaloney
force-pushed
the
map-refactor/wcs-setter
branch
2 times, most recently
from
October 16, 2026 15:00
157e570 to
b8864d5
Compare
samaloney
reviewed
Oct 16, 2026
| # oldestdeps - asdf-astropy 0.7 uses astropy's deprecated TestRunner on import. This must | ||
| # come before any filter that imports sunpy/astropy (e.g. SunpyConnectionWarning) as | ||
| # resolving those categories triggers the import and the "error" filter is already active. | ||
| ignore:The TestRunner(Base)? class will be deprecated:PendingDeprecationWarning |
Member
There was a problem hiding this comment.
the alternative is bump asdf-astropy
alasdairwilson
force-pushed
the
map-refactor/wcs-setter
branch
from
October 20, 2026 21:47
23018de to
de58112
Compare
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
October 21, 2026 16:21
de58112 to
d1f0cfc
Compare
Cadair
commented
Oct 21, 2026
Comment on lines
+698
to
+723
| # relax=True so non-standard keywords (e.g. SIP) are kept rather than warned about | ||
| new_header = unwrapped.to_header(relax=True) | ||
| for n in range(1, unwrapped.naxis + 1): | ||
| new_header[f"NAXIS{n}"] = unwrapped._naxis[n - 1] | ||
| # The new WCS may not have preserved units (e.g. it is in degrees), so | ||
| # convert it into the units the metadata already uses. | ||
| meta_unit = self.meta.get(f"cunit{n}") | ||
| # Sources declare how their CUNIT should be read by overriding | ||
| # `spatial_units`, e.g. EIT omits it and LASCO uses a non-FITS 'ARCSEC', | ||
| # so convert to that rather than parsing the raw keyword. | ||
| target_unit = self.spatial_units[n - 1] if n <= len(self.spatial_units) else None | ||
| if target_unit is None and meta_unit is not None: | ||
| target_unit = u.Unit(meta_unit) | ||
| if meta_unit is None and target_unit is not None: | ||
| meta_unit = target_unit.to_string() | ||
| header_unit = new_header.get(f"CUNIT{n}") | ||
| if target_unit is None or header_unit is None: | ||
| continue | ||
| factor = u.Unit(header_unit).to(target_unit) | ||
| if factor != 1: | ||
| keys = [f"CDELT{n}", f"CRVAL{n}"] | ||
| keys += [f"CD{n}_{m}" for m in range(1, unwrapped.naxis + 1)] | ||
| for key in keys: | ||
| if key in new_header: | ||
| new_header[key] *= factor | ||
| new_header[f"CUNIT{n}"] = meta_unit |
Member
Author
There was a problem hiding this comment.
@samaloney Am I right in thinking that all this section can be removed if we bump an astropy bugfix release or two?
Member
There was a problem hiding this comment.
some of it still need a special case for EIT I think
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
October 21, 2026 16:47
d1f0cfc to
89db5f5
Compare
alasdairwilson
force-pushed
the
map-refactor/wcs-setter
branch
2 times, most recently
from
October 27, 2026 19:07
19141be to
d55c4fe
Compare
…ict (thanks whoever wrote #8844)
Cadair
force-pushed
the
map-refactor/wcs-setter
branch
from
November 3, 2026 16:10
ce4e7ba to
f164a0a
Compare
hayesla
reviewed
Nov 4, 2026
hayesla
reviewed
Nov 4, 2026
1 of 2 tasks
Replace unit conversion with a guard that rejects differing spatial units before modifying metadata. Retain source handling for updated GONG scales and EIT radius calculations.
Cadair
commented
Nov 11, 2026
| @@ -0,0 +1,3 @@ | |||
| `~sunpy.map.GenericMap.wcs` now keeps the units of the map's metadata (usually arcseconds) instead of converting to degrees. | |||
| Raw world values, such as ``map.wcs.wcs.cdelt`` or values passed to ``ax.get_transform('world')``, are now in those units. | |||
Member
Author
There was a problem hiding this comment.
"values pass to ax.get_transform("world")" is a weird way to write this, we should say "when plotting values with ax.get_transform" or something.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This functionality is needed to support
NDCubemethods which modify the WCS (with APE 14 wrappers), i.e.rebin,__getitem__,cropetc.AI Assistance Disclosure
AI tools were used for: