Skip to content

Commit

Permalink
swap naxis
Browse files Browse the repository at this point in the history
  • Loading branch information
jurjen93 committed Nov 19, 2024
1 parent b3e9933 commit 83c7f80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fits_helpers/cut_fits_with_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def main():
header = hdu[0].header

r = pyregion.open(regionfile).as_imagecoord(header=header)
mask = r.get_mask(hdu=hdu[0], shape=(header["NAXIS1"], header["NAXIS2"])).astype(int)
imagedata = hdu[0].data.reshape(header["NAXIS1"], header["NAXIS2"])
mask = r.get_mask(hdu=hdu[0], shape=(header["NAXIS2"], header["NAXIS1"])).astype(int)
imagedata = hdu[0].data.reshape(header["NAXIS2"], header["NAXIS1"])
imagedata *= mask
imagedata[imagedata == 0] = nan

Expand Down

0 comments on commit 83c7f80

Please sign in to comment.