aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/parser/prvtran.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/digiphot/photcal/parser/prvtran.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/photcal/parser/prvtran.x')
-rw-r--r--noao/digiphot/photcal/parser/prvtran.x25
1 files changed, 25 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/parser/prvtran.x b/noao/digiphot/photcal/parser/prvtran.x
new file mode 100644
index 00000000..6119ce05
--- /dev/null
+++ b/noao/digiphot/photcal/parser/prvtran.x
@@ -0,0 +1,25 @@
+# PR_VTRAN -- Translate the internal parser symbol for an error or weight
+# column definition into a compact user readable definition. This code is
+# intended primarily for interfacing to the inlfit or other package with
+# the goal of making more pleasing variable names.
+
+procedure pr_vtran (invname, outvname, maxch)
+
+char invname[ARB] # the input variable name
+char outvname[ARB] # the output variable name
+int maxch # maximum number of characters
+
+int first, last
+int gstrmatch()
+
+begin
+ if (gstrmatch (invname, "@E_", first, last) != 0) {
+ call sprintf (outvname, maxch, "er(%s)")
+ call pargstr (invname[last+1])
+ } else if (gstrmatch (invname, "@W_", first, last) != 0) {
+ call sprintf (outvname, maxch, "wt(%s)")
+ call pargstr (invname[last+1])
+ } else {
+ call strcpy (invname, outvname, maxch)
+ }
+end