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
|
include <imhdr.h>
include <imio.h>
include <pkg/gtools.h>
include <smw.h>
include "identify.h"
define SZ_TITLE 320 # Size of long string for title.
# ID_GDATA -- Get image data.
procedure id_gdata (id)
pointer id # ID pointer
int i, np1
double hjd
pointer sp, str, im, mw, sh
double smw_c1trand()
errchk shdr_open, id_vhelio
begin
call smark (sp)
call salloc (str, SZ_TITLE, TY_CHAR)
sh = ID_SH(id)
im = IM(sh)
mw = MW(sh)
# If format is multispec then header info depends on line.
if (SMW_FORMAT(mw) == SMW_ES || SMW_FORMAT(mw) == SMW_MS)
ID_LINE(id,2) = 1
call shdr_open (im, mw, ID_LINE(id,1), ID_LINE(id,2),
INDEFI, SHDATA, sh)
ID_AP(id,1) = AP(sh)
ID_AP(id,2) = ID_LINE(id,2)
ID_NPTS(id) = SN(sh)
call id_dbsection (id, Memc[ID_IMAGE(id)], ID_AP(id,1),
Memc[ID_SECTION(id)], SZ_FNAME)
call sprintf (Memc[str], SZ_TITLE, "%s %s%s\n%s")
if (ID_TASK(id) == IDENTIFY)
call pargstr ("identify")
else
call pargstr ("rvidlines")
call pargstr (Memc[ID_IMAGE(id)])
call pargstr (Memc[ID_SECTION(id)])
call pargstr (TITLE(sh))
call gt_sets (ID_GT(id), GTTITLE, Memc[str])
# Free previous vectors and allocate new vectors.
call mfree (ID_PIXDATA(id), TY_DOUBLE)
call malloc (ID_PIXDATA(id), ID_NPTS(id), TY_DOUBLE)
# Set the physical coordinates.
np1 = NP1(sh) - 1
do i = 1, ID_NPTS(id)
PIXDATA(id,i) = smw_c1trand (ID_LP(id), double(i+np1))
# Set the image data
ID_IMDATA(id) = SY(sh)
# Set the heliocentric correction.
if (ID_TASK(id) == RVIDLINES) {
call id_vhelio (im, ID_ZHELIO(id), hjd, NULL)
ID_ZHELIO(id) = ID_ZHELIO(id) / VLIGHT
} else
ID_ZHELIO(id) = 0
ID_NEWGRAPH(id) = YES
ID_NEWCV(id) = YES
call sfree (sp)
end
|