aboutsummaryrefslogtreecommitdiff
path: root/noao/mtlocal/pds/structure.doc
blob: 5a560f35b181b6f12cdd6eef42f4ad1994bb408e (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
99
100
101
102
103
104
105
PDSREAD (Program Structure)                  PDSREAD (Program Structure)



PDS Structure Chart

t_pdsread()
# Returns when file list is satified or if EOT is encountered.
# Errors from called routines are trapped and printed as a warning.

    read_pds
    # Returns OK or EOF
        
        read_header
        # Returns OK or EOF

            init_read_pixels
            # Returns OK

            read_pixels
            # Returns OK

            decode_header

                decode_text

                decode_parameters

            print_header

        read_image

            set_image_header

            init_read_pixels

            read_pixels




PDSREAD Structure Summary


t_pdsread
    The  main  procedure  reads the control parameters.  The files to be
    converted are calculated from the specified source  and  file  list.
    A  loop  through  the  files  determines  the  specific input source
    names and output filenames and calls READ_PDS for each conversion.

    read_pds
        The input source  is  opened  and  the  output  header  file  is


                                  -1-
PDSREAD (Program Structure)                  PDSREAD (Program Structure)



        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 by READ_HEADER.
        If make_image is true then READ_IMAGE is  called.   Finally  all
        the  files  are  closed.   If  a temporary image header file was
        created it is deleted.

        read_header
            The PDS header is read into an  array  of  text  and  an  an
            array  of  parameters  using INIT_READ_PIXEL and READ_PIXEL.
            These arrays are passed to  DECODE_HEADER  and  subsequently
            printed  on  the standard output.  The routine returns OK or
            EOF. Errors are returned by the error handler.

            init_read_pixels
                The pixel reading routine is initialized.

            read_pixels
                The pixels are read into a record buffer.

            decode_header
                Decodes  the  text   portion   of   the   header   using 
                DECODE_TEXT and DECODE_PARAMETERS.

                decode_text
                    Converts  the  id  string  from  059  code  to 8 bit
                    ASCII.

                decode_parameters
                    Decodes the PDS scan parameters.

            print_header
                If the short_header switch is set then the  image  title
                and  size  are  printed.   If  the long_header switch is
                set then all the header information is printed.

        read_image
            The PDS image pixels are converted to an  IRAF  image  file.
            The  image  file  header is set using SET_IMAGE_HEADER.  The
            lines of the image are converted one at a time.

            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.