summaryrefslogtreecommitdiff
path: root/lib/stwcs/updatewcs/makewcs.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-10-25 17:25:35 -0400
committerhack <hack@stsci.edu>2011-10-25 17:25:35 -0400
commitb5f4204747f7e4105049713b40d7bca0fae052e5 (patch)
tree8a2bd7713049a348ea3d955c646ccf1a7c4b7815 /lib/stwcs/updatewcs/makewcs.py
parentc68d6121a6847327df30ece3d90d8cfe0919367b (diff)
downloadstwcs_hcf-b5f4204747f7e4105049713b40d7bca0fae052e5.tar.gz
Merging changes from 'stwcs_hdrlet' branch (r18787 - r13909) into trunk. This version of STWCS (0.9.1) provides support for headerlets based on 'Headerlet Design' wiki document, and includes TEAL interfaces for all public headerlet functions. It also moves the TEAL interface for 'updatewcs' from 'astrodither' to this package. The TEAL interaces have been included as a new 'gui' sub-package in order to keep them separate from the remainder of the package's functionality.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13910 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/updatewcs/makewcs.py')
-rw-r--r--lib/stwcs/updatewcs/makewcs.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/stwcs/updatewcs/makewcs.py b/lib/stwcs/updatewcs/makewcs.py
index e422a4a..c2e709d 100644
--- a/lib/stwcs/updatewcs/makewcs.py
+++ b/lib/stwcs/updatewcs/makewcs.py
@@ -1,6 +1,5 @@
from __future__ import division # confidence high
-from stwcs import DEGTORAD, RADTODEG
import numpy as np
from math import sin, sqrt, pow, cos, asin, atan2,pi
import utils
@@ -149,7 +148,7 @@ class MakeWCS(object):
ref_wcs.idcmodel.shift(offsetx,offsety)
rfx, rfy = ref_wcs.idcmodel.cx, ref_wcs.idcmodel.cy
-
+
ref_wcs.setPscale()
offshift = offsh
dec = ref_wcs.wcs.crval[1]
@@ -244,10 +243,10 @@ def troll(roll, dec, v2, v3):
Generic Conversion at STScI.
"""
# Convert all angles to radians
- _roll = DEGTORAD(roll)
- _dec = DEGTORAD(dec)
- _v2 = DEGTORAD(v2 / 3600.)
- _v3 = DEGTORAD(v3 / 3600.)
+ _roll = np.deg2rad(roll)
+ _dec = np.deg2rad(dec)
+ _v2 = np.deg2rad(v2 / 3600.)
+ _v3 = np.deg2rad(v3 / 3600.)
# compute components
sin_rho = sqrt((pow(sin(_v2),2)+pow(sin(_v3),2)) - (pow(sin(_v2),2)*pow(sin(_v3),2)))
@@ -260,7 +259,7 @@ def troll(roll, dec, v2, v3):
B = atan2( sin(A)*cos(_dec), (sin(_dec)*sin_rho - cos(_dec)*cos(rho)*cos(A)))
# compute final value
- troll = RADTODEG(pi - (gamma+B))
+ troll = np.rad2deg(pi - (gamma+B))
return troll