1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _interpol_correc.pro: |
---|
4 | ; |
---|
5 | ; =================== |
---|
6 | ; interpol_correc.pro |
---|
7 | ; =================== |
---|
8 | ; |
---|
9 | ; DESCRIPTION |
---|
10 | ; =========== |
---|
11 | ; |
---|
12 | ; interpolation des tableaux de correction amsub (calcules sur |
---|
13 | ; echantillonnage amsua) sur les 90 points de la fauchee amsub |
---|
14 | ; |
---|
15 | ; read :file:`${PROJECT}/src/dataref_amsu/CORR_[LAND|SEA]_AMSU[AB]_JUIL2006.DAT` |
---|
16 | ; containing correction for land and sea. ++ ref. algo fatima karbou |
---|
17 | ; |
---|
18 | ; .. only:: man |
---|
19 | ; |
---|
20 | ; Figure is visible on PDF and HTML documents only. |
---|
21 | ; |
---|
22 | ; .. only:: html or latex |
---|
23 | ; |
---|
24 | ; .. graphviz:: |
---|
25 | ; |
---|
26 | ; digraph interpol_correc { |
---|
27 | ; |
---|
28 | ; amsu_b_cor_land [shape=diamond,fontname=Courier,label="${PROJECT}/src/dataref_amsu/CORR_LAND_AMSUB_JUIL2006.DAT"]; |
---|
29 | ; amsu_b_cor_sea [shape=diamond,fontname=Courier,label="${PROJECT}/src/dataref_amsu/CORR_SEA_AMSUB_JUIL2006.DAT"]; |
---|
30 | ; |
---|
31 | ; interpol_correc [shape=box, |
---|
32 | ; fontname=Courier, |
---|
33 | ; color=blue, |
---|
34 | ; URL="http://forge.ipsl.jussieu.fr/varamma/browser/trunk/src/interpol_correc.pro", |
---|
35 | ; label="${PROJECT}/src/interpol_correc.pro"]; |
---|
36 | ; |
---|
37 | ; {amsu_b_cor_land amsu_b_cor_sea} -> {interpol_correc}; |
---|
38 | ; |
---|
39 | ; } |
---|
40 | ; |
---|
41 | ; |
---|
42 | ; SEE ALSO |
---|
43 | ; ======== |
---|
44 | ; |
---|
45 | ; :ref:`data_amsu` |
---|
46 | ; |
---|
47 | ; Called by :ref:`correct_nadir_amsu.pro` |
---|
48 | ; |
---|
49 | ; EXAMPLES |
---|
50 | ; ======== |
---|
51 | ; |
---|
52 | ; :: |
---|
53 | ; |
---|
54 | ; interpol_correc,cor_lb,cor_sb |
---|
55 | ; print, cor_lb |
---|
56 | ; print, cor_sb |
---|
57 | ; |
---|
58 | ; |
---|
59 | ; TODO |
---|
60 | ; ==== |
---|
61 | ; |
---|
62 | ; |
---|
63 | ; on peut changer le codage en dur des fauchees ou demi-fauchees, mais |
---|
64 | ; programme adapte a AMSUA et AMSUB, pas MHS (90 points, mais fauchee |
---|
65 | ; un peu plus large) |
---|
66 | ; |
---|
67 | ; utiliser ce programme pour la correction nadir pour amsua et |
---|
68 | ; amsub, car peut retourner la fonction de correction et la taille des |
---|
69 | ; EFOV (tache au sol effective) |
---|
70 | ; |
---|
71 | ; exit with error status if wrong parameter |
---|
72 | ; |
---|
73 | ; coding rules |
---|
74 | ; |
---|
75 | ; hard coded information |
---|
76 | ; |
---|
77 | ; EVOLUTIONS |
---|
78 | ; ========== |
---|
79 | ; |
---|
80 | ; - lelod 20120620 |
---|
81 | ; amelioration du code et introduction des corrections par |
---|
82 | ; satellite pour amsub |
---|
83 | ; impasse sur difference amsub - mhs a ce niveau |
---|
84 | ; remis les donnees de correction dans data_raf_amsu pour update VARAMMA |
---|
85 | ; |
---|
86 | ; - lelod 20120525 |
---|
87 | ; |
---|
88 | ; analyse de la correction nadir : refonte et calcul par satellite |
---|
89 | ; avec adaptation à la region choisie (Afrique de l'ouest) |
---|
90 | ; changement a faire dans extract_amsua.pro |
---|
91 | ; $Id$ |
---|
92 | ; |
---|
93 | ; $URL$ |
---|
94 | ; |
---|
95 | ; - fplod 20120416 |
---|
96 | ; |
---|
97 | ; * correction for correction reading if a5 vs a |
---|
98 | ; |
---|
99 | ; - fplod 20120106 |
---|
100 | ; |
---|
101 | ; * reprise des modifs lelod : changement de localisation des fichiers de correction |
---|
102 | ; |
---|
103 | ; - lelod 20111209 |
---|
104 | ; |
---|
105 | ; * modif organisation avec separation des traitements un seul canal traite |
---|
106 | ; |
---|
107 | ; - lelod 20111019 |
---|
108 | ; |
---|
109 | ; * fonction pixelsize fait le calcul des tailles des taches au sol a et |
---|
110 | ; b, et ressort le tableau correspondant sur la fauchee |
---|
111 | ; appelé en début de interpol |
---|
112 | ; |
---|
113 | ; - fplod 20110810T084245Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
114 | ; |
---|
115 | ; * correct_nadir_LE06 has been replaced by correct_nadir_amsu |
---|
116 | ; |
---|
117 | ; - pinsard 2011-05-26T15:40:51Z loholt1.ipsl.polytechnique.fr (Linux) |
---|
118 | ; |
---|
119 | ; * rewrite header (scratched by ?, how ?) |
---|
120 | ; * add cm_project |
---|
121 | ; |
---|
122 | ; - fplod 20110525T083313Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
123 | ; |
---|
124 | ; * header |
---|
125 | ; |
---|
126 | ; - lelod 2011052? |
---|
127 | ; |
---|
128 | ; * creation |
---|
129 | ; |
---|
130 | ;- |
---|
131 | PRO interpol_correc,numch,nbpix,cor_l,cor_s,swath,track |
---|
132 | ; |
---|
133 | @cm_project |
---|
134 | nomcanal=strmid(numch,0,1) |
---|
135 | numcanal=0 |
---|
136 | reads, strmid(numch,1,1),numcanal,format='(i1.1)' |
---|
137 | |
---|
138 | pixelsize,pixatot,pixbtot,alongatot,alongbtot |
---|
139 | if nomcanal eq 'a' then begin |
---|
140 | swath=pixatot |
---|
141 | track=alongatot |
---|
142 | endif else begin |
---|
143 | swath=pixbtot |
---|
144 | track=alongbtot |
---|
145 | endelse |
---|
146 | |
---|
147 | ; parametres AMSU et calcul de la geometrie de la fauchee |
---|
148 | ; pourinterpolation de la correction (calculee sur geometrie AMSUA) a AMSUB |
---|
149 | nfova=30 |
---|
150 | nfovb=90 |
---|
151 | ndfova=nfova/2 ; 15 |
---|
152 | ndfovb=nfovb/2 ; 45 |
---|
153 | ; cas AMSUA |
---|
154 | fova=fltarr(ndfova) |
---|
155 | alonga=alongatot[ndfova:nfova-1] |
---|
156 | pixa=pixatot[ndfova:nfova-1] |
---|
157 | ;ifov nadir : diametre (km) |
---|
158 | ifova=48.05 |
---|
159 | ; position dans la fauchee: premier point au nadir a ifov/2 |
---|
160 | ; zone pixel : ellipse de grand axe pixb et petit axe alongb |
---|
161 | coefa=1 ; recouvrement des pixels dans la fauchee |
---|
162 | fova(0)=ifova/2. |
---|
163 | for i=1,ndfova-1 do fova(i)=fova(i-1)+coefa*(pixa(i-1)/2 +pixa(i)/2) ; verifier!!! |
---|
164 | fov_a=fltarr(ndfova) |
---|
165 | ;fov_a(14)=fova(0) |
---|
166 | ;for i=0,13 do fov_a(13-i)=fov_a(14-i)+coefa*(pixa(13-i)/2 +pixa(14-i)/2) |
---|
167 | for i=0,ndfova-1 do fov_a(i)=-fova(ndfova-1-i) |
---|
168 | |
---|
169 | fovb=fltarr(ndfovb) |
---|
170 | alongb=fltarr(ndfovb) |
---|
171 | alongb=alongbtot[ndfovb:nfovb-1] ; verifier l'intervalle!!!!! |
---|
172 | pixb=pixbtot[ndfovb:nfovb-1] |
---|
173 | ;ifov nadir : diametre (km) |
---|
174 | ifovb=16. |
---|
175 | coefb=0.8 |
---|
176 | fovb(0)=ifovb/2. |
---|
177 | for i=1,ndfovb-1 do fovb(i)=fovb(i-1)+coefb*(pixb(i-1)/2 +pixb(i)/2) |
---|
178 | fov_b=fltarr(ndfovb) |
---|
179 | ;fov_b(44)=fovb(0) |
---|
180 | ;for i=0,43 do fov_b(43-i)=fov_b(44-i)+coefb*(pixb(43-i)/2 +pixb(44-i)/2) |
---|
181 | for i=0,ndfovb-1 do fov_b(i)=-fovb(ndfovb-1-i) |
---|
182 | |
---|
183 | |
---|
184 | path = project_env + '/src/dataref_amsu/' |
---|
185 | ; lecture des fichiers d'ajustement au nadir pour AMSUA et B |
---|
186 | ; noaa17 elimine - lecture pour les 5 satellites utilises N15, 16, 18, 19, M02 |
---|
187 | if nomcanal eq 'a' then begin |
---|
188 | instr='A' |
---|
189 | nfov=nfova |
---|
190 | endif else begin |
---|
191 | instr='B' |
---|
192 | nfov=nfovb |
---|
193 | endelse |
---|
194 | cor_l=fltarr(nfov,5) |
---|
195 | cor_s=fltarr(nfov,5) |
---|
196 | cor_sea15=path+'CORR_SEA_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA15.DAT' |
---|
197 | cor_land15=path+'CORR_LAND_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA15.DAT' |
---|
198 | cor_sea16=path+'CORR_SEA_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA16.DAT' |
---|
199 | cor_land16=path+'CORR_LAND_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA16.DAT' |
---|
200 | cor_sea18=path+'CORR_SEA_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA18.DAT' |
---|
201 | cor_land18=path+'CORR_LAND_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA18.DAT' |
---|
202 | cor_sea19=path+'CORR_SEA_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA19.DAT' |
---|
203 | cor_land19=path+'CORR_LAND_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA19.DAT' |
---|
204 | cor_seaM2=path+'CORR_SEA_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_METOP.DAT' |
---|
205 | cor_landM2=path+'CORR_LAND_AMSU'+instr+strmid(numch,1,1)+'_DataFromJune2010_Afrique_METOP.DAT' |
---|
206 | listcorr_l=[cor_land15,cor_land16,cor_land18,cor_land19,cor_landM2] |
---|
207 | for nosat=0,4 do begin |
---|
208 | corrland=listcorr_l[nosat] |
---|
209 | openr, lun1,corrland, /get_lun, ERROR = error |
---|
210 | IF (error NE 0) then begin |
---|
211 | ras = report(['eee : can not open for reading '$ |
---|
212 | + '!C' $ |
---|
213 | + 'code : ' + !ERROR_STATE.MSG $ |
---|
214 | + corrland]) |
---|
215 | STOP |
---|
216 | ENDIF |
---|
217 | readf, lun1, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,$ |
---|
218 | t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,$ |
---|
219 | t21,t22,t23,t24,t25,t26,t27,t28,t29,t30 |
---|
220 | a=[t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,$ |
---|
221 | t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,$ |
---|
222 | t21,t22,t23,t24,t25,t26,t27,t28,t29,t30] |
---|
223 | if nomcanal eq 'a' then begin |
---|
224 | cor_l[*,nosat]=interpol(a,nfova,/lsquadratic) |
---|
225 | endif else begin |
---|
226 | cor_l[ndfovb:nfovb-1,nosat]=interpol(a[ndfova:nfova-1],fova,fovb,/spline) |
---|
227 | cor_l[0:ndfovb-1,nosat]=interpol(a[0:ndfova-1],fov_a,fov_b,/spline) |
---|
228 | endelse |
---|
229 | free_lun, lun1 |
---|
230 | endfor |
---|
231 | |
---|
232 | listcorr_s=[cor_sea15,cor_sea16,cor_sea18,cor_sea19,cor_seaM2] |
---|
233 | for nosat=0,4 do begin |
---|
234 | corrsea=listcorr_s[nosat] |
---|
235 | openr, lun1,corrsea, /get_lun, ERROR = error |
---|
236 | IF (error NE 0) then begin |
---|
237 | ras = report(['eee : can not open for reading '$ |
---|
238 | + '!C' $ |
---|
239 | + corrsea]) |
---|
240 | STOP |
---|
241 | ENDIF |
---|
242 | readf, lun1, t1,t2,t3,t4,t5,$ |
---|
243 | t6,t7,t8,t9,t10,$ |
---|
244 | t11,t12,t13,t14,t15,$ |
---|
245 | t16,t17,t18,t19,t20,$ |
---|
246 | t21,t22,t23,t24,t25,$ |
---|
247 | t26,t27,t28,t29,t30 |
---|
248 | |
---|
249 | a=[t1,t2,t3,t4,t5,$ |
---|
250 | t6,t7,t8,t9,t10,$ |
---|
251 | t11,t12,t13,t14,t15,$ |
---|
252 | t16,t17,t18,t19,t20,$ |
---|
253 | t21,t22,t23,t24,t25,$ |
---|
254 | t26,t27,t28,t29,t30] |
---|
255 | free_lun, lun1 |
---|
256 | |
---|
257 | if nomcanal eq 'a' then begin |
---|
258 | cor_s[*,nosat]=interpol(a,nfova,/lsquadratic) |
---|
259 | endif else begin |
---|
260 | cor_s[ndfovb:nfovb-1,nosat]=interpol(a[ndfova:nfova-1],fova,fovb,/spline) |
---|
261 | cor_s[0:ndfovb-1,nosat]=interpol(a[0:ndfova-1],fov_a,fov_b,/spline) |
---|
262 | endelse |
---|
263 | free_lun, lun1 |
---|
264 | endfor |
---|
265 | |
---|
266 | end |
---|