diff options
author | hack <hack@stsci.edu> | 2012-01-30 11:15:02 -0500 |
---|---|---|
committer | hack <hack@stsci.edu> | 2012-01-30 11:15:02 -0500 |
commit | 8f3235bba033064c7f212fbffbb58afca3414c10 (patch) | |
tree | 98634df01e195672de12da55f4f62c382a0c5438 | |
parent | 50b7b6939954798bee2ce2e6979f916ce67f42b7 (diff) | |
download | stwcs_hcf-8f3235bba033064c7f212fbffbb58afca3414c10.tar.gz |
Revised 'wcscorr.init_wcscorr()' to generate an initial table with enough rows to accomodate all WCS solutions recorded in input image header.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14690 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | lib/stwcs/wcsutil/wcscorr.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stwcs/wcsutil/wcscorr.py b/lib/stwcs/wcsutil/wcscorr.py index 7c5b387..7dd8578 100644 --- a/lib/stwcs/wcsutil/wcscorr.py +++ b/lib/stwcs/wcsutil/wcscorr.py @@ -51,14 +51,17 @@ def init_wcscorr(input, force=False): else: del fimg['wcscorr'] print 'Initializing new WCSCORR table for ',fimg.filename() + + used_wcskeys = altwcs.wcskeys(fimg['SCI', 1].header) # define the primary columns of the WCSEXT table with initial rows for each # SCI extension for the original OPUS solution numsci = fileutil.countExtn(fimg) + numwcs = len(used_wcskeys) # create new table with more rows than needed initially to make it easier to # add new rows later - wcsext = create_wcscorr(descrip=True,numrows=numsci, padding=numsci * 4) + wcsext = create_wcscorr(descrip=True,numrows=numsci, padding=(numsci*numwcs) + numsci * 4) # Assign the correct EXTNAME value to this table extension wcsext.header.update('TROWS', numsci * 2, comment='Number of updated rows in table') @@ -67,7 +70,6 @@ def init_wcscorr(input, force=False): wcsext.header.update('EXTVER', 1) # define set of WCS keywords which need to be managed and copied to the table - used_wcskeys = altwcs.wcskeys(fimg['SCI', 1].header) wcs1 = stwcs.wcsutil.HSTWCS(fimg,ext=('SCI',1)) idc2header = True if wcs1.idcscale is None: |