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 | ; on peut changer le codage en dur des fauchees ou demi-fauchees, mais |
---|
63 | ; programme adapte a AMSUA et AMSUB, pas MHS (90 points, mais fauchee |
---|
64 | ; un peu plus large) |
---|
65 | ; |
---|
66 | ; utiliser ce programme pour la correction nadir pour amsua et |
---|
67 | ; amsub, car peut retourner la fonction de correction et la taille des |
---|
68 | ; EFOV (tache au sol effective) |
---|
69 | ; |
---|
70 | ; exit with error status if wrong parameter |
---|
71 | ; |
---|
72 | ; coding rules |
---|
73 | ; |
---|
74 | ; hard coded information |
---|
75 | ; |
---|
76 | ; EVOLUTIONS |
---|
77 | ; ========== |
---|
78 | ; |
---|
79 | ; - lelod 20120525 |
---|
80 | ; |
---|
81 | ; analyse de la correction nadir : refonte et calcul par satellite |
---|
82 | ; avec adaptation à la region choisie (Afrique de l'ouest) |
---|
83 | ; changement a faire dans extract_amsua.pro |
---|
84 | ; $Id$ |
---|
85 | ; |
---|
86 | ; $URL$ |
---|
87 | ; |
---|
88 | ; - fplod 20120416 |
---|
89 | ; |
---|
90 | ; * correction for correction reading if a5 vs a |
---|
91 | ; |
---|
92 | ; - fplod 20120106 |
---|
93 | ; |
---|
94 | ; * reprise des modifs lelod : changement de localisation des fichiers de correction |
---|
95 | ; |
---|
96 | ; - lelod 20111209 |
---|
97 | ; |
---|
98 | ; * modif organisation avec separation des traitements un seul canal traite |
---|
99 | ; |
---|
100 | ; - lelod 20111019 |
---|
101 | ; |
---|
102 | ; * fonction pixelsize fait le calcul des tailles des taches au sol a et |
---|
103 | ; b, et ressort le tableau correspondant sur la fauchee |
---|
104 | ; appelé en début de interpol |
---|
105 | ; |
---|
106 | ; - fplod 20110810T084245Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
107 | ; |
---|
108 | ; * correct_nadir_LE06 has been replaced by correct_nadir_amsu |
---|
109 | ; |
---|
110 | ; - pinsard 2011-05-26T15:40:51Z loholt1.ipsl.polytechnique.fr (Linux) |
---|
111 | ; |
---|
112 | ; * rewrite header (scratched by ?, how ?) |
---|
113 | ; * add cm_project |
---|
114 | ; |
---|
115 | ; - fplod 20110525T083313Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
116 | ; |
---|
117 | ; * header |
---|
118 | ; |
---|
119 | ; - lelod 2011052? |
---|
120 | ; |
---|
121 | ; * creation |
---|
122 | ; |
---|
123 | ;- |
---|
124 | PRO interpol_correc,numch,nbpix,cor_l,cor_s,swath,track |
---|
125 | ; |
---|
126 | @cm_project |
---|
127 | nomcanal=strmid(numch,0,1) |
---|
128 | numcanal=0 |
---|
129 | reads, strmid(numch,1,1),numcanal,format='(i1.1)' |
---|
130 | |
---|
131 | if nomcanal eq 'a' then nbpixel=30 |
---|
132 | if nomcanal eq 'b' then nbpixel=90 |
---|
133 | pixelsize,pixatot,pixbtot,alongatot,alongbtot |
---|
134 | if nomcanal eq 'a' then begin |
---|
135 | swath=pixatot |
---|
136 | track=alongatot |
---|
137 | endif else begin |
---|
138 | swath=pixbtot |
---|
139 | track=alongbtot |
---|
140 | endelse |
---|
141 | |
---|
142 | ; parametres AMSU et calcul de la fauchee |
---|
143 | nfova=30 |
---|
144 | nfovb=90 |
---|
145 | ndfova=nfova/2 |
---|
146 | ndfovb=nfovb/2 |
---|
147 | print,'nb points',numch,ndfova,ndfovb |
---|
148 | fovb=fltarr(ndfovb) |
---|
149 | fova=fltarr(ndfova) |
---|
150 | alongb=fltarr(ndfovb) |
---|
151 | alongab=alongbtot[ndfovb:nfovb-1] ; verifier l'intervalle!!!!! |
---|
152 | pixb=pixbtot[ndfovb:nfovb-1] |
---|
153 | alonga=alongatot[ndfova:nfova-1] |
---|
154 | pixa=pixatot[ndfova:nfova-1] |
---|
155 | ;ifov nadir : diametre (km) |
---|
156 | ifova=48.05 & ifovb=16 |
---|
157 | ; position dans la fauchee: premier point au nadir a ifov/2 |
---|
158 | ; |
---|
159 | coefb=0.8 |
---|
160 | fovb(0)=ifovb/2. |
---|
161 | for i=1,ndfovb-1 do fovb(i)=fovb(i-1)+coefb*(pixb(i-1)/2 +pixb(i)/2) |
---|
162 | fov_b=fltarr(ndfovb) |
---|
163 | ;fov_b(44)=fovb(0) |
---|
164 | ;for i=0,43 do fov_b(43-i)=fov_b(44-i)+coefb*(pixb(43-i)/2 +pixb(44-i)/2) |
---|
165 | for i=0,ndfovb-1 do fov_b(i)=-fovb(ndfovb-1-i) |
---|
166 | ; zone pixel : ellipse de grand axe pixb et petit axe alongb |
---|
167 | ; |
---|
168 | coefa=1 |
---|
169 | fova(0)=ifova/2. |
---|
170 | for i=1,ndfova-1 do fova(i)=fova(i-1)+coefa*(pixa(i-1)/2 +pixa(i)/2) ; verifier!!! |
---|
171 | fov_a=fltarr(ndfova) |
---|
172 | ;fov_a(14)=fova(0) |
---|
173 | ;for i=0,13 do fov_a(13-i)=fov_a(14-i)+coefa*(pixa(13-i)/2 +pixa(14-i)/2) |
---|
174 | for i=0,ndfova-1 do fov_a(i)=-fova(ndfova-1-i) |
---|
175 | |
---|
176 | |
---|
177 | path = project_env + '/src/dataref_amsu/' |
---|
178 | ; lecture des fichiers d'ajustement au nadir pour AMSUA et B |
---|
179 | ; cas amsua: noaa17 saute - lecture pour les 5 satellites utilises N15, 16, |
---|
180 | ; 18, 19, M02 |
---|
181 | if nomcanal eq 'a' then begin |
---|
182 | cor_l=fltarr(nfova,5) |
---|
183 | cor_s=fltarr(nfova,5) |
---|
184 | cor_seaa15=project_id_env+'AMSU/CORR_SEA_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA15.DAT' |
---|
185 | cor_landa15=project_id_env+'AMSU/CORR_LAND_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA15.DAT' |
---|
186 | cor_seaa16=project_id_env+'AMSU/CORR_SEA_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA16.DAT' |
---|
187 | cor_landa16=project_id_env+'AMSU/CORR_LAND_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA16.DAT' |
---|
188 | cor_seaa18=project_id_env+'AMSU/CORR_SEA_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA18.DAT' |
---|
189 | cor_landa18=project_id_env+'AMSU/CORR_LAND_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA18.DAT' |
---|
190 | cor_seaa19=project_id_env+'AMSU/CORR_SEA_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA19.DAT' |
---|
191 | cor_landa19=project_id_env+'AMSU/CORR_LAND_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_NOAA19.DAT' |
---|
192 | cor_seaM2=project_id_env+'AMSU/CORR_SEA_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_METOP.DAT' |
---|
193 | cor_landM2=project_id_env+'AMSU/CORR_LAND_AMSUA'+strmid(numch,1,1)+'_DataFromJune2010_Afrique_METOP.DAT' |
---|
194 | listcorr_l=[cor_landa15,cor_landa16,cor_landa18,cor_landa19,cor_landM2] |
---|
195 | for nosat=0,4 do begin |
---|
196 | corrland=listcorr_l[nosat] |
---|
197 | openr, lun1,corrland, /get_lun, ERROR = error |
---|
198 | IF (error NE 0) then begin |
---|
199 | ras = report(['eee : can not open for reading '$ |
---|
200 | + '!C' $ |
---|
201 | + 'code : ' + !ERROR_STATE.MSG $ |
---|
202 | + corrland]) |
---|
203 | STOP |
---|
204 | ENDIF |
---|
205 | readf, lun1, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,$ |
---|
206 | t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,$ |
---|
207 | t21,t22,t23,t24,t25,t26,t27,t28,t29,t30 |
---|
208 | a=[t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,$ |
---|
209 | t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,$ |
---|
210 | t21,t22,t23,t24,t25,t26,t27,t28,t29,t30] |
---|
211 | cor_l[*,nosat]=interpol(a,nfova,/lsquadratic) |
---|
212 | free_lun, lun1 |
---|
213 | endfor |
---|
214 | listcorr_s=[cor_seaa15,cor_seaa16,cor_seaa18,cor_seaa19,cor_seaM2] |
---|
215 | for nosat=0,4 do begin |
---|
216 | corrsea=listcorr_s[nosat] |
---|
217 | openr, lun1,corrsea, /get_lun, ERROR = error |
---|
218 | IF (error NE 0) then begin |
---|
219 | ras = report(['eee : can not open for reading '$ |
---|
220 | + '!C' $ |
---|
221 | + corrsea]) |
---|
222 | STOP |
---|
223 | ENDIF |
---|
224 | readf, lun1, t1,t2,t3,t4,t5,$ |
---|
225 | t6,t7,t8,t9,t10,$ |
---|
226 | t11,t12,t13,t14,t15,$ |
---|
227 | t16,t17,t18,t19,t20,$ |
---|
228 | t21,t22,t23,t24,t25,$ |
---|
229 | t26,t27,t28,t29,t30 |
---|
230 | |
---|
231 | a=[t1,t2,t3,t4,t5,$ |
---|
232 | t6,t7,t8,t9,t10,$ |
---|
233 | t11,t12,t13,t14,t15,$ |
---|
234 | t16,t17,t18,t19,t20,$ |
---|
235 | t21,t22,t23,t24,t25,$ |
---|
236 | t26,t27,t28,t29,t30] |
---|
237 | free_lun, lun1 |
---|
238 | cor_s[*,nosat]=interpol(a,nfova,/lsquadratic) |
---|
239 | free_lun, lun1 |
---|
240 | endfor |
---|
241 | |
---|
242 | endif |
---|
243 | |
---|
244 | ;cas amsub |
---|
245 | if nomcanal eq 'b' then begin |
---|
246 | cor_landb = path + 'CORR_LAND_AMSUB_JUIL2006.DAT' |
---|
247 | cor_seab = path + 'CORR_SEA_AMSUB_JUIL2006.DAT' |
---|
248 | cor_l=fltarr(nfovb) |
---|
249 | cor_s=fltarr(nfovb) |
---|
250 | openr, lun1,cor_landb, /get_lun, ERROR = error |
---|
251 | IF (error NE 0) then begin |
---|
252 | ras = report(['eee : can not open for reading '$ |
---|
253 | + '!C' $ |
---|
254 | + cor_landb]) |
---|
255 | STOP |
---|
256 | ENDIF |
---|
257 | for i=0, numcanal-1 do begin |
---|
258 | readf, lun1, t1,t2,t3,t4,t5,$ |
---|
259 | t6,t7,t8,t9,t10,$ |
---|
260 | t11,t12,t13,t14,t15,$ |
---|
261 | t16,t17,t18,t19,t20,$ |
---|
262 | t21,t22,t23,t24,t25,$ |
---|
263 | t26,t27,t28,t29,t30 |
---|
264 | |
---|
265 | a=[t1,t2,t3,t4,t5,$ |
---|
266 | t6,t7,t8,t9,t10,$ |
---|
267 | t11,t12,t13,t14,t15,$ |
---|
268 | t16,t17,t18,t19,t20,$ |
---|
269 | t21,t22,t23,t24,t25,$ |
---|
270 | t26,t27,t28,t29,t30] |
---|
271 | endfor |
---|
272 | ;interpolation |
---|
273 | cor_l[ndfovb:nfovb-1]=interpol(a[ndfova:nfova-1],fova,fovb,/spline) |
---|
274 | cor_l[0:ndfovb-1]=interpol(a[0:ndfova-1],fov_a,fov_b,/spline) |
---|
275 | |
---|
276 | free_lun, lun1 |
---|
277 | openr, lun1,cor_seab, /get_lun, ERROR = error |
---|
278 | IF (error NE 0) then begin |
---|
279 | ras = report(['eee : can not open for reading '$ |
---|
280 | + '!C' $ |
---|
281 | + cor_seab]) |
---|
282 | STOP |
---|
283 | ENDIF |
---|
284 | for i=0, numcanal-1 do begin |
---|
285 | readf, lun1, t1,t2,t3,t4,t5,$ |
---|
286 | t6,t7,t8,t9,t10,$ |
---|
287 | t11,t12,t13,t14,t15,$ |
---|
288 | t16,t17,t18,t19,t20,$ |
---|
289 | t21,t22,t23,t24,t25,$ |
---|
290 | t26,t27,t28,t29,t30 |
---|
291 | a=[t1,t2,t3,t4,t5,$ |
---|
292 | t6,t7,t8,t9,t10,$ |
---|
293 | t11,t12,t13,t14,t15,$ |
---|
294 | t16,t17,t18,t19,t20,$ |
---|
295 | t21,t22,t23,t24,t25,$ |
---|
296 | t26,t27,t28,t29,t30] |
---|
297 | endfor |
---|
298 | ;interpolation |
---|
299 | cor_s[ndfovb:nfovb]=interpol(a[ndfova:nfova-1],fova,fovb,/spline) |
---|
300 | cor_s[0:ndfovb-1]=interpol(a[0:ndfova-1],fov_a,fov_b,/spline) |
---|
301 | free_lun, lun1 |
---|
302 | endif |
---|
303 | |
---|
304 | end |
---|