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/tbcalc.cl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 noao/digiphot/ptools/tbcalc.cl (limited to 'noao/digiphot/ptools/tbcalc.cl') diff --git a/noao/digiphot/ptools/tbcalc.cl b/noao/digiphot/ptools/tbcalc.cl new file mode 100644 index 00000000..25f1ee60 --- /dev/null +++ b/noao/digiphot/ptools/tbcalc.cl @@ -0,0 +1,37 @@ +# TBCALC -- Perform arithmetic operations on a column column of an +# APPHOT/DAOPHOT STSDAS table database. + +procedure tbcalc (tables, column, value) + +file tables {prompt="Input apphot/daophot tables databases to be renumbered"} +string column {prompt="Column to be edited"} +string value {prompt="New value or expression for column"} + +struct *inlist + +begin + # Declare local variables. + file ttables, tcolumn, tvalue + string tmpin, inname + + # Get the positional parameters. + ttables = tables + tcolumn = column + tvalue = value + + tmpin = mktemp ("tmp$") + files (ttables, sort=no, > tmpin) + + inlist = tmpin + while (fscan (inlist, inname) != EOF) { + if (defpar ("tcalc.verbose") || defpar ("tcalc.harmless")) { + tcalc (inname, tcolumn, tvalue, datatype="real", colunits="", + colfmt="", verbose=no, harmless=0.1) + } else { + tcalc (inname, tcolumn, tvalue, datatype="real", colunits="", + colfmt="") + } + } + delete (tmpin, ver-, >& "dev$null") + inlist = "" +end -- cgit