Skip to content

Commit c7215ed

Browse files
committed
Use distortion-aware WCS transformations
1 parent 9c07e37 commit c7215ed

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎pyregion/wcs_helper.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ def topixel(self, xy):
204204

205205
xy1 = lon_lat.transpose()
206206

207-
# somehow, wcs_world2pix does not work for some cases
208-
xy21 = [self._pywcs.wcs_world2pix([xy11], 1)[0] for xy11 in xy1]
209-
# xy21 = self._pywcs.wcs_world2pix(xy1, 1)
207+
# somehow, all_world2pix does not work for some cases
208+
xy21 = [self._pywcs.all_world2pix([xy11], 1)[0] for xy11 in xy1]
209+
# xy21 = self._pywcs.all_world2pix(xy1, 1)
210210

211211
xy2 = np.array(xy21).transpose()
212212
return xy2
213213

214214
def toworld(self, xy):
215215
""" 1, 1 base """
216-
xy2 = self._pywcs.wcs_pix2world(np.asarray(xy).T, 1)
216+
xy2 = self._pywcs.all_pix2world(np.asarray(xy).T, 1)
217217

218218
lon_lat = xy2.T
219219
# fixme
@@ -273,7 +273,7 @@ def topixel(self, xy):
273273
s.fill(self._ref_world[i])
274274
xyz[i] = s
275275

276-
# xyz2 = self._pywcs.wcs_world2pix(np.asarray(xyz).T, 1)
276+
# xyz2 = self._pywcs.all_world2pix(np.asarray(xyz).T, 1)
277277
xyz2 = self.proj.topixel(np.array(xyz))
278278

279279
# xyz2r = [d for (i, d) in enumerate(xyz2) if i in self._axis_nums_to_keep]

0 commit comments

Comments
 (0)