diff options
author | dencheva <dencheva@stsci.edu> | 2011-08-19 11:06:32 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2011-08-19 11:06:32 -0400 |
commit | 19c0cbe558324f033407ee4c64b09d651eae3cad (patch) | |
tree | b4741a9d03e953803299c5275254e97c703fd246 | |
parent | a077f9e3282a1c705f2a7dca7cbf61b0c5816b11 (diff) | |
download | stwcs_hcf-19c0cbe558324f033407ee4c64b09d651eae3cad.tar.gz |
A fix for computing the WCS of polarizer data. This software change requires also a change to and a new delivery of the IDC table for polarizer data. Tested with a private version of IDCTAB.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13639 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | lib/stwcs/wcsutil/hstwcs.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/stwcs/wcsutil/hstwcs.py b/lib/stwcs/wcsutil/hstwcs.py index 11c1f42..1e0e23d 100644 --- a/lib/stwcs/wcsutil/hstwcs.py +++ b/lib/stwcs/wcsutil/hstwcs.py @@ -134,7 +134,7 @@ class HSTWCS(WCS): to a CD matrix, if reasonable, by running pc2.cd() method.\n \ The plate scale can be set then by calling setPscale() method.\n" self.pscale = None - + def setOrient(self): """ Computes ORIENTAT from the CD matrix @@ -239,13 +239,35 @@ class HSTWCS(WCS): chip=self.chip, direction='forward', date=self.date_obs, filter1=self.filter1, filter2=self.filter2, offtab=self.offtab, binned=self.binned) + + if self.ltv1 != 0. or self.ltv2 != 0.: + self.resetLTV() if update: if header==None: print 'Update header with IDC model kw requested but header was not provided\n.' else: self._updatehdr(header) - + + def resetLTV(self): + """ + Reset LTV values for polarizer data + + The polarizer field is smaller than the detector field. + The distortion coefficients are defined for the entire + polarizer field and the LTV values are set as with subarray + data. This may also be true for other special filters. + This is a special case when the observation is considered + a subarray in terms of detector field but a full frame in + terms of distortion model. + To avoid shifting the distortion coefficients the LTV values + are reset to 0. + """ + if self.naxis1 == self.idcmodel.refpix['XSIZE'] and \ + self.naxis2 == self.idcmodel.refpix['YSIZE']: + self.ltv1 = 0. + self.ltv2 = 0. + def wcs2header(self, sip2hdr=False, idc2hdr=True): """ Create a pyfits.Header object from WCS keywords. |