File: clsimage.x

package info (click to toggle)
iraf-rvsao 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 16,456 kB
  • sloc: ansic: 963; lisp: 651; fortran: 397; makefile: 27
file content (52 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download
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
#*** File rvsao/Util/clsimage.x
#*** July 9, 2010
#*** By Doug Mink

#  CLOSE_IMAGE -- Close IRAF image opened by GETIMAGE
 
include	<imhdr.h>
include	<smw.h>
 
procedure close_image (im, sh)
 
pointer	im		# Image header structure [returned]
pointer	sh		# Spectrum header structure [returned]

begin

	if (sh == ERR)
	    sh = NULL

#  Close spectrum WCS structure
	if (sh != NULL) {
	    if (MW(sh) != NULL) {
		call smw_close (MW(sh))
		MW(sh) = NULL
		}

#  Close spectrum header
	    call shdr_close (sh)
	    sh = NULL
	    }

#  Unmap the image
	if (im == ERR)
	    im = NULL
	if (im != NULL) {
	    call imunmap (im)
	    im = NULL
	    }

	return
end
# Mar 13 1995	New subroutine
# Mar 29 1995	Close header and image if not NULL or ERR
# Oct  5 1995	Change SHDR_CLOSE call to SPHD_CLOSE

# Aug  7 1996	Use smw.h; close MWCS structure separately

# Mar 20 1998	Drop separate closing of MWCS structure

# Nov 12 1999	Close spectral MWCS explicitly; shdr_close() does not do it

# Jul 09 2010	Don't close spectrum WCS structure if spectrum header is NULL