aboutsummaryrefslogtreecommitdiff
path: root/noao/mtlocal/pds/structure.hlp
blob: 6bb2eab806c8f8388736f43606aa0ecac0da3628 (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
.help pdsread 2  "Program Structure"
.sh
PDSREAD Structure Chart

.nf
t_pdsread()
# Returns when file list is satisfied or if EOT is encountered.

    read_pds (pdsfile, iraffile)
    # Returns OK or EOF
	
	read_header (pds_fd, im, parameters)
	# Returns OK or EOF

	read_image (pds_fd, im, parameters)

	    set_image_header (im)

	    init_read_scan (parameters)
	    # Returns OK

	    read_scan (fd, scanbuf)
	    # Returns EOF or number of points in a scan
.fi

.sh
PDSREAD Structure Summary

.ls t_pdsread
The main procedure reads the control parameters.
The files to be read and converted are calculated from the specified source
and file list.
A loop through the files determines the specific input source names and
output file names and calls READ_PDS for each conversion.
.ls read_pds
The input source is opened and the output image header file is created.
If only the PDS header is to be listed then a temporary image header
file is created. The PDS header is read and decoded into the IRAF
image header bye READ_HEADER. If the image is to be read then
READ_IMAGE is called. Finally all files are closed. If a temporary
image file was created it is deleted.
.ls read_header
The 120 byte PDS header is read into an integer array. The ID string
in the first 80 bytes is unpacked into a text string using the MIIUP routine
and stored in the IRAF image header. The 12 bit PDP values are converted to
SPP short data valuese using the routine APDP8S.
The PDP 059 text code is converted to ASCII using the routine APDP059.
The remaining header quantities are unpacked into short
or long SPP integers using the MIIUP, APDP8S, UNPACKS and UNPACKL and
the image dimensions are stored in the IRAF image header.
Finally the PRINT_HEADER is called to print a long or short version of the
header.
.le
.ls read_image
The PDS image pixels are converted to an IRAF image file.
The image file header is set.
The lines of the image are converted one at a time.
.ls set_image_header
The pixel type for the IRAF image is set to the user specified type.
If no type has been specified then the type is determined from the
number of bits per pixel given in pds.h.
.le
.ls init_read_scan
Initializes the scan parameters. Input is a long integer array containing
the decoded header parameters. The procedure uses the number of data points
per scan, the number of records per scan and the number of points per full
records, calculates and allocates the buffer space required and determines
the size of each record in chars. If the tape is an old 7 track tape the
size of the record must be rounded up till it holds an integral number
of Cyber words in length. For example a record containing 1001 real data
points will actually be 1005 data points long with junk in the last 4 spaces.
.le
.ls read_scan
Reads an entire PDS scan a record at a time looping over the number of
records per scan. The procedure uses the MIIUP
routine which is machine dependent. The bitpix must correspond to
an MII type. READ_SCAN returns the number of data points per scan or EOF.
READ_SCAN  calls APDP8S to convert the 10 or 12 bit data values to short
integers and calls AFLIPS to flip every other scan if the PDS scan
is a raster scan.
.le
.le
.le
.le
.endhelp