Changeset 512 for trunk


Ignore:
Timestamp:
04/10/12 16:44:48 (12 years ago)
Author:
pinsard
Message:

create directory when needed

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/extract_amsua.pro

    r509 r512  
    6767; ======== 
    6868; 
    69 ; Creating an articial list of AMSU-A files (You may need to create 
    70 ; :file:`${PROJECT_ID}/AMSU/2006/08/ directory)`:: 
    71 ; 
    72 ;   $ mkdir -p ${PROJECT_ID}/AMSU/2006/08 
     69; Creating an articial list of AMSU-A files:: 
    7370; 
    7471;   files_list = strarr(2) 
  • trunk/src/extract_amsuab.pro

    r430 r512  
    6464; :Examples: 
    6565; 
    66 ;  Creating an articial list of AMSU-B and AMSU-A files (You may need to create ${PROJECT_ID}/AMSU/2006/08/ directory) :: 
    67 ; 
    68 ;   $ mkdir -p ${PROJECT_ID}/AMSU/2006/08 
     66;  Creating an articial list of AMSU-B and AMSU-A files:: 
     67; 
    6968;   $ echo "${PROJECT_ID}/AMSU/AMSUBN15/L1C/2006/2006_08_01/NSS.AMBX.NK.D06213.S0110.E0255.B4271112.GC.L1C" > ${PROJECT_ID}/list_fileb 
    7069;   $ echo "${PROJECT_ID}/AMSU/AMSUBN15/L1C/2006/2006_08_01/NSS.AMBX.NK.D06213.S0250.E0437.B4271213.GC.L1C" >> ${PROJECT_ID}/list_fileb 
     
    7473; Using AMSU-B only :: 
    7574; 
    76 ;   IDL> use_amsua=0 
    77 ;   IDL> yyyy=2006 
    78 ;   IDL> mm=8 
    79 ;   IDL> dd=1 
    80 ;   IDL> lon_min=-60. 
    81 ;   IDL> lon_max=50. 
    82 ;   IDL> lat_min=-30. 
    83 ;   IDL> lat_max=45. 
    84 ;   IDL> extract_amsuab, yyyy, mm, dd, use_amsua, lon_min, lon_max, lat_min, lat_max 
     75;    use_amsua=0 
     76;    yyyy=2006 
     77;    mm=8 
     78;    dd=1 
     79;    lon_min=-60. 
     80;    lon_max=50. 
     81;    lat_min=-30. 
     82;    lat_max=45. 
     83;    extract_amsuab, yyyy, mm, dd, use_amsua, lon_min, lon_max, lat_min, lat_max 
    8584; 
    8685;   ${PROJECT_ID}/AMSU/2006/08/amsub_20060801_060w30s_050e45n.dat must have been created. 
     
    8887; Using AMSU-A and AMSU-B :: 
    8988; 
    90 ;   IDL> use_amsua=1 
    91 ;   IDL> yyyy=2006 
    92 ;   IDL> mm=8 
    93 ;   IDL> dd=1 
    94 ;   IDL> lon_min=-60. 
    95 ;   IDL> lon_max=50. 
    96 ;   IDL> lat_min=-30. 
    97 ;   IDL> lat_max=45. 
    98 ;   IDL> extract_amsuab, use_amsua, yyyy, mm, dd, lon_min, lon_max, lat_min, lat_max 
     89;    use_amsua=1 
     90;    yyyy=2006 
     91;    mm=8 
     92;    dd=1 
     93;    lon_min=-60. 
     94;    lon_max=50. 
     95;    lat_min=-30. 
     96;    lat_max=45. 
     97;    extract_amsuab, use_amsua, yyyy, mm, dd, lon_min, lon_max, lat_min, lat_max 
    9998; 
    10099;   ${PROJECT_ID}/AMSU/2006/08/amsua_amsub_20060801_060w30s_050e45n.dat must have been created. 
     
    106105; $URL$ 
    107106; 
     107; - fplod 20120410 
     108; 
     109;   * build output directory if needed 
     110;   * remove prompt from examples 
     111; 
    108112; - lelod 20111121 
    109 ;   introduction du parametre "descending" (orbite descendante 1, 
     113; 
     114;   * introduction du parametre "descending" (orbite descendante 1, 
    110115;   montante 0) dans le fichier de sortie : a tester! 
     116; 
    111117; - fplod 20110818T160435Z aedon.locean-ipsl.upmc.fr (Darwin) 
    112118; 
     
    147153; 
    148154;     It was ok when path as /bdd/AMSU-1C/AMSUAN15/L1C/2006/2006_07_28/:: 
    149 ;     IDL> c='/bdd/AMSU-1C/AMSUAN15/L1C/2006/2006_07_28/NSS.AMAX.NK.D06209.S1323.E1455.B4266162.GC.L1C' 
    150 ;     IDL> b=strmid(c,51) 
    151 ;     IDL> print, b 
    152 ;     IDL> NK.D06209.S1323.E1455.B4266162.GC.L1C 
     155;      c='/bdd/AMSU-1C/AMSUAN15/L1C/2006/2006_07_28/NSS.AMAX.NK.D06209.S1323.E1455.B4266162.GC.L1C' 
     156;      b=strmid(c,51) 
     157;      print, b 
     158;      NK.D06209.S1323.E1455.B4266162.GC.L1C 
    153159; 
    154160;     but now path can be anything (PROJETC_ID environment variable) 
     
    205211geomin = geolocation_to_string_idl(lon_min, lat_min, look, scale) 
    206212geomax = geolocation_to_string_idl(lon_max, lat_max, look, scale) 
    207 fileout=project_id_env+ 'AMSU/' $ 
     213        + string(mm,format='(I2.2)')   + '/' 
     214; 
     215fileout = project_id_env+ 'AMSU/' $ 
     216        + string(yyyy,format='(I4.4)') + '/' $ 
    208217        + string(yyyy,format='(I4.4)') + '/' $ 
    209218        + string(mm,format='(I2.2)')   + '/' $ 
     
    214223        + geomax $ 
    215224        + '.dat' 
     225; 
     226; buid the directory if needed 
     227dirout = file_dirname(fullfilename,/MARK_DIRECTORY) 
     228IF (FILE_TEST(dirout, /DIRECTORY, /EXECUTABLE, /WRITE) EQ 0) THEN BEGIN 
     229    msg = 'www : the directory' + dirout + ' is writable.' 
     230    FILE_MKDIR, dirout 
     231ENDIF 
     232; 
    216233 
    217234print, 'ouverture pour ecriture de ', fileout 
  • trunk/src/file_amsu_t2_to_mem.pro

    r503 r512  
    3939; impression de controle : structure et 1re ligne de données:: 
    4040; 
    41 IDL> help, result, /structure 
    42 IDL> print, result.data[0] 
     41 help, result, /structure 
     42 print, result.data[0] 
    4343; 
    4444; SEE ALSO 
  • trunk/src/idl_amsu_netcdf.pro

    r503 r512  
    4545; To produce :file:`${PROJECT_OD}/AMSU/a5_20060801_20060812_01000w2000n_00100w3000n.nc`:: 
    4646; 
    47 ;   IDL> numch = 'a5' 
    48 ;   IDL> lons = findgen(10) - 10 
    49 ;   IDL> lats = findgen(11) + 20 
    50 ;   IDL> timesin = indgen(12) + julday(8,1,2006L) 
    51 ;   IDL> datain = findgen(size(lons,/dim), size(lats,/dim), size(timesin,/dim)) 
    52 ;   IDL> idl_amsu_netcdf, numch , datain, lats, lons, timesin 
     47;    numch = 'a5' 
     48;    lons = findgen(10) - 10 
     49;    lats = findgen(11) + 20 
     50;    timesin = indgen(12) + julday(8,1,2006L) 
     51;    datain = findgen(size(lons,/dim), size(lats,/dim), size(timesin,/dim)) 
     52;    idl_amsu_netcdf, numch , datain, lats, lons, timesin 
    5353; 
    5454; SEE ALSO 
     
    8585; 
    8686; $URL$ 
     87; 
     88; - fplod 20120410 
     89; 
     90;   * build output directory if needed 
     91;   * remove prompt from examples 
    8792; 
    8893; - lelod 20111218 
     
    146151timemax = max(timesin) 
    147152yyyymmdde = jul2date(timemax) 
    148 cdfout = project_id_env+ 'AMSU/' $ 
     153cdfout = project_id_env+ 'AMSU/' 
    149154        + prefix+string(yyyymmddb,format='(I8.8)') + '_' $ 
    150155        + string(yyyymmdde,format='(I8.8)') + '_' $ 
     
    175180; creation du fichier netcdf de sortie 
    176181; -------------------------------------- 
     182; 
     183; buid the directory if needed 
     184dirout = file_dirname(cdfout,/MARK_DIRECTORY) 
     185IF (FILE_TEST(dirout, /DIRECTORY, /EXECUTABLE, /WRITE) EQ 0) THEN BEGIN 
     186    msg = 'www : the directory' + dirout + ' is writable.' 
     187    FILE_MKDIR, dirout 
     188ENDIF 
    177189; 
    178190print, 'ouverture pour ecriture de ', cdfout 
  • trunk/src/mem_to_file_amsu_t2.pro

    r504 r512  
    3131;   dd=1 
    3232;   testfilename='' 
    33 ;   amsu_t2 = file_amsu_t2_to_mem(yyyy, mm, dd, numch, testfilename) 
     33;   lon_min=-25. 
     34;   lon_max=25. 
     35;   lat_min=-5. 
     36;   lat_max=20. 
     37;   amsu_t2 = file_amsu_t2_to_mem(yyyy, mm, dd, numch, lon_min, lon_max, lat_min, lat_max, testfilename) 
    3438;   testfilename='./a' 
    3539;   result = mem_to_file_amsu_t2(amsu_t2, testfilename) 
     
    6771; 
    6872; $URL$ 
     73; 
     74; - fplod 20120410 
     75; 
     76;   * build output directory if needed 
     77;   * update example 
    6978; 
    7079; - fplod 20111213T143503Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    137146endelse 
    138147; 
     148; buid the directory if needed 
     149dirout = file_dirname(fullfilename,/MARK_DIRECTORY)  
     150IF (FILE_TEST(dirout, /DIRECTORY, /EXECUTABLE, /WRITE) EQ 0) THEN BEGIN 
     151    msg = 'www : the directory' + dirout + ' is writable.' 
     152    FILE_MKDIR, dirout 
     153ENDIF 
     154 
    139155print, 'ouverture pour ecriture de ', fullfilename 
    140156; 
Note: See TracChangeset for help on using the changeset viewer.