Skip to content

Commit

Permalink
promotion of float on instantiation.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-goldman committed Sep 17, 2024
1 parent dabf9ff commit 5de1286
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stwcs/distortion/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def __init__(self, idcfile, date=None, chip=1, direction='forward',
if 'empty_model' in self.refpix and self.refpix['empty_model']:
pass
else:
self.refpix['PSCALE'] = np.float64(self.refpix['PSCALE']) * binned
self.refpix['PSCALE'] = self.refpix['PSCALE'] * binned
self.cx = self.cx * binned
self.cy = self.cy * binned
self.refpix['XREF'] = self.refpix['XREF'] / binned
Expand Down
2 changes: 1 addition & 1 deletion stwcs/distortion/mutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def readIDCtab(tabname, chip=1, date=None, direction='forward',
refpix['YREF'] = ftab[1].data.field('YREF')[row]
refpix['XSIZE'] = ftab[1].data.field('XSIZE')[row]
refpix['YSIZE'] = ftab[1].data.field('YSIZE')[row]
refpix['PSCALE'] = round(ftab[1].data.field('SCALE')[row], 8)
refpix['PSCALE'] = np.float64(round(ftab[1].data.field('SCALE')[row], 8))
refpix['V2REF'] = v2ref
refpix['V3REF'] = v3ref
refpix['THETA'] = theta
Expand Down
4 changes: 2 additions & 2 deletions stwcs/updatewcs/makewcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def updateWCS(cls, ext_wcs, ref_wcs):
return {}

# promote scalars manually for Numpy 2.0+
ext_wcs.idcmodel.refpix['PSCALE'] = np.float64(ext_wcs.idcmodel.refpix['PSCALE'])
ref_wcs.idcmodel.refpix['PSCALE'] = np.float64(ref_wcs.idcmodel.refpix['PSCALE'])
ext_wcs.idcmodel.refpix['PSCALE'] = ext_wcs.idcmodel.refpix['PSCALE'])
ref_wcs.idcmodel.refpix['PSCALE'] = ref_wcs.idcmodel.refpix['PSCALE'])

ltvoff, offshift = cls.getOffsets(ext_wcs)

Expand Down

0 comments on commit 5de1286

Please sign in to comment.