aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/ptools/pconcat.cl
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /noao/digiphot/ptools/pconcat.cl
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/ptools/pconcat.cl')
-rw-r--r--noao/digiphot/ptools/pconcat.cl56
1 files changed, 56 insertions, 0 deletions
diff --git a/noao/digiphot/ptools/pconcat.cl b/noao/digiphot/ptools/pconcat.cl
new file mode 100644
index 00000000..7d098eee
--- /dev/null
+++ b/noao/digiphot/ptools/pconcat.cl
@@ -0,0 +1,56 @@
+# PCONCAT -- Concatenate a list of apphot/daophot databases into a single
+# output database. The input files must either be all text files or all data
+# files. PCONCAT checks that the input files were all created by the same
+# task.
+
+procedure pconcat (infiles, outfile)
+
+file infiles {prompt = "Input apphot/daophot database(s) to be concatenated"}
+file outfile {prompt = "Output apphot/daophot database"}
+string task {"TASK", prompt="Task name keyword"}
+
+struct *inlist
+
+begin
+ # Declare local variables.
+ bool table, text, other
+ file in, out
+ string tmpin, inname
+
+ # Cache the istable parameters.
+ cache ("istable")
+
+ # Get the positional parameters.
+ in = infiles
+ out = outfile
+
+ # Make a file lists.
+ tmpin = mktemp ("tmp$")
+ files (in, sort=no, > tmpin)
+
+ # Check to see whether the first file is a text database or a table.
+
+ inlist = tmpin
+ if (fscan (inlist, inname) != EOF) {
+ istable (inname)
+ table = istable.table
+ text = istable.text
+ other = istable.other
+ } else {
+ table = no
+ text = no
+ other = no
+ }
+ delete (tmpin, ver-, >& "dev$null")
+ inlist = ""
+
+ # Do the actual appending.
+ if (table)
+ tbconcat (in, out, task=task)
+ else if (text)
+ txconcat (in, out, task=task)
+ else if (access (inname))
+ print ("File " // inname // " is not an APPHOT/DAOPHOT database")
+ else
+ print ("File " // inname // " does not exist")
+end