summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--updatewcs/__init__.py30
-rw-r--r--updatewcs/corrections.py52
-rw-r--r--updatewcs/det2im.py16
-rw-r--r--updatewcs/dgeo.py6
4 files changed, 61 insertions, 43 deletions
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py
index 52769ef..48c4c43 100644
--- a/updatewcs/__init__.py
+++ b/updatewcs/__init__.py
@@ -21,8 +21,7 @@ __version__ = '0.8'
def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True,
checkfiles=True, wcskey=" ", wcsname=" ", clobber=False):
"""
- Purpose
- =======
+
Updates HST science files with the best available calibration information.
This allows users to retrieve from the archive self contained science files
which do not require additional reference files.
@@ -32,40 +31,41 @@ def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True,
Example
- =======
+ -------
>>>from stwcs import updatewcs
>>>updatewcs.updatewcs(filename)
Dependencies
- ============
+ ------------
`pytools`
`pyfits`
`pywcs`
- :Parameters:
- `input`: a python list of file names or a string (wild card characters allowed)
+ Parameters
+ ----------
+ input: a python list of file names or a string (wild card characters allowed)
input files may be in fits, geis or waiver fits format
- `vacorr`: boolean
+ vacorr: boolean
If True, vecocity aberration correction will be applied
- `tddcorr`: boolean
- If True, time dependent distortion correction will be applied
- `dgeocorr`: boolean
+ tddcorr: boolean
+ If True, time dependent distortion correction will be applied
+ dgeocorr: boolean
If True, a Lookup table distortion will be applied
- `d2imcorr`: boolean
+ d2imcorr: boolean
If True, detector to image correction will be applied
- `checkfiles`: boolean
+ checkfiles: boolean
If True, the format of the input files will be checked,
geis and waiver fits files will be converted to MEF format.
Default value is True for standalone mode.
- `wcskey`: None, one character string A-Z or an empty string of length 1
+ wcskey: None, one character string A-Z or an empty string of length 1
If None - the primary WCS is not archived
If an empty string - the next available wcskey is used for the archive
A-Z - use this key to archive the WCS
- `wcsname`: a string
+ wcsname: a string
The name under which the primary WCS is archived after it is updated.
If an empty string (default), the name of the idctable is used as
a base.
- `clobber`: boolean
+ clobber: boolean
a flag for reusing the wcskey when archiving the primary WCS
"""
files = parseinput.parseinput(input)[0]
diff --git a/updatewcs/corrections.py b/updatewcs/corrections.py
index 686277c..ee73d61 100644
--- a/updatewcs/corrections.py
+++ b/updatewcs/corrections.py
@@ -12,19 +12,31 @@ DGEOCorr = dgeo.DGEOCorr
class TDDCorr(object):
"""
- Purpose
- =======
- Apply time dependent distortion correction to SIP coefficients and basic
- WCS keywords. It is applicable only to ACS/WFC data.
+ Apply time dependent distortion correction to distortion coefficients and basic
+ WCS keywords. This applies only to ACS/WFC data.
+
+ Parameters
+ ----------
+ ext_wcs: HSTWCS object
+ An HSTWCS object to be modified
+ ref_wcs: HSTWCS object
+ A reference HSTWCS object
+
+ Notes
+ -----
+ Compute the ACS/WFC time dependent distortion terms
+ as described in [1]_.
- Ref: Jay Anderson, ACS ISR 2007-08, Variation of the Distortion
- Solution of the WFC
+ The zero-point terms account for the skew accumulated between
+ 2002.0 and 2004.5, when the latest IDCTAB was delivered.
+ alpha = 0.095 + 0.090*(rday-dday)/2.5
+ beta = -0.029 - 0.030*(rday-dday)/2.5
+
+
+ References
+ ----------
+ .. [1] Jay Anderson, "Variation of the Distortion Solution of the WFC", ACS ISR 2007-08.
- :Parameters:
- `ext_wcs`: HSTWCS object
- An extension HSTWCS object to be modified
- `ref_wcs`: HSTWCS object
- A reference HSTWCS object
"""
def updateWCS(cls, ext_wcs, ref_wcs):
@@ -119,11 +131,13 @@ class TDDCorr(object):
class VACorr(object):
"""
- Purpose
- =======
Apply velocity aberation correction to WCS keywords.
- Modifies the CD matrix and CRVAL1/2
-
+
+ Notes
+ -----
+ Velocity Aberration is stored in the extension header keyword 'VAFACTOR'.
+ The correction is applied to the CD matrix and CRVALs.
+
"""
def updateWCS(cls, ext_wcs, ref_wcs):
@@ -148,9 +162,11 @@ class VACorr(object):
class CompSIP(object):
"""
- Purpose
- =======
- Compute SIP coefficients from idc table coefficients.
+ Compute SIP coefficients from IDC table coefficients.
+
+ Notes
+ -----
+
"""
def updateWCS(cls, ext_wcs, ref_wcs):
diff --git a/updatewcs/det2im.py b/updatewcs/det2im.py
index c9837c9..993ec52 100644
--- a/updatewcs/det2im.py
+++ b/updatewcs/det2im.py
@@ -7,12 +7,16 @@ import utils
class DET2IMCorr(object):
def updateWCS(cls, fobj):
"""
- :Parameters:
- `fobj`: pyfits object
- Science file, for which a detector to image correction
- is available
- Uses a kw 'D2IMFILE' in the primary header to create an extension with
- a detector to image correction.
+ Parameters
+ ----------
+ fobj: pyfits object
+ Science file, for which a detector to image correction
+ is available
+
+ Notes
+ -----
+ Uses the file pointed to in the primary header keyword 'D2IMFILE'
+ to create an extension with a detector to image correction.
"""
assert isinstance(fobj, pyfits.HDUList)
diff --git a/updatewcs/dgeo.py b/updatewcs/dgeo.py
index fd1c214..7c6ec45 100644
--- a/updatewcs/dgeo.py
+++ b/updatewcs/dgeo.py
@@ -7,13 +7,11 @@ import numpy as np
class DGEOCorr(object):
"""
- Purpose
- =======
Defines a Lookup table prior distortion correction as per WCS paper IV.
It uses a reference file defined by the NPOLFILE (suffix 'NPL') keyword in the primary header.
- Algorithm
- =========
+ Notes
+ -----
- Using extensions in the reference file create a WCSDVARR extension
and add it to the file object.
- Add record-valued keywords which describe the lookup tables to the