Changeset 451 for trunk


Ignore:
Timestamp:
12/09/11 15:23:43 (13 years ago)
Author:
pinsard
Message:

transition to use writing tool for AMSU

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/extract_amsua.pro

    r449 r451  
    1515; ecrit les donnees pour la zone (lat/long) choisie 
    1616; 
    17 ; le fichier de sortie contient dans l'ordre mm, jj (jour de 
     17; ++ le fichier de sortie contient dans l'ordre mm, jj (jour de 
    1818; l'annee), le temps (identique pour les points d'une meme fauchee), le 
    19 ; no satellite, le no de fov (1 a 40 ou 1 a 90), long, lat, 
    20 ; tb1,... tbn 
     19; no satellite, le no de fov (1 a 40 ou 1 a 90), long, lat, tb 
    2120; 
    2221; Les valeurs manquantes sont codées par NaN. 
     
    3433;           amsu_lista [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/list_filea"]; 
    3534;           amsu_t1 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/AMSU/AMSU*/L1C/yyyy/yyyy_mm_dd/*.L1C"]; 
    36 ;           amsu_t2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/yyyy/mm/amsua_yyyymmdd_geomin_geomax.dat"]; 
     35;           amsu_t2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/yyyy/mm/numch_yyyymmdd_geomin_geomax.dat"]; 
    3736; 
    3837;           extract_amsua [shape=box, 
     
    4241;           label="${PROJECT}/src/extract_amsuab.pro"]; 
    4342; 
    44 ;           {amsu_lista amsu_listb amsu_t1} -> {extract_amsuab} -> {amsu_t2}; 
     43;           {amsu_lista amsu_t1} -> {extract_amsuab} -> {amsu_t2}; 
    4544;       } 
    4645; 
     
    4847; 
    4948; :Params: 
     49;   numch 
    5050;   yyyy 
    5151;   mm 
     
    5757; :Examples: 
    5858; 
    59 ;  Creating an articial list of AMSU-B and AMSU-A files (You may need to create ${PROJECT_ID}/AMSU/2006/08/ directory) :: 
     59;  Creating an articial list of AMSU-A files (You may need to create ${PROJECT_ID}/AMSU/2006/08/ directory) :: 
    6060; 
    6161;   $ mkdir -p ${PROJECT_ID}/AMSU/2006/08 
    62 ;   $ echo "${PROJECT_ID}/AMSU/AMSUBN15/L1C/2006/2006_08_01/NSS.AMBX.NK.D06213.S0110.E0255.B4271112.GC.L1C" > ${PROJECT_ID}/list_fileb 
    63 ;   $ echo "${PROJECT_ID}/AMSU/AMSUBN15/L1C/2006/2006_08_01/NSS.AMBX.NK.D06213.S0250.E0437.B4271213.GC.L1C" >> ${PROJECT_ID}/list_fileb 
    6462;   $ echo "${PROJECT_ID}/AMSU/AMSUAN15/L1C/2006/2006_08_01/NSS.AMAX.NK.D06213.S0110.E0255.B4271112.GC.L1C" > ${PROJECT_ID}/list_filea 
    6563;   $ echo "${PROJECT_ID}/AMSU/AMSUAN15/L1C/2006/2006_08_01/NSS.AMAX.NK.D06213.S0250.E0437.B4271213.GC.L1C" >> ${PROJECT_ID}/list_filea 
    6664; 
    67 ; Using AMSU-A: 
    68 ; 
     65; Using AMSU-A channel 5:: 
     66; 
     67;   IDL> numch = 'a5' 
    6968;   IDL> yyyy=2006 
    7069;   IDL> mm=8 
     
    7473;   IDL> lat_min=-30. 
    7574;   IDL> lat_max=45. 
    76 ;   IDL> extract_amsub, yyyy, mm, dd, lon_min, lon_max, lat_min, lat_max 
    77 ; 
    78 ;   ${PROJECT_ID}/AMSU/2006/08/amsua_20060801_060w30s_050e45n.dat must have been created. 
     75;   IDL> extract_amsua, numch, yyyy, mm, dd, lon_min, lon_max, lat_min, lat_max 
     76; 
     77;   ${PROJECT_ID}/AMSU/2006/08/a5_20060801_060w30s_050e45n.dat must have been created. 
    7978; 
    8079; :History: 
     
    8786; amelioree 
    8887; 
     88; - fplod 20111209T125312Z aedon.locean-ipsl.upmc.fr (Darwin) 
     89; 
     90;   * chgt de terminologie 
     91;   * ajout parametre numch 
     92;   * transition pour utilisation de :ref:`mem_to_file_amsu_t2` 
     93; 
    8994; - lelod 20111121 
    90 ;   introduction du parametre "descending" (orbite descendante 1, 
    91 ;   montante 0) dans le fichier de sortie : a tester! 
     95; 
     96;   * introduction du parametre "descending" (orbite descendante 1, 
     97;     montante 0) dans le fichier de sortie : a tester! 
     98; 
    9299; - fplod 20110818T160435Z aedon.locean-ipsl.upmc.fr (Darwin) 
    93100; 
    94101;   * no more /bdd in examples 
    95 ;   * need to check if missing exist before NaN affection on idl7 cratos  
     102;   * need to check if missing exist before NaN affection on idl7 cratos 
    96103; 
    97104; - pinsard 2011-08-18T10:34:53Z loholt1.ipsl.polytechnique.fr (Linux) 
     
    149156; :Todo: 
    150157; 
     158; lever le doute sur le contenu du fichier écrit par le printf (je (fplod) 
     159; crains des zesors louches!!).louchse 
     160; 
     161; vérifier que pas NaN dans les lignes écrites 
     162; 
     163; faire un test avec un zone géographique dans le pacifique pour voir comment 
     164; le système réagi (devrait dire : rien à faire !) 
     165; 
    151166; changer le nom des fichiers de listes pour éviter des conflits lors de runs 
    152167; simultanés 
     
    156171; eviter la creation d'un fichier vide (si pas de points dans la zone) 
    157172; 
    158 ; tester la cohérence entre les fichiers présents dans list_filea et list_fileb 
     173; tester la cohérence entre les fichiers présents dans list_filea 
    159174; en terme de date avec yyyy, mm et dd donnés en paramètre 
    160175; 
     
    163178; get rid of uppercase 
    164179; 
    165 ; 
    166180;- 
    167 PRO extract_amsua, yyyy, mm, dd,lon_min, lon_max, lat_min, lat_max 
     181PRO extract_amsua, numch, yyyy, mm, dd,lon_min, lon_max, lat_min, lat_max 
    168182; 
    169183compile_opt idl2, strictarrsubs 
     
    177191 
    178192 
    179 prefix='amsua_' 
    180193look = 'filename' 
    181194scale = 1. 
     
    185198        + string(yyyy,format='(I4.4)') + '/' $ 
    186199        + string(mm,format='(I2.2)')   + '/' $ 
    187         + prefix+string(yyyy,format='(I4.4)') $ 
     200        + numch + '_' $ 
     201        + string(yyyy,format='(I4.4)') $ 
    188202        + string(mm,format='(I2.2)') $ 
    189203        + string(dd,format='(I2.2)') + '_' $ 
     
    199213; boucle sur les elements de la liste 
    200214 
    201 ; lecture de la liste des fichiers AMSU-A  
     215; lecture de la liste des fichiers AMSU-A 
    202216    ;list_filea = project_id_env+'list_filea' 
    203217     list_filea='list_filea' 
     
    313327  zone=where((longrid ge lon_min) and (longrid le lon_max) $ 
    314328             and (latgrid ge lat_min) and (latgrid le lat_max),npt) 
     329print, 'npt', npt 
    315330  if npt ne 0 then begin 
    316331     time[zone]=tt[i] 
     
    320335     fovint=[fovint,fovgrid[zone]] 
    321336     timeint=[timeint,time[zone]] 
    322   endif 
     337  endif else begin 
     338     print, 'www : aucun point dans la zone' 
     339  endelse 
    323340 
    324341 endfor 
    325342 
     343 if (npt ne 0) then begin 
    326344 ; partie a remplacer par module ecriture standardise FP 
    327345; 
     
    336354print,'nb points dans la zone',nn 
    337355 
    338       for i=0L, nn-1L do begin      
     356      for i=0L, nn-1L do begin 
    339357;format: nosat,mois, day, lon, lat, zen,fov, time, ama_ch1:15,amb_ch1:5 
    340358; print, 'mois::::', mm,'-----', nab-i 
    341359         printf,lun_obs, mm, jour_ama, desc, nosat, fovint[i], landseamask, lonint[i], latint[i], timeint[i],$ 
    342360                chint[i],format='(6(i3,1x),4(f8.4,1x))' 
     361         if (n_elements(data) EQ 0) then begin 
     362             data = { desc : desc $ 
     363                    , hour : timeint[i] $ 
     364                    , fov : fovint[i] $ 
     365                    , lon : lonint[i] $ 
     366                    , lat: latint[i] $ 
     367                    , landseamask: 9$ 
     368                    , tb : chint[i] $ 
     369                    } 
     370         endif else begin 
     371             data = [data , { desc : desc $ 
     372                          , hour : timeint[i] $ 
     373                          , fov : fovint[i] $ 
     374                          , lon : lonint[i] $ 
     375                          , lat: latint[i] $ 
     376                          , landseamask: 9$ 
     377                          , tb : chint[i] $ 
     378                       }] 
     379         endelse 
    343380     endfor 
    344        
    345  
     381  endif else begin 
     382     print, 'www : 2 aucun point dans la zone' 
     383  endelse 
    346384 
    347385; fin boucle sur les fichiers lus 
     
    350388print, 'fermeture de ', fileout 
    351389close, /all 
     390 
     391if (n_elements(data) NE 0) then begin 
     392    ; write outputfile 
     393    header = { yyyy : yyyy $ 
     394             ,  mm : mm $ 
     395             ,  dd : dd $ 
     396             ,  numch : numch $ 
     397             } 
     398    amsu_t2={header: header, data: data} 
     399    help, amsu_t2,/structure 
     400    testfilename='./new_amsu_t2.dat' 
     401    fileout = mem_to_file_amsu_t2(yyyy, mm, dd, numch $ 
     402                               , lon_min, lon_max, lat_min $ 
     403                               , lat_max, amsu_t2, testfilename) 
     404 
     405endif else begin 
     406    print, 'www : no data to write' 
     407endelse 
     408; 
    352409end 
    353  
  • trunk/src/mem_to_file_amsu_t2.pro

    r450 r451  
    1515; amsu_t2 terminology will be applied. 
    1616; 
    17 ; :returns: 0 if ok or -1 if error 
     17; :returns: name of the output file if ok or -1 if error 
    1818; :rtype: integer 
    1919; 
     
    7070; 
    7171; $URL$ 
     72; 
     73; - fplod 20111208T173432Z aedon.locean-ipsl.upmc.fr (Darwin) 
     74; 
     75;   * name of output file as result if ok 
    7276; 
    7377; - fplod 20111208T105205Z cratos (Linux) 
     
    148152FREE_LUN, lun 
    149153; 
    150 result = 0 
     154result = fullfilename 
    151155; 
    152156return, result 
Note: See TracChangeset for help on using the changeset viewer.