aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/splot/mktitle.x
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/onedspec/splot/mktitle.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/onedspec/splot/mktitle.x')
-rw-r--r--noao/onedspec/splot/mktitle.x41
1 files changed, 41 insertions, 0 deletions
diff --git a/noao/onedspec/splot/mktitle.x b/noao/onedspec/splot/mktitle.x
new file mode 100644
index 00000000..554599bf
--- /dev/null
+++ b/noao/onedspec/splot/mktitle.x
@@ -0,0 +1,41 @@
+include <pkg/gtools.h>
+include <smw.h>
+include <units.h>
+
+# MKTITLE -- Make a spectrum title (IIDS style)
+
+procedure mktitle (sh, gt)
+
+pointer sh, gt
+
+pointer sp, str
+
+begin
+ # Do nothing if the GTOOLS pointer is undefined.
+ if (gt == NULL)
+ return
+
+ call smark (sp)
+ call salloc (str, SZ_LINE, TY_CHAR)
+
+ call sprintf (Memc[str], SZ_LINE,
+ "[%s%s]: %s %.2s ap:%d beam:%d")
+ call pargstr (IMNAME(sh))
+ call pargstr (IMSEC(sh))
+ call pargstr (TITLE(sh))
+ call pargr (IT(sh))
+ call pargi (AP(sh))
+ call pargi (BEAM(sh))
+
+ # Set GTOOLS labels.
+ call gt_sets (gt, GTTITLE, Memc[str])
+ if (UN_LABEL(UN(sh)) != EOS) {
+ call gt_sets (gt, GTXLABEL, UN_LABEL(UN(sh)))
+ call gt_sets (gt, GTXUNITS, UN_UNITS(UN(sh)))
+ } else {
+ call gt_sets (gt, GTXLABEL, LABEL(sh))
+ call gt_sets (gt, GTXUNITS, UNITS(sh))
+ }
+
+ call sfree (sp)
+end