aboutsummaryrefslogtreecommitdiff
path: root/noao/astutil/pdm/pdmbatch.x
blob: 6828b783b8812efeda2b736165ae00c3d7738a8f (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
include <mach.h>
include <ctype.h>
include <error.h>
include "pdm.h"

# PDM_BATCH -- Batch mode calculation.

procedure pdm_batch (pdmp, file, infile, flip)

pointer	pdmp				# PDM structure pointer
char	file[SZ_FNAME]			# file to store information
char	infile[SZ_FNAME]		# input data file name
bool	flip				# flip y-axis scale

int	fd
double	pdm_signif(), signif
bool	verbose
errchk	pdm_alltheta, pdm_signif, pdm_ampep, pdm_phase

begin
	# Plot the data.
	call pdm_dplot (pdmp, infile, flip)

	# Call pdm_alltheta to get the theta array; plot to metafile.
	call pdm_alltheta (pdmp, THETAPPLOT)
	call pdm_tplot (pdmp, THETAPPLOT, infile)

	# Call pdm_signif to calculate the significance of the theta minimum.
	signif = pdm_signif (pdmp, PDM_MINR(pdmp))

	# Write this significance out to the file.
	fd = PDM_LFD(pdmp)
	call fprintf (fd, "significance at this minimum = %g\n")
	    call pargd (signif)
	call close (fd)

	# Call pdm_amplitudeepoch to get the amplitude and epoch.
	call pdm_ampep (pdmp, PDM_MINR(pdmp))

	# Call pdm_phase to get the phase curve.
	# Plot to metafile.
	
	call pdm_phase(pdmp, PDM_MINR(pdmp), PDM_EPOCH(pdmp))
	call pdm_pplot (pdmp, PDM_MINR(pdmp), infile, flip)

	# Call pdm_show to print the parameter information to a file.
	verbose = TRUE
	call pdm_show (pdmp, file, verbose)
end