source: trunk/private/make_lut.m @ 23

Last change on this file since 23 was 11, checked in by pinsard, 15 years ago

make_lut.m : header

File size: 1.4 KB
Line 
1%MAKE_LUT save ++
2%+
3% module
4% ======
5%
6% ++
7%
8% DESCRIPTION
9% ===========
10%
11% From ../LUT/lut_junge_nir.dat,
12% ``make_lut`` produce a ASCII data file ../LUT/LUT_NIR.dat
13% containing ++
14%
15% EXAMPLES
16% ==========
17%
18% ::
19%
20% >> addpath('../toolbox')
21% >> tp_mlp_aerosols_startup
22% >> make_lut
23%
24% SEE ALSO
25% ========
26%
27% tp_mlp_aerosols_startup.m_
28%
29% .. _tp_mlp_aerosols_startup.m : tp_mlp_aerosols_startup.m.html
30%
31% TODO
32% ====
33%
34% improve description
35%
36% avoid overriding existing output file
37%
38% make it launchable from everywhere (path and IO directories)
39%
40% EVOLUTIONS
41% ==========
42%
43% $Id$
44%
45% - fplod 2009-08-13T16:05:03Z aedon.locean-ipsl.upmc.fr (Darwin)
46%
47%    * add header
48%    * heaven if no modification is needed by octave now, I use
49%      tp_mlp_aerosols_startup in the example to point out IO directories
50%      and path future modifications.
51%     
52%-
53
54infile='../LUT/lut_junge_nir.dat';
55outfile='../LUT/LUT_NIR.dat';
56
57fid=fopen(infile,'r');
58fgetl(fid);
59
60lut=fscanf(fid,'%f',[9 inf]);
61lut=lut';
62fclose(fid);
63
64I=find(lut(:,2)>=0.9 & lut(:,5)<200 & lut(:,6)<0.6);
65lut=lut(I,:);
66
67theta=[0:6:60];
68
69Itheta=[];
70for js=1:length(theta)
71  for jv=1:length(theta)
72    Itheta=union(Itheta,find(lut(:,3)==theta(js)&lut(:,4)==theta(jv)));
73  end
74end
75
76lut=lut(Itheta,:);
77
78[B,I,type]=unique(lut(:,1:2),'rows');
79
80fid=fopen(outfile,'w');
81fprintf(fid,'%d %f %f %f %f %f %f\n',[type' ; lut(:,[6 3 4 5 7 ... 8])']);
82fclose(fid);
Note: See TracBrowser for help on using the repository browser.