diff options
author | hack <hack@stsci.edu> | 2011-04-12 15:56:56 -0400 |
---|---|---|
committer | hack <hack@stsci.edu> | 2011-04-12 15:56:56 -0400 |
commit | 2f520b098f825edb6a77b1c1b6108ab8d41e3f9e (patch) | |
tree | df4630bc47cc288170b8f6f0d4956edbb2335163 | |
parent | bcfef1cb19777e406fa620a497e76fd5096aa7c2 (diff) | |
download | stwcs_hcf-2f520b098f825edb6a77b1c1b6108ab8d41e3f9e.tar.gz |
The logic for finding an empty (matching) row in 'wcscorr.find_wcscorr_row()' was modified to strip blank characters from the end of each element before comparing. This allows the '==' comparison to actually match a blank string and find the rows to be filled. The fix allows the WFC3/IR demo datasets (8 WFC3/IR images) to be processed by betadrizzle.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@12456 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | wcsutil/wcscorr.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wcsutil/wcscorr.py b/wcsutil/wcscorr.py index d5f1de4..527f289 100644 --- a/wcsutil/wcscorr.py +++ b/wcsutil/wcscorr.py @@ -174,7 +174,9 @@ def find_wcscorr_row(wcstab, selections): mask = None for i in selections: - bmask = (wcstab.field(i) == selections[i]) + icol = wcstab.field(i) + if isinstance(icol,np.chararray): icol = icol.rstrip() + bmask = (icol == selections[i]) if mask is None: mask = bmask.copy() else: @@ -301,9 +303,9 @@ def update_wcscorr(dest, source=None, extname='SCI', wcs_id=None): if idx < 0: return - # Now, we need to merge this into the existing table - rowind = find_wcscorr_row(old_table.data, {'wcs_id': ''}) + rowind = find_wcscorr_row(old_table.data, {'wcs_id':''}) + old_nrows = np.where(rowind)[0][0] new_nrows = new_table.data.shape[0] |