-
Notifications
You must be signed in to change notification settings - Fork 0
/
lstdrv_matrix.pro~
84 lines (76 loc) · 1.15 KB
/
lstdrv_matrix.pro~
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
PRO LSTDRV_MATRIX, X_PIX, Y_PIX, X_SRC, Y_SRC, DX, DY, DR
;+
; NAME:
; LSTDRV_MATRIX
;
;
; PURPOSE:
; Constructs the matrix
;
;
; CATEGORY:
; List driven photometry - using maximum likelihood solution
;
;
; CALLING SEQUENCE:
;
;
;
; INPUTS:
; X_PIX: vector of x-values for "pixels"
; Y_PIX: vector of y-values for "pixels"
; X_SRC: vector of x-values for sources
; Y_SRC: vector of y-values for sources
;
;
;
; OPTIONAL INPUTS:
;
;
;
; KEYWORD PARAMETERS:
;
;
;
; OUTPUTS:
;
; DX: offset in x in matrix format for linear inversion
; DY: offset in y in matrix format for linear inversion
;
; OPTIONAL OUTPUTS:
; DR:
;
;
; COMMON BLOCKS:
;
;
;
; SIDE EFFECTS:
;
;
;
; RESTRICTIONS:
;
;
;
; PROCEDURE:
;
;
;
; EXAMPLE:
;
;
;
; MODIFICATION HISTORY:
;
;-
n_src = n_elements(x_src)
n_pix = n_elements(x_pix)
one_src = replicate(1, n_src)
one_pix = replicate(1, n_pix)
; n.b. reforming in case positions or sources are sent down as matricies
dx = (reform(x_pix, n_pix)#one_src)-(one_pix#reform(x_src, n_src))
dy = (reform(y_pix, n_pix)#one_src)-(one_pix#reform(y_src, n_src))
IF n_params() GT 6 THEN dr = sqrt(dx^2+dy^2)
return
END