aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/README
blob: f1fd0a6067b52a6475192f5c4731640cc9c897a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
The IMFORT Interface
			 Doug Tody, September 1986


1. INTRODUCTION

    The IMFORT interface is a host level Fortran programming environment for
IRAF.  Fortran programs (or C programs) may be written at the host level
with full access to the facilities of the host environment, plus limited
access to the IRAF environment via the IMFORT interface.  Such host level
programs may be interfaced to the IRAF CL as foreign tasks and called with
arguments on the command line, like ordinary IRAF tasks.

The chief advantage of the IMFORT interface is that it allows existing host
Fortran programs to be interfaced to IRAF with minimum effort.  The IMFORT
interface also provides a way for the scientist-user to extend the IRAF
environment with their own programs, without need to learn to use the much
more complex IRAF VOS programming environment.  Of course, the VOS is a much
more powerful environment and VOS programs tend to be much more portable than
host Fortran programs, so the VOS environment should be used for large
programming projects.

The IMFORT interface is described in detail in the document "A User's Guide
to Fortran Programming in the IRAF Environment".  A summary of the interface
procedures follows.  The IMFORT routines make use of the IRAF kernel for all
i/o, and of the FMTIO and VOPS packages for miscellaneous functions, hence
programs using IMFORT must be linked with LIBSYS, LIBVOPS, and LIBOS.


2. INTERFACE PROCEDURES

2.1 COMMAND LINE ACCESS

		clnarg (nargs)
		clrawc (outstr, ier)
           clarg[cird] (argno, [cird]val, ier)


2.2 IMAGE ACCESS

2.2.1 General

		imopen (f77nam, acmode, im, ier)
		imopnc (nimage, o_im, n_im, ier)
		imcrea (f77nam, axlen, naxis, pixtype, ier)
		imclos (im, ier)

		imflsh (im, ier)
		imgsiz (im, axlen, naxis, pixtype, ier)
		imhcpy (o_im, n_im, ier)
		impixf (im, pixfd, pixfil, pixoff, szline, ier)

		imemsg (ier, errmsg)


2.2.2 Image Header Keyword Access

		imacck (im, keyw)
		imaddk (im, keyw, dtype, comm, ier)
		imdelk (im, keyw, ier)
		imtypk (im, keyw, dtype, comm, ier)

	  imakw[bcdir] (im, keyw, [bcdir]val, comm, ier)
	  imgkw[bcdir] (im, keyw, [bcdir]val, ier)
	  impkw[bcdir] (im, keyw, [bcdir]val, ier)

		imokwl (im, patstr, sortit, kwl, ier)
		imgnkw (kwl, outstr, ier)
		imckwl (kwl, ier)


2.2.3 Image Pixel Access

	     imgl1[rs] (im, buf, ier)
	     imgl2[rs] (im, buf, lineno, ier)
	     imgl3[rs] (im, buf, lineno, bandno, ier)
	     imgs1[rs] (im, buf, i1, i2, ier)
	     imgs2[rs] (im, buf, i1, i2, j1, j2, ier)
	     imgs3[rs] (im, buf, i1, i2, j1, j2, k1, k2, ier)

	     impl1[rs] (im, buf, ier)
	     impl2[rs] (im, buf, lineno, ier)
	     impl3[rs] (im, buf, lineno, bandno, ier)
	     imps1[rs] (im, buf, i1, i2, ier)
	     imps2[rs] (im, buf, i1, i2, j1, j2, ier)
	     imps2[rs] (im, buf, i1, i2, j1, j2, k1, k2, ier)


2.3. BINARY FILE I/O (low level)

		bfaloc (fname, nchars, status)
	   fd = bfopen (fname, acmode, advice)
		bfclos (fd, status)
       nchars = bfbsiz (fd)
	 chan = bfchan (fd)
       nchars = bfread (fd, buf, nchars, offset)
       nchars = bfwrit (fd, buf, nchars, offset)
	 stat = bfflsh (fd)