-
-
Notifications
You must be signed in to change notification settings - Fork 611
[map branch] Adopt GenericMap.submap
to use NDCube.crop
underneath
#7605
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
base: map_ndcube_migration
Are you sure you want to change the base?
Conversation
GenericMap.submap
to use NDCube.crop
underneath GenericMap.submap
to use NDCube.crop
underneath
ok, so I think this is mostly working. Two issues we need to consider:
>>> aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
>>> aia_map.submap([0, 0]*u.pixel, top_right=[0, 0]*u.pixel)
ValueError: Input points causes cube to be cropped to a single pixel. This is not supported.
>>> aia_map.submap([0, 0]*u.pixel, top_right=[0, 2]*u.pixel)
TypeError: It is not possible to slice a map with an integer as it will reduce the number of data dimensions by one.
In order to apply the same slice without dropping a dimension do mymap[:2, 1:2]. |
just fyi - thats why I've commented out these tests. I'll adjust when we figure it out |
linking this with the NDCube issue sunpy/ndcube#714 so we dont forget again |
The decision taken on the sunpy call is to solve this issue by introducing a |
@hayesla : sunpy/ndcube#714 has been merged. So you can now finish this PR by using the |
Hi @nabobalis . Have you taken over this PR? |
No idea. |
944a529
to
5896a93
Compare
b59ac2f
to
b69ad5f
Compare
# TODO HACK FOR NOW | ||
import warnings | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore") | ||
if np.any(np.isnan([self.wcs.world_to_pixel(world_corner) for world_corner in world_corners])): | ||
raise ValueError(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs revising but I dont got any good ideas.
b69ad5f
to
7067ecb
Compare
[([0, 0] * u.pix, [0.5, 0.5] * u.pix), np.array([[0, 1], | ||
[ 9, 10]])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior changed here. Do we want this?
Hello 👋, Thanks for your contribution to sunpy! |
Hello again 👋, We want to thank you again for your contribution to sunpy! |
72f7b4a
to
2513602
Compare
This PR is add
NDCube.crop
withinGenericMap.submap