Changeset 461 for trunk


Ignore:
Timestamp:
12/13/11 18:52:07 (13 years ago)
Author:
lelod
Message:

plein de corrections du jour

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/extract_amsua.pro

    r458 r461  
    7777;   IDL> yyyy=2006 
    7878;   IDL> mm=8 
    79 ;   IDL> dd=1 
     79;   IDL> dd=13 
    8080;   IDL> resol=1 
    8181;   IDL> lon_min=-60. 
     
    178178; :Todo: 
    179179; 
    180 ; make it work : resete un n_elements bizarre que IDL ne détecte pas à la 
    181 ; compilation 
    182180; 
    183181; lever le doute sur le contenu du fichier écrit par le printf (je (fplod) 
     
    207205; decrire la limitation avec les seuils 
    208206; 
    209 ; est-ce que la zon géographique ne peut pas ere déduite des min et max lus ce 
    210 ; qui eviterait des parametres dont on avait réussi à se débarasser 
    211207; 
    212208;- 
     
    218214 
    219215nomcanal=strmid(numch,0,1) 
    220 nocanal=0L 
     216nocanal=0 
    221217reads, strmid(numch,1,1),nocanal,format='(i1.1)' 
    222218 
     
    227223file=project_id_env+'/MASK/ETOPO1_Ice_g_gmt4.nc' 
    228224domdef,lon_min, lon_max, lat_min, lat_max 
    229  
    230225bate = ncdf_lec(file, var = 'z') GT 0 
    231226xxe = float(ncdf_lec(file, var = 'lon')) 
     
    234229jpje = n_elements(yye) 
    235230 
    236 ; extraction zone donnees AMSU 
    237 domdef,lon_min,lon_max,lat_min,lat_max 
    238 bate = ncdf_lec(file, var = 'z') GT 0 
    239 xxe = float(ncdf_lec(file, var = 'lon')) 
    240 yye = float(ncdf_lec(file, var = 'lat')) 
    241 jpie = n_elements;module lecture fichier a introduire ici 
    242231 
    243232; inutile maintenant: ouverture du fichier de sortie 
    244 look = 'filename' 
    245 scale = 1. 
    246 geomin = geolocation_to_string_idl(lon_min, lat_min, look, scale) 
    247 geomax = geolocation_to_string_idl(lon_max, lat_max, look, scale) 
    248 fileout=project_id_env+ 'AMSU/' $ 
    249         + string(yyyy,format='(I4.4)') + '/' $ 
    250         + string(mm,format='(I2.2)')   + '/' $ 
    251         + numch + '_' $ 
    252         + string(yyyy,format='(I4.4)') $ 
    253         + string(mm,format='(I2.2)') $ 
    254         + string(dd,format='(I2.2)') + '_' $ 
    255         + geomin + '_' $ 
    256         + geomax $ 
    257         + '.dat' 
    258 print, 'ouverture pour ecriture de ', fileout 
    259 openw, lun_obs, fileout, /get_lun 
     233;look = 'filename' 
     234;scale = 1. 
     235;geomin = geolocation_to_string_idl(lon_min, lat_min, look, scale) 
     236;geomax = geolocation_to_string_idl(lon_max, lat_max, look, scale) 
     237;fileout=project_id_env+ 'AMSU/' $ 
     238;        + string(yyyy,format='(I4.4)') + '/' $ 
     239;        + string(mm,format='(I2.2)')   + '/' $ 
     240;        + numch + '_' $ 
     241;        + string(yyyy,format='(I4.4)') $ 
     242;        + string(mm,format='(I2.2)') $ 
     243;        + string(dd,format='(I2.2)') + '_' $ 
     244;        + geomin + '_' $ 
     245;        + geomax $ 
     246;        + '.dat' 
     247;print, 'ouverture pour ecriture de ', fileout 
     248;openw, lun_obs, fileout, /get_lun 
    260249 
    261250 
    262251; appel au ssprgm qui interpole les fonctions de correction (inutile 
    263252; de l'appeler a chaque fichier....) 
    264 if nomcanal eq 'a' then nbpixel=30 
    265 if nomcanal eq 'b' then nbpixel=90 
    266 interpol_correc,nomcanal,nbpixel,cor_l,cor_s,swath,track 
     253 
     254interpol_correc,numch,nbpixel,cor_l,cor_s,swath,track 
    267255 
    268256 
     
    282270filea='' 
    283271nlist=1 
    284 ilist=1 
     272ilist=0 
    285273   ; while (not eof(lun_a)) do begin 
    286274while ilist le nlist do begin 
     
    342330; correction nadir des donnees 
    343331   ch_nadir=fltarr(nbpix,n_scan) 
    344    lanseamask=intarr(nbpix,n_scan) 
     332   landseamask=intarr(nbpix,n_scan) 
    345333   for isc=0L,n_scan-1L do begin 
    346334      for ifo=0,nbpix-1 do begin 
     
    355343            bate2=bate1[*,yind] 
    356344            if (mean(bate2) le 0.5) then begin 
    357                ch_nadir[ifo,isc]=amch[ifo,isc]-cor_s[numcanal,ifo] 
     345               ch_nadir[ifo,isc]=amch[ifo,isc]-cor_s[ifo] 
    358346               landseamask[ifo,isc]=0 ; mer 
    359347            endif else begin 
    360                ch_nadir[ifo,isc]=amch[ifo,isc]-cor_l[numcanal,ifo] 
     348               ch_nadir[ifo,isc]=amch[ifo,isc]-cor_l[ifo] 
    361349               landseamask[ifo,isc]=1 ; terre 
    362350            endelse 
     
    390378; selection des taches au sol situees dans la zone d'interet 
    391379      zone=where((longrid ge lon_min) and (longrid le lon_max) $ 
    392                  and (latgrid ge lat_min) and (latgrid le lat_max),npt) 
    393 ;print, 'npt', npt 
     380                 and (latgrid ge lat_min) and (latgrid le lat_max) and (tbgrid gt tbmin), npt) 
    394381      if npt ne 0 then begin 
    395          time[zone]=tt[i] 
    396  ; alerte: comment initialiser les tableaux qu'on concatene???? 
    397382         if (n_elements(chint) EQ 0) then begin 
     383            timeint=replicate(tt[i],npt) 
    398384            chint=tbgrid[zone] 
    399385            latint=latgrid[zone] 
     
    401387            fovint=fovgrid[zone] 
    402388            maskint=maskgrid[zone] 
    403             timeint= time[zone] 
    404389         endif else begin 
    405390            chint=[chint,tbgrid[zone]] 
     
    408393            fovint=[fovint,fovgrid[zone]] 
    409394            maskint=[maskint,maskgrid[zone]] 
    410             timeint=[timeint,time[zone]] 
     395            timeint=[timeint,replicate(tt[i],npt)] 
    411396         endelse 
    412397      endif else begin 
     
    416401   endfor 
    417402 
    418  
    419    for i=0L, npt-1L do begin 
    420       if (( chint[i] lt tbmin) or (chint[i] gt tbmax) ) then begin 
    421          ch_adj[i]=!values.f_nan 
    422       endif 
    423    endfor 
    424  
    425  
    426    print,'nb points dans la zone',npt 
    427  
    428    for i=0L, npt-1L do begin 
     403   nn=n_elements(chint) 
     404 ;  for i=0L, npt-1L do begin 
     405 ;     if (( chint[i] lt tbmin) or (chint[i] gt tbmax) ) then begin 
     406 ;        chint[i]=!values.f_nan 
     407 ;     endif 
     408 ;  endfor 
     409 
     410 
     411   print,'nb points dans la zone',nn 
     412 
     413   for i=0L, nn-1L do begin 
    429414;format: nosat,mois, day, lon, lat, zen,fov, time, ama_ch1:15,amb_ch1:5 
    430415; print, 'mois::::', mm,'-----', nab-i 
    431       printf,lun_obs, mm, jour_ama, desc, nosat, fovint[i], landseamask, lonint[i], latint[i], timeint[i],$ 
    432              chint[i],format='(6(i3,1x),4(f8.4,1x))' 
     416;      printf,lun_obs, mm, jour_ama, desc, nosat, fovint[i], maskint[i], lonint[i], latint[i], timeint[i],$ 
     417;             chint[i],format='(6(i3,1x),4(f8.4,1x))' 
    433418      if (n_elements(data) EQ 0) then begin 
    434419         data = { desc : desc $ 
     
    460445    ; write outputfile 
    461446   ; ajouter resol dans le header 
    462     header = { yyyy : yyyy $ 
     447    header1 = { yyyy : yyyy $ 
    463448             ,  mm : mm $ 
    464449             ,  dd : dd $ 
    465450             ,  numch : numch $ 
     451             ,  nbpix : nbgrid $ 
     452             ,  resol : resol $ 
    466453             } 
    467     amsu_t2={header: header, data: data} 
     454header2= { lon_min: lon_min $ 
     455                      , lon_max: lon_max $ 
     456                      , lat_min: lat_min $ 
     457                      , lat_max: lat_max $ 
     458                     } 
     459 
     460    amsu_t2={header1: header1, header2: header2, data: data} 
    468461    help, amsu_t2,/structure 
    469462    testfilename='./new_amsu_t2.dat' 
    470     fileout = mem_to_file_amsu_t2(yyyy, mm, dd, numch $ 
    471                                , lon_min, lon_max, lat_min $ 
    472                                , lat_max, amsu_t2, testfilename) 
     463    fileout = mem_to_file_amsu_t2(amsu_t2, testfilename) 
    473464 
    474465endif else begin 
     
    476467endelse 
    477468 
     469window,1 
     470plot,lonint,latint,xrange=[lon_min,lon_max],yrange=[lat_min,lat_max],xstyle=1,ystyle=1,psym=2 
    478471end 
  • trunk/src/interpol_correc.pro

    r457 r461  
    107107; 
    108108;- 
    109 PRO interpol_correc,canal,nbpix,cor_l,cor_s,swath,track 
     109PRO interpol_correc,numch,nbpix,cor_l,cor_s,swath,track 
    110110; 
    111111@cm_project 
    112 ; mettre au carre!!!!!!!!! 
    113 nomcanal=canal(0) 
    114 numcanal=str2num(canal,1) 
    115  
     112nomcanal=strmid(numch,0,1) 
     113numcanal=0 
     114reads, strmid(numch,1,1),numcanal,format='(i1.1)' 
     115 
     116if nomcanal eq 'a' then nbpixel=30 
     117if nomcanal eq 'b' then nbpixel=90 
    116118pixelsize,pixatot,pixbtot,alongatot,alongbtot 
    117119if nomcanal eq 'a' then begin 
     
    128130ndfova=nfova/2 
    129131ndfovb=nfovb/2 
     132print,'nb points',numch,ndfova,ndfovb 
    130133fovb=fltarr(ndfovb) 
    131134fova=fltarr(ndfova) 
    132135alongb=fltarr(ndfovb) 
    133136alongab=alongbtot[ndfovb:nfovb-1] ; verifier l'intervalle!!!!! 
    134 pixb=pixbtot[ndfovb:nfovb] 
    135 alonga=alongatot[ndfova:nfova] 
    136 pixa=pixatot[ndfova:nfova] 
     137pixb=pixbtot[ndfovb:nfovb-1] 
     138alonga=alongatot[ndfova:nfova-1] 
     139pixa=pixatot[ndfova:nfova-1] 
    137140;ifov nadir : diametre (km) 
    138141ifova=48.05 & ifovb=16 
  • trunk/src/interpolswath.pro

    r457 r461  
    6969;print,'pixatot' 
    7070;print,pixatot 
    71 window,1 
    72 ploterr,ifov,fova,pixatot 
     71;window,1 
     72;ploterr,ifov,fova,pixatot 
    7373 
    7474distmax=-min(fova)+max(fova)+max(pixa) 
Note: See TracChangeset for help on using the changeset viewer.