diff options
Diffstat (limited to 'hstwcs')
| -rw-r--r-- | hstwcs/__init__.py | 1 | ||||
| -rwxr-xr-x | hstwcs/alignwcs.py | 4 | ||||
| -rw-r--r-- | hstwcs/apply_corrections.py | 5 | ||||
| -rw-r--r-- | hstwcs/makewcs.py | 6 | 
4 files changed, 8 insertions, 8 deletions
| diff --git a/hstwcs/__init__.py b/hstwcs/__init__.py index 2d280c4..84f6cec 100644 --- a/hstwcs/__init__.py +++ b/hstwcs/__init__.py @@ -15,6 +15,7 @@ import apply_corrections  __docformat__ = 'restructuredtext' +__version__ = '0.3'  def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, checkfiles=True):      """ diff --git a/hstwcs/alignwcs.py b/hstwcs/alignwcs.py index 9bdef8e..db96ef6 100755 --- a/hstwcs/alignwcs.py +++ b/hstwcs/alignwcs.py @@ -64,8 +64,8 @@ def apply_shifts(asndict, outwcs):                  extver = extn.header['extver']                  owcs = pywcs.WCS(extn.header, f)                  crvals = np.array([owcs.wcs.crval]) -                px = outwcs.wcs.s2p_fits(crvals)['pixcrd'] + shifts -                ncrvals = outwcs.all_pix2sky_fits(px) +                px = outwcs.wcs.s2p(crvals, 1)['pixcrd'] + shifts +                ncrvals = outwcs.all_pix2sky(px, 1)                  pyfits.setval(filename, 'CRVAL1', value=ncrvals[0,0], ext=extver)                  pyfits.setval(filename, 'CRVAL2', value=ncrvals[0,1], ext=extver)                  print 'Updated %s with shifts ' % filename, shifts diff --git a/hstwcs/apply_corrections.py b/hstwcs/apply_corrections.py index 1a3b726..22dfbbc 100644 --- a/hstwcs/apply_corrections.py +++ b/hstwcs/apply_corrections.py @@ -97,8 +97,6 @@ def applyDgeoCorr(fname, udgeocorr):              print 'DGEO correction will not be applied\n'              applyDGEOCorr = False              return applyDGEOCorr  -        if isOldStyleDGEO(fname, fdgeo0): -            applyDGEOCorr = False                 try:              # get DGEOFILE kw from first extension header              fdgeo1 = pyfits.getval(fname, 'DGEOFILE', ext=1) @@ -120,7 +118,8 @@ def applyDgeoCorr(fname, udgeocorr):          print 'DGEOFILE keyword not found in primary header'          applyDGEOCorr = False -     +    if isOldStyleDGEO(fname, fdgeo0): +            applyDGEOCorr = False             return (applyDGEOCorr and udgeocorr)  def isOldStyleDGEO(fname, dgname): diff --git a/hstwcs/makewcs.py b/hstwcs/makewcs.py index d016583..650d251 100644 --- a/hstwcs/makewcs.py +++ b/hstwcs/makewcs.py @@ -93,7 +93,7 @@ class MakeWCS(object):          dY=(off*cos(theta)) + offshifty          px = numpy.array([[dX,dY]]) -        newcrval = ref_wcs.wcs.p2s_fits(px)['world'][0] +        newcrval = ref_wcs.wcs.p2s(px, 1)['world'][0]          newcrpix = numpy.array([ext_wcs.idcmodel.refpix['XREF'] + ltvoffx,                                   ext_wcs.idcmodel.refpix['YREF'] + ltvoffy])          ext_wcs.wcs.crval = newcrval @@ -116,7 +116,7 @@ class MakeWCS(object):          # Rotate the vectors          dxy = numpy.dot(rrmat, delmat) -        wc = ref_wcs.wcs.p2s_fits(px + dxy)['world'] +        wc = ref_wcs.wcs.p2s((px + dxy), 1)['world']          # Calculate the new CDs and convert to degrees          cd11 = utils.diff_angles(wc[0,0],newcrval[0])*cos(newcrval[1]*pi/180.0) @@ -143,7 +143,7 @@ class MakeWCS(object):          rref = numpy.array([[ref_wcs.idcmodel.refpix['XREF']+ltvoffx ,                               ref_wcs.idcmodel.refpix['YREF']+ltvoffy]]) -        crval = ref_wcs.wcs.p2s_fits(rref)['world'][0] +        crval = ref_wcs.wcs.p2s(rref, 1)['world'][0]          # Convert the PA_V3 orientation to the orientation at the aperture          # This is for the reference chip only - we use this for the          # reference tangent plane definition | 
