diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/tjoin/removejcol.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/tjoin/removejcol.x')
-rw-r--r-- | pkg/utilities/nttools/tjoin/removejcol.x | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/tjoin/removejcol.x b/pkg/utilities/nttools/tjoin/removejcol.x new file mode 100644 index 00000000..1578021b --- /dev/null +++ b/pkg/utilities/nttools/tjoin/removejcol.x @@ -0,0 +1,43 @@ +include "tjoin.h" + +# B.Simon 16-Apr-99 first code + +# REMOVE_JCOL -- Remove join columns from list of data columns + +procedure remove_jcol (tj, tol) + +pointer tj # i: Descriptor of table information +pointer tol # i: Vector of tolerances used in equality test +#-- +bool match +int icol, jcol, kcol + +begin + kcol = 0 + do icol = 1, TJ_DNUM(tj) { + # Determine if this column is a join column + # with strict equality testing + + match = false + do jcol = 1, TJ_JNUM(tj) { + if (TJ_DCOL(tj,icol) == TJ_JCOL(tj,jcol) && + TOL_VAL(tol,jcol) == 0.0) { + match = true + break + } + } + + # Don't copy these columns as they duplicate the values + # in the join column in the other table. Also don't copy + # if icol == kcol in order to save time + + if (! match) { + kcol = kcol + 1 + if (kcol < icol) + TJ_DCOL(tj,kcol) = TJ_DCOL(tj,icol) + } + } + + TJ_DNUM(tj) = kcol +end + |