-
Notifications
You must be signed in to change notification settings - Fork 1
/
m3_photom_build_i_e_a_from_obs.pro
61 lines (59 loc) · 1.33 KB
/
m3_photom_build_i_e_a_from_obs.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
function m3_photom_build_i_e_a_from_obs,obs
;
; given a ten-band set of m3 obs values,
; figure i, e and phase using the topography-referenced obs values
;
np=n_elements(obs)/10
;incidence=dblarr(np)
;exitance=dblarr(np)
;phase=dblarr(np)
if(np eq 1)then obs=reform(obs,1,10)
out_tile=dblarr(np,3)
;
; 0 To-Sun Azimuth (deg)
; 1 To-Sun Zenith (deg)
; 2 To-M3 Azimuth (deg)
; 3 To-M3 Zenith (deg)
; 4 Phase (deg)
; 5 To-Sun Path Length (au-mean),
; 6 To-M3 Path Length (m)
; 7 Facet Slope (deg)
; 8 Facet Aspect (deg)
; 9 Facet Cos(i) (unitless)
;
;
r2d=180/!dpi
d2r=!dpi/180
;
; build incidence
;
; cos(i)=cos(sun zen)*cos(slope)+sin(sun zen)*sin(slope)*cos(sun azi-aspect)
;
incidence=r2d*acos(cos(obs[*,1]*d2r)*cos(obs[*,7]*d2r)+sin(obs[*,1]*d2r)*sin(obs[*,7]*d2r)*cos((obs[*,0]-obs[*,8])*d2r))
;
; build exitance
;
; cos(e)=cos(m3 zen)*cos(slope)+sin(m3 zen)*sin(slope)*cos(m3 azi-aspect)
;
exitance=r2d*acos(cos(obs[*,3]*d2r)*cos(obs[*,7]*d2r)+sin(obs[*,3]*d2r)*sin(obs[*,7]*d2r)*cos((obs[*,2]-obs[*,8])*d2r))
;
; pull phase
;
phase=double(obs[*,4])
;
; handle single pixel case
;
;if(np eq 10)then begin
; ;
; obs=reform(obs)
; incidence=incidence[0]
; exitance=exitance[0]
; phase=phase[0]
; ;
;endif
out_tile[*,0]=incidence
out_tile[*,1]=exitance
out_tile[*,2]=phase
return, out_tile
;
end