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
|
include <ctype.h>
include <error.h>
include <mach.h>
include "pdm.h"
# PDM -- Phase Dispersion Minimization. Find periodicities in light
# curve data. Root program.
procedure t_pdm()
char infile[SZ_FNAME] # input data file
char metafile[SZ_FNAME] # batch metafile
char batchfile[SZ_FNAME] # batch log file
char device[SZ_FNAME] # plot device
bool interactive # interactive or batch flag
bool autoranges # autoranges flag
int ptype # plot type
pointer pdmp, pdm_open() # structure stuff
bool flip, clgetb()
real clgetr()
int clgeti(), pdm_gdata(), pdm_autorang()
errchk pdm_open, pdm_autorang, pdm_batch, pdm_cursor
begin
# Get some of the CL parameters and open the pdm data structure.
call clgstr ("infiles", infile, SZ_FNAME)
call clgstr ("metafile", metafile, SZ_FNAME)
call clgstr ("batchfile", batchfile, SZ_FNAME)
call clgstr ("device", device, SZ_FNAME)
interactive = clgetb ("interactive")
flip = clgetb ("flip")
pdmp = pdm_open (device, batchfile, metafile, interactive)
# Clio to get more parameters.
PDM_PMIN(pdmp) = double(clgetr ("minp"))
call clputr ("minp", real(PDM_PMIN(pdmp)))
if (PDM_PMIN(pdmp) > EPSILOND)
PDM_FMAX(pdmp) = 1.0d+0/PDM_PMIN(pdmp)
else
PDM_FMAX(pdmp) = 0.0d+0
PDM_PMAX(pdmp) = double(clgetr ("maxp"))
call clputr ("maxp", real(PDM_PMAX(pdmp)))
if (PDM_PMAX(pdmp) > EPSILOND)
PDM_FMIN(pdmp) = 1.0d+0/PDM_PMAX(pdmp)
else
PDM_FMIN(pdmp) = 0.0d+0
PDM_NTHPT(pdmp) = clgeti ("ntheta")
autoranges = clgetb ("autoranges")
PDM_NSIGMA(pdmp) = double(clgetr ("nsigma"))
PDM_PLUSPOINT(pdmp) = clgeti ("pluspoint")
# Read in the data.
PDM_NPT(pdmp) = pdm_gdata (pdmp, infile)
# If the autoranges flag is set, call the autorange subroutine.
if (autoranges)
PDM_NRANGE(pdmp) = pdm_autorang (pdmp)
if (!interactive)
call pdm_batch (pdmp, batchfile, infile, flip)
else {
# Plot the data on the screen and call the cursor loop.
call pdm_dplot (pdmp, infile, flip)
ptype = DATAPLOT
call pdm_cursor(pdmp, ptype, infile, flip)
}
# Close the pdm data structure.
call pdm_close (pdmp, interactive)
end
|