Skip to content
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

Bad bounding box creation #1532

Open
WilliamJamieson opened this issue Nov 20, 2024 · 0 comments
Open

Bad bounding box creation #1532

WilliamJamieson opened this issue Nov 20, 2024 · 0 comments

Comments

@WilliamJamieson
Copy link
Collaborator

When writing https://github.com/spacetelescope/romancal/pull/1527/files#r1850595590, I realized that

def wcs_bbox_from_shape(shape):
"""Create a bounding box from the shape of the data.
This is appropriate to attach to a wcs object.
Parameters
----------
shape : tuple
The shape attribute from a `numpy.ndarray` array.
Returns
-------
bbox : tuple
Bounding box in x, y order.
"""
bbox = ((-0.5, shape[-1] - 0.5), (-0.5, shape[-2] - 0.5))
return bbox

does not create an x, y bounding box like it reports to. Rather it does create a y, x bounding box if you look at he shape[-1] and shape[-2] arguments.

Note that the function is used in several places other than where I made my comment and any fix to it would break the code that is being fixed in #1527 that is referenced by my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant