Skip to content

Commit

Permalink
Merge pull request #321 from AstarVienna/fh/cdelt
Browse files Browse the repository at this point in the history
Sort corner pixels to deal with negative CDELTs
  • Loading branch information
teutoburg committed Jan 23, 2024
2 parents 1745b77 + f25391e commit 9302373
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scopesim/optics/fov_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ def extract_area_from_imagehdu(imagehdu, fov_volume):

# Round to avoid floating point madness
xyp = image_wcs.wcs_world2pix(np.array([xy0s, xy1s]), 0).round(7)
# To deal with negative CDELTs
xyp.sort(axis=0)

xy0p = np.max(((0, 0), np.floor(xyp[0]).astype(int)), axis=0)
xy1p = np.min(((naxis1, naxis2), np.ceil(xyp[1]).astype(int)), axis=0)
Expand Down

0 comments on commit 9302373

Please sign in to comment.