From b5f4204747f7e4105049713b40d7bca0fae052e5 Mon Sep 17 00:00:00 2001 From: hack Date: Tue, 25 Oct 2011 21:25:35 +0000 Subject: 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 --- lib/stwcs/updatewcs/makewcs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/stwcs/updatewcs/makewcs.py') 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 -- cgit