summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2010-08-23 14:46:31 -0400
committerdencheva <dencheva@stsci.edu>2010-08-23 14:46:31 -0400
commit4a537e0fcc7ba1f797b638d3d1eb7746d9535ff8 (patch)
tree7642ce883e555b7539c28176b98c5b424996ae68
parentc3486243801cdc796e912ba06c9761808a679a48 (diff)
downloadstwcs_hcf-4a537e0fcc7ba1f797b638d3d1eb7746d9535ff8.tar.gz
Added a small correction which was accidentally dropped in the previous debugging
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@10133 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--distortion/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/distortion/utils.py b/distortion/utils.py
index cb434be..46228cc 100644
--- a/distortion/utils.py
+++ b/distortion/utils.py
@@ -39,6 +39,12 @@ def output_wcs(list_of_wcsobj, ref_wcs=None, outwcs=None, undistort=True):
crpix = np.array([outwcs.naxis1/2., outwcs.naxis2/2.], dtype=np.float64)
outwcs.wcs.crpix = crpix
outwcs.wcs.set()
+ tanpix = outwcs.wcs.s2p(fra_dec, 1)['pixcrd']
+ newcrpix = np.array([crpix[0]+np.ceil(tanpix[:,0].min()), crpix[1]+
+ np.ceil(tanpix[:,1].min())])
+ newcrval = outwcs.wcs.p2s([newcrpix], 1)['world'][0]
+ outwcs.wcs.crval = newcrval
+ outwcs.wcs.set()
return outwcs
def undistortWCS(wcsobj):