From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/digiphot/ptools/tbrenumber.cl | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 noao/digiphot/ptools/tbrenumber.cl (limited to 'noao/digiphot/ptools/tbrenumber.cl') diff --git a/noao/digiphot/ptools/tbrenumber.cl b/noao/digiphot/ptools/tbrenumber.cl new file mode 100644 index 00000000..75778ac6 --- /dev/null +++ b/noao/digiphot/ptools/tbrenumber.cl @@ -0,0 +1,36 @@ +# TBRENUMBER -- Renumber the ID column of an APPHOT/DAOPHOT STSDAS table +# database. + +procedure tbrenumber (tables) + +file tables {prompt="Input apphot/daophot tables databases to be renumbered"} +int idoffset {0, min=0, prompt="Id number offset"} +string id {"ID", prompt="Id name keyword"} + +struct *inlist + +begin + # Declare local variables. + file ttables + string tmpin, inname, expr + + # Get the positional parameters. + ttables = tables + expr = "rownum + " // idoffset + + tmpin = mktemp ("tmp$") + files (ttables, sort=no, > tmpin) + + inlist = tmpin + while (fscan (inlist, inname) != EOF) { + if (defpar ("tcalc.verbose") || defpar ("tcalc.harmless")) { + tcalc (inname, id, expr, datatype="real", colunits="", + colfmt="", verbose=no, harmless=0.1) + } else { + tcalc (inname, id, expr, datatype="real", colunits="", + colfmt="") + } + } + delete (tmpin, ver-, >& "dev$null") + inlist = "" +end -- cgit