aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/cdl/examples/fdisplay.f
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 /vendor/x11iraf/cdl/examples/fdisplay.f
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vendor/x11iraf/cdl/examples/fdisplay.f')
-rw-r--r--vendor/x11iraf/cdl/examples/fdisplay.f65
1 files changed, 65 insertions, 0 deletions
diff --git a/vendor/x11iraf/cdl/examples/fdisplay.f b/vendor/x11iraf/cdl/examples/fdisplay.f
new file mode 100644
index 00000000..d14633f6
--- /dev/null
+++ b/vendor/x11iraf/cdl/examples/fdisplay.f
@@ -0,0 +1,65 @@
+C ========================================================================
+C =
+C FDISPLAY -- Example fortran program showing the use of the Client =
+C Display Library (CDL) Fortran interface for displaying images. In =
+C this simple program all input is prompted for on the command line. =
+C =
+C ========================================================================
+
+
+ program fdisplay
+ character*132 imname
+ character*132 imtdev
+
+C --------------------------
+C Initialize the CDL package
+C --------------------------
+ call getenv('IMTDEV',imtdev)
+ call cfopen(imtdev, ier)
+ if (ier .gt. 0) then
+ write (*,*) 'open: Error return from CDL'
+ goto 999
+ endif
+
+ write (*, "('Image Name: ', $)")
+ read (5, *) imname
+ write (*, "('Frame Number: ', $)")
+ read (5, *) iframe
+ write (*, "('Frame buffer configuration number: ', $)")
+ read (5, *) ifb
+
+C ----------------------------------------------------------
+C If we've got a FITS format image, go ahead and display it.
+C ----------------------------------------------------------
+ call cfisfits (imname, isfits)
+ if (isfits .gt. 0) then
+ call cfdisplayfits (imname, iframe, ifb, 1, ier)
+ if (ier .gt. 0) then
+ write (*,*) 'displayFITS: Error return from CDL'
+ goto 999
+ endif
+ else
+C --------------------------------------------------------
+C We've got an IRAF format image, go ahead and display it.
+C --------------------------------------------------------
+ call cfisiraf (imname, isiraf)
+ if (isiraf .gt. 0) then
+ call cfdisplayiraf (imname, 1, iframe, ifb, 1, ier)
+ if (ier .gt. 0) then
+ write (*,*) 'displayIRAF: Error return from CDL'
+ goto 999
+ endif
+ else
+C ----------------------------------
+C Unrecognized image, punt and exit.
+C ----------------------------------
+ write (*,*) 'Unrecognized image format'
+ endif
+ endif
+
+C ------------------
+C Clean up and exit.
+C ------------------
+999 continue
+ call cfclose (ier)
+ end