aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/splot/anshdr.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/anshdr.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/onedspec/splot/anshdr.x')
-rw-r--r--noao/onedspec/splot/anshdr.x84
1 files changed, 84 insertions, 0 deletions
diff --git a/noao/onedspec/splot/anshdr.x b/noao/onedspec/splot/anshdr.x
new file mode 100644
index 00000000..e314454b
--- /dev/null
+++ b/noao/onedspec/splot/anshdr.x
@@ -0,0 +1,84 @@
+include <time.h>
+include <fset.h>
+include <smw.h>
+
+# ANS_HDR -- Add answer header in answer file
+
+procedure ans_hdr (sh, newimage, key, fname1, fname2, fd1, fd2)
+
+pointer sh
+int newimage
+int key
+char fname1[SZ_FNAME]
+char fname2[SZ_FNAME]
+int fd1, fd2
+
+pointer sp, time
+long clktime()
+int key1, open()
+errchk open
+data key1/0/
+
+begin
+ # Check for valid file name
+ if (fd1 == NULL && fname1[1] != EOS) {
+ fd1 = open (fname1, APPEND, TEXT_FILE)
+ call fseti (fd1, F_FLUSHNL, YES)
+ }
+ if (fd2 == NULL && fname2[1] != EOS) {
+ fd2 = open (fname2, APPEND, TEXT_FILE)
+ call fseti (fd2, F_FLUSHNL, YES)
+ }
+
+ # Print image name.
+ if (newimage == YES) {
+ call smark (sp)
+ call salloc (time, SZ_DATE, TY_CHAR)
+ call cnvdate (clktime(0), Memc[time], SZ_DATE)
+
+ if (fd1 != NULL) {
+ call fprintf (fd1, "\n%s [%s%s]: %s\n")
+ call pargstr (Memc[time])
+ call pargstr (IMNAME(sh))
+ call pargstr (IMSEC(sh))
+ call pargstr (TITLE(sh))
+ }
+ if (fd2 != NULL) {
+ call fprintf (fd2, "\n%s [%s%s]: %s\n")
+ call pargstr (Memc[time])
+ call pargstr (IMNAME(sh))
+ call pargstr (IMSEC(sh))
+ call pargstr (TITLE(sh))
+ }
+ call sfree (sp)
+ }
+
+ # Print key dependent header.
+ if (key != key1) {
+ if (key != 'm') {
+ if (fd1 != NULL) {
+ call fprintf (fd1, "%10s%10s%10s%10s%10s%10s%10s\n")
+ call pargstr ("center")
+ call pargstr ("cont")
+ call pargstr ("flux")
+ call pargstr ("eqw")
+ call pargstr ("core")
+ call pargstr ("gfwhm")
+ call pargstr ("lfwhm")
+ call flush (fd1)
+ }
+ if (fd2 != NULL) {
+ call fprintf (fd2, "%10s%10s%10s%10s%10s%10s%10s\n")
+ call pargstr ("center")
+ call pargstr ("cont")
+ call pargstr ("flux")
+ call pargstr ("eqw")
+ call pargstr ("core")
+ call pargstr ("gfwhm")
+ call pargstr ("lfwhm")
+ call flush (fd2)
+ }
+ }
+ key1 = key
+ }
+end