aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/daofind/apfdinit.x
blob: 9c31b494a1f43a3c86ff77f4d16bb583260e8c35 (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
include "../lib/apphotdef.h"
include "../lib/finddef.h"

# AP_FDINIT - Initialize the daofind data structure.

procedure ap_fdinit (ap, fwhmpsf, noise)

pointer	ap		# pointer to the apphot structure
real	fwhmpsf		# FWHM of the PSF
int	noise		# noise function

begin
	# Allocate space.
	call malloc (ap, LEN_APSTRUCT, TY_STRUCT)

	# Set the default global apphot package parameters.
	call ap_defsetup (ap, fwhmpsf)

	# Setup the noise structure.
	call ap_noisesetup (ap, noise)

	# Setup the display structure.
	call ap_dispsetup (ap)

	# Setup the find structure.
	call ap_fdsetup (ap)
	    
	# Unused structures are set to null.
	AP_PCENTER(ap) = NULL
	AP_PSKY(ap) = NULL
	AP_PPSF(ap) = NULL
	AP_PPHOT(ap) = NULL
	AP_POLY(ap) = NULL
	AP_RPROF(ap) = NULL
end


# AP_FDSETUP -- Initialize the find structure.

procedure ap_fdsetup (ap)

pointer	ap		# pointer to the apphot strucuture

pointer	fnd

begin
	call malloc (AP_PFIND(ap), LEN_FIND, TY_STRUCT)
	fnd = AP_PFIND(ap)

	AP_RATIO(fnd) = DEF_RATIO
	AP_THETA(fnd) = DEF_RATIO
	AP_NSIGMA(fnd) = DEF_NSIGMA

	AP_THRESHOLD(fnd) = DEF_THRESHOLD
	AP_SHARPLO(fnd) = DEF_SHARPLO
	AP_SHARPHI(fnd) = DEF_SHARPHI
	AP_ROUNDLO(fnd) = DEF_ROUNDLO
	AP_ROUNDHI(fnd) = DEF_ROUNDLO
end