diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/gtedit/gtdodel.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/gtedit/gtdodel.x')
-rw-r--r-- | pkg/utilities/nttools/gtedit/gtdodel.x | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/gtedit/gtdodel.x b/pkg/utilities/nttools/gtedit/gtdodel.x new file mode 100644 index 00000000..7292048c --- /dev/null +++ b/pkg/utilities/nttools/gtedit/gtdodel.x @@ -0,0 +1,41 @@ +include <tbset.h> + +# GT_DODEL -- Actually delete the rows marked for deletion + +procedure gt_dodel (tp, tpr, deleted, npix) + +pointer tp +pointer tpr +int deleted[ARB] # io: Array of deleted flags +int npix # io: # of rows in table + +int i, j, k + +int tbpsta() + +begin + if (tpr != NULL) { + # Append to whatever is already in the table + k = tbpsta (tpr, TBL_NROWS) + do i = 1, npix { + if (deleted[i] == YES) { + k = k + 1 + call tbrcpy (tp, tpr, i, k) + } + } + } + + for (j = npix; j> 0; j = j - 1) { + if (deleted[j] == YES) { + i = j + while (deleted[i] == YES) { + i = i - 1 + if (i < 1) + break + } + i = i + 1 + call tbrdel (tp, i, j) + j = i - 1 + } + } +end |