From 2f520b098f825edb6a77b1c1b6108ab8d41e3f9e Mon Sep 17 00:00:00 2001 From: hack Date: Tue, 12 Apr 2011 19:56:56 +0000 Subject: 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 --- wcsutil/wcscorr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'wcsutil/wcscorr.py') 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] -- cgit