SkyOffsetFrame issue when transforming to HPC
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- data-visualization
Research direction
Start by reproducing the example with SkyOffsetFrame, transform_to, reproject_to, and draw_quadrangle using the Earth and Solar Orbiter map frames. Trace why the transformed coordinates retain the same Tx and Ty values; done means the rotated field of view reprojects correctly and aligns on both maps.
Written by the indexing model from the issue text.
Description
Describe the bug
I brought up this issue a while ago in the element channel, and @ayshih mentioned it was an astropy issue, but I thought I'd add it here again to keep track.
Basically, what I'm trying to do is plot a field of view of an instrument on a full-disk map of the Sun, and then also see what that field of view is from another observer; here a field of view is from Solar Orbiter and I want to see what this looks like from AIA/Earth. The issue is that the field of view has a rotation to it. To plot the field of view on the point of view of Solar Orbiter is straight forward by using draw_quadrangle and using bottom_left_coord and top_right_coord with SkyOffsetFrame with the given rotation angle. However, when transforming these coordinates with the SkyOffsetFrame to the earth map wcs it doesnt work.
For example:
hri_map = sunpy.map.Map("solo_L2_eui-hrieuv174-image_20220402T091915587_V01.fits")
hri_angle = hri_map.meta["crota"]
rotated_frame = SkyOffsetFrame(origin=hri_map.reference_coordinate,
rotation=-hri_angle*u.deg,
observer=hri_map.observer_coordinate)
bl = hri_map.bottom_left_coord.transform_to(rotated_frame)
tr = hri_map.top_right_coord.transform_to(rotated_frame)
then this can be plotted nicely on the Solar Orbiter field of view, and matches with the actual map plot which makes sense. However it doesnt work when trying to plot it on a map with a different frame, say Earth based.
Below is a plot just plotting a rectangle given the top right and bottom left corners (green) and then the FOV when the rotation is added in red. earth_map and solo_map are just blank maps with Earth and SolO frames, respectively.
fig = plt.figure(figsize=(11, 5))
ax1 = fig.add_subplot(1, 2, 1, projection=earth_map)
ax2 = fig.add_subplot(1, 2, 2, projection=solo_map)
earth_map.plot(axes=ax1, title="Earth view")
earth_map.draw_limb(color='k', axes=ax1)
hri_reproject_earth.plot( axes=ax1)
earth_map.draw_quadrangle(bottom_left=hri_map.bottom_left_coord,
top_right=hri_map.top_right_coord, edgecolor='g', axes=ax1, label="HRI FOV (no rotation)")
earth_map.draw_quadrangle(bottom_left=bl_rot,
top_right=tr_rot, edgecolor='r', axes=ax1, label="HRI FOV")
solo_map.plot(axes=ax2, title="Solo view")
solo_map.draw_limb(color='k', axes=ax2)
hri_reproject_solo.plot( axes=ax2)
solo_map.draw_quadrangle(bottom_left=hri_map.bottom_left_coord,
top_right=hri_map.top_right_coord, edgecolor='g', axes=ax2, label="HRI FOV (no rotation)")
solo_map.draw_quadrangle(bottom_left=bl_rot,
top_right=tr_rot, edgecolor='r', axes=ax2, label="HRI FOV")

So the issue is that the bl_rot and tr_rot coordinates are not reprojecting correctly given the SkyOffsetFrame.
For example:
>>> bl_rot.reproject_to(solo_map.coordinate_frame)
<SkyCoord (Helioprojective: obstime=2022-04-02T09:19:16.287, rsun=695700.0 km, observer=<HeliographicStonyhurst Coordinate (obstime=2022-04-02T09:19:16.287, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, m)
(108.33340062, 2.64104579, 5.30858232e+10)>): (Tx, Ty) in arcsec
(-2569.40076256, 268.94164778)>
>>> bl_rot.transform_to(earth_map.coordinate_frame)
<SkyCoord (Helioprojective: obstime=2022-04-02T09:19:16.287, rsun=695700.0 km, observer=<HeliographicStonyhurst Coordinate (obstime=2022-04-02T09:19:16.287, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, m)
(-5.47456864e-07, -6.48257837, 1.49523853e+11)>): (Tx, Ty) in arcsec
(-2569.40076256, 268.94164778)>
which is giving back the same Tx, Ty values, and hence not reprojecting
- Dominant language
- Python
- Stars
- 1k
- Forks
- 682
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sunpy/sunpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Feature Request net
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
net
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Documentation Effort Low Package Novice Priority Medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Effort Medium map Package Intermediate Priority Medium
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100