diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/twodspec/apextract/apshow.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/twodspec/apextract/apshow.x')
-rw-r--r-- | noao/twodspec/apextract/apshow.x | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/noao/twodspec/apextract/apshow.x b/noao/twodspec/apextract/apshow.x new file mode 100644 index 00000000..16f4d504 --- /dev/null +++ b/noao/twodspec/apextract/apshow.x @@ -0,0 +1,46 @@ +include "apertures.h" + +# AP_SHOW -- List the apertures to a text file. + +procedure ap_show (file, aps, naps) + +char file[ARB] # Aperture file +pointer aps[ARB] # Aperture pointers +int naps # Number of apertures + +pointer ap +int i, apaxis, fd, open() +errchk open + +begin + if (naps == 0) + return + + # Open the output file. Return if an error occurs. + fd = open (file, APPEND, TEXT_FILE) + + call fprintf (fd, "# APERTURES\n\n%4s %4s %7s %7s %7s %s\n") + call pargstr ("##ID") + call pargstr ("BEAM") + call pargstr ("CENTER") + call pargstr ("LOW") + call pargstr ("HIGH") + call pargstr ("TITLE") + for (i = 1; i <= naps; i = i + 1) { + ap = aps[i] + apaxis = AP_AXIS(ap) + call fprintf (fd, "%4d %4d %7.2f %7.2f %7.2f") + call pargi (AP_ID(ap)) + call pargi (AP_BEAM(ap)) + call pargr (AP_CEN(ap, apaxis)) + call pargr (AP_LOW(ap, apaxis)) + call pargr (AP_HIGH(ap, apaxis)) + if (AP_TITLE(ap) != NULL) { + call fprintf (fd, " %s") + call pargstr (Memc[AP_TITLE(ap)]) + } + call fprintf (fd, "\n") + } + + call close (fd) +end |