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
|
procedure ccdgetparam ()
char image[SZ_FNAME] # Image whose parameter is to be fetched
char parameter[SZ_LINE] # Parameter whose value is required.
char instrument[SZ_FNAME] # CCD intrument file.
char buffer[SZ_LINE]
pointer im
pointer immap()
int hdmaccf()
bool streq()
begin
call clgstr ("image", image, SZ_FNAME)
im = immap (image, READ_ONLY, 0)
call clgstr ("instrument", instrument, SZ_FNAME)
call hdmopen (instrument)
call clgstr ("parameter", parameter, SZ_LINE)
# Handle special cases where we must translate the parameter value
# to the corresponding package name.
if (streq (parameter, "imagetyp")) {
call ccdtypes (im, buffer, SZ_LINE)
call printf ("%s\n")
call pargstr (buffer)
} else if (streq (parameter, "subset")) {
call ccdsubset (im, buffer, SZ_LINE)
call printf ("%s\n")
call pargstr (buffer)
} else {
if (hdmaccf (im, parameter) == NO) {
call printf ("UNDEFINED!\n")
} else {
call hdmgstr (im, parameter, buffer, SZ_LINE)
call printf ("%s\n")
call pargstr (buffer)
}
}
call imunmap (im)
end
|