aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/daophot/daolib/dpppars.x
blob: e1c86f58b5c2e785b9e95dbe9f2a5a835d590809 (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
include "../lib/daophotdef.h"

# DP_PPPARS -- Store the daophot package parameters in the pset files.

procedure dp_pppars (dao)

pointer	dao		# pointer to daophot structure

pointer	sp, str, fstr, dap
bool	itob()
int	dp_stati(), strlen()
pointer	clopset()
real	dp_statr()

begin
	call smark (sp)
	call salloc (str, SZ_FNAME, TY_CHAR)
	call salloc (fstr, SZ_FNAME, TY_CHAR)

	# Set the package parameter text.
	call clputb ("text", itob (dp_stati (dao, TEXT)))

	# Get and set the datapars parameter sets.
	dap = clopset ("datapars")

	# Store the data dependent parameters.
	call clppsetr (dap, "scale", dp_statr (dao, SCALE))
	call clppsetr (dap, "fwhmpsf", dp_statr (dao, SFWHMPSF))
	call clppsetr (dap, "datamin", dp_statr (dao, MINGDATA))
	call clppsetr (dap, "datamax", dp_statr (dao, MAXGDATA))

	# Store the noise parameters.
	call dp_stats (dao, CCDGAIN, Memc[str], SZ_FNAME)
	call clppset (dap, "gain", Memc[str])
	call clppsetr (dap, "epadu", dp_statr (dao, PHOTADU))
	call dp_stats (dao, CCDREAD, Memc[str], SZ_FNAME)
	call clppset (dap, "ccdread", Memc[str])
	call clppsetr (dap, "readnoise", dp_statr (dao, READNOISE))

	# Store the observing parameters.
	call dp_stats (dao, EXPTIME, Memc[str], SZ_FNAME)
	call clppset (dap, "exposure", Memc[str])
	call clppsetr (dap, "itime", dp_statr (dao, ITIME))
	call dp_stats (dao, AIRMASS, Memc[str], SZ_FNAME)
	call clppset (dap, "airmass", Memc[str])
	call clppsetr (dap, "xairmass", dp_statr (dao, XAIRMASS))
	call dp_stats (dao, FILTER, Memc[str], SZ_FNAME)
	call clppset (dap, "filter", Memc[str])
	call dp_stats (dao, IFILTER, Memc[str], SZ_FNAME)
	call clppset (dap, "ifilter", Memc[str])
	call dp_stats (dao, OBSTIME, Memc[str], SZ_FNAME)
	call clppset (dap, "obstime", Memc[str])
	call dp_stats (dao, OTIME, Memc[str], SZ_FNAME)
	call clppset (dap, "otime", Memc[str])

	# Close the datapars parameter set.
	call clcpset (dap)

	# Open the daopars parameter set.
	dap = clopset ("daopars")

	# Store the psf function parameters.
	call dp_stats (dao, FUNCLIST, Memc[fstr], SZ_FNAME)
	call strcpy (Memc[fstr+1], Memc[str], strlen(Memc[fstr+1]) - 1)
	call clppset (dap, "function", Memc[str])
	call clppseti (dap, "varorder", dp_stati (dao, VARORDER))
	#call clppsetb (dap, "fexpand", itob (dp_stati (dao, FEXPAND)))
	call clppseti (dap, "nclean", dp_stati (dao, NCLEAN))
	call clppsetb (dap, "saturated", itob (dp_stati (dao, SATURATED)))
	call clppsetr (dap, "psfrad", dp_statr (dao, SPSFRAD))
	call clppsetr (dap, "matchrad", dp_statr (dao, SMATCHRAD))

	# Store the fitting algorithm parameters.
	call clppsetr (dap, "fitrad", dp_statr (dao, SFITRAD))
	call clppsetr (dap, "sannulus", dp_statr (dao, SANNULUS))
	call clppsetr (dap, "wsannulus", dp_statr (dao, SDANNULUS))
	call clppsetr (dap, "critsnratio", dp_statr (dao, CRITSNRATIO))
	call clppseti (dap, "maxiter", dp_stati (dao, MAXITER))
	call clppseti (dap, "maxgroup", dp_stati (dao, MAXGROUP))
	call clppseti (dap, "maxnstar", dp_stati (dao, MAXNSTAR))
	call clppsetb (dap, "recenter", itob (dp_stati (dao, RECENTER)))
	call clppsetb (dap, "fitsky", itob (dp_stati (dao, FITSKY)))
	call clppsetb (dap, "groupsky", itob (dp_stati (dao, GROUPSKY)))
	call clppsetr (dap, "flaterr", dp_statr (dao, FLATERR))
	call clppsetr (dap, "proferr", dp_statr (dao, PROFERR))
	call clppsetr (dap, "cliprange", dp_statr (dao, CLIPRANGE))
	call clppseti (dap, "clipexp", dp_stati (dao, CLIPEXP))
	call clppsetr (dap, "mergerad", dp_statr (dao, SMERGERAD))

	# Close the daopars parameter set.
	call clcpset (dap)

	call sfree (sp)
end