-
Notifications
You must be signed in to change notification settings - Fork 1
/
m3_photom_extract_data.pro
55 lines (54 loc) · 1.69 KB
/
m3_photom_extract_data.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
pro m3_photom_extract_data, rdnf, obsf, locf, outf, ss, es
;
;
envi_open_file,rdnf, r_fid=rdnfid
envi_file_query, rdnfid, ns=ns, nl=nl, nb=nb, wl=wl
rdnpos = lindgen(nb)
;
envi_open_file,obsf, r_fid=obsfid
envi_file_query, obsfid, bnames=bnames
incidenceb = where(bnames eq 'To-Sun Zenith (deg)',count)
if count eq 0 then message, 'incidence band not found'
emissionb = where(bnames eq 'To-M3 Zenith (deg)', count)
if count eq 0 then message, 'emission band not found'
phaseb = where(bnames eq 'Phase (deg)', count)
if count eq 0 then message, 'incidence band not found'
;
envi_open_file,locfile, r_Fid=locfid
envi_file_query, locfid, bnames=bnames
latb = where(bnames eq 'Latitude', count)
if count eq 0 then message, 'lat band not found'
lonb = where(bnames eq 'Longitude', count)
if count eq 0 then message, 'lon band not found'
;
;
meanrad = fltarr(nb,nl)
;
for idx = 0, nl-1 do begin
;
; radiance
;
rdnslice = envi_get_slice(fid=rdnfid, line=idx, pos=rdnpos, xs=ss, xe=es, /bil)
meanrad[*,idx] = total(rdnslice,1)/(es - ss + 1)
;
; obs
;
i = mean(envi_get_slice(fid=obsfid, line=idx, pos=incidenceb, xs=ss, xe=es, /bil))
e = mean(envi_get_slice(fid=obsfid, line=idx, pos=emissionb, xs=ss, xe=es, /bil))
g = mean(envi_get_slice(fid=obsfid, line=idx, pos=phaseb, xs=ss, xe=es, /bil))
;
; loc
;
lat = mean(envi_get_slice(fid=locfid, line=idx, pos=latb, xs=ss, xe=es, /bil))
lon = mean(envi_get_slice(fid=locfid, line=idx, pos=lonb, xs=ss, xe=es, /bil))
;
print, i, e, g, lat, lon, meanrad
;
empty
wait, 0.0001
endfor
envi_file_mng, id=rdnfid, /remove
envi_file_mng, id=obsfid, /remove
envi_file_mng, id=locfid, /remove
;
end