Ignore:
Timestamp:
11/30/11 15:53:12 (12 years ago)
Author:
pinsard
Message:

first diag on pkb tools for timeseries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/flux_evaluation_tpr_timeseries.pro

    r106 r107  
    1 ;------------------------------------------------------------ 
     1;+ 
     2; 
     3; .. _flux_evaluation_tpr_timeseries.pro: 
     4; 
     5; ================================== 
     6; flux_evaluation_tpr_timeseries.pro 
     7; ================================== 
     8; 
     9; DESCRIPTION 
     10; =========== 
     11; 
     12; SEE ALSO 
     13; ======== 
     14; 
     15; :ref:`project_profile.sh` 
     16; :ref:`project_init.pro` 
     17; :ref:`cm_project.pro` 
     18; 
     19; TODO 
     20; ==== 
     21; 
     22; make it work : missing READ_TPR_NETFLUX 
     23; 
     24; EXAMPLES 
     25; ======== 
     26; 
     27; :: 
     28; 
     29;   IDL> date1 = 20000101L 
     30;   IDL> date2 = 20091231L 
     31;   IDL> flux_evaluation_tpr_timeseries, date1, date2 
     32; 
     33; EVOLUTIONS 
     34; ========== 
     35; 
     36; $Id$ 
     37; 
     38; $URL$ 
     39; 
     40; - fplod 20111130T141341Z cratos (Linux) 
     41; 
     42;   * try to make it work on my account on cratos 
     43;   * remove x_site_location and  x_site_location because already exist 
     44; 
     45;- 
    246pro flux_evaluation_tpr_timeseries, $ 
    347;                    var,    $ ;;  flux variable (swr, lwr, lhf, shf) to calculate the statistics 
     
    650 
    751@common 
    8 ;------------------------------------------------------------ 
     52@cm_project 
    953reinitplt, /z,/invert 
    1054key_portrait = 0 
    11 openps, FILENAME = 'idl.ps' 
     55openps, FILENAME = project_od_env+'flux_evaluation_tpr_timeseries.ps' 
    1256;------------------------------------------------------------ 
    1357;; part to change 
     
    4589close,/all 
    4690 
    47 fi='/Users/pkb/work/MY_SAXO/TropFlux_update/flux_stat.txt' 
     91fi=project_id_env + 'flux_stat.txt' 
    4892openw,1,fi 
    4993 
     
    5296;; First, this program reads the full TropFlux data and later extract it at specific TPR locations 
    5397 
    54 file="/Volumes/PAYASAM/TropFlux/TropFlux/shf_tropflux_1d_1989_2010.nc" 
     98file = project_id_env + "shf_tropflux_1d_1989_2010.nc" 
    5599initncdf, file 
    56100var=-1*read_ncdf("shf", date1, date2, file=file,/nostr) 
     
    74118    if (y ge 0. and y le 30.) then y=y+360. 
    75119    dx=0.5 & dy=0.5 & box=[y-dy, y+dy, x-dx, x+dx] 
    76       
     120 
    77121    read_tpr_netflux, csite,date1,date2,nsmooth, $ 
    78122            sw,lw,sh,lh 
     
    97141           cstat=string(cor, bias, std, rmsd, format='(f4.2,3x,f7.2,3x,f4.2,3x,f5.2)') 
    98142           print, cstat 
    99   
     143 
    100144;;         PLOTTING THE TIME-SERIES 
    101145           array=[tpr, var_tpr] & mi=min(array,/nan) & ma=max(array,/nan) & int=(ma-mi)/3. 
     
    111155 
    112156close,/all 
    113 ;---------------------------------------------------------- 
    114157closeps 
    115158 
    116 fig='flux_evaluation_tpr_timeseries.ps' 
    117 spawn, 'mv '+psdir+'idl.ps '+updatedir+fig 
    118 spawn, 'gv '+updatedir+fig 
    119 return 
    120159end 
    121 ;-------------------------------------------------------------------------- 
    122 function x_site_location, site 
    123     n1=strpos(site, 's') 
    124 if (n1 gt -1) then begin 
    125     ns=-1. 
    126     x=strmid(site, 0, n1) 
    127     x=float(x)*ns 
    128 endif else begin 
    129     n1=strpos(site, 'n') 
    130     x=strmid(site, 0, n1) 
    131     ny=1. 
    132     x=float(x)*ny 
    133 endelse 
    134 return, float(x) 
    135 end 
    136 ;-------------------------------------------------------------------------- 
    137 function y_site_location, site 
    138     n1=strpos(site, 'e') 
    139 if (n1 gt -1) then begin 
    140     n=strpos(site, 's') 
    141     if (n gt -1) then begin 
    142         y=strmid(site, n+1, n1-n-1) 
    143     endif else begin 
    144         n=strpos(site, 'n') 
    145         y=strmid(site, n+1, n1-n-1) 
    146     endelse 
    147  
    148 endif else begin 
    149     n1=strpos(site, 'w') 
    150     n=strpos(site, 's') 
    151     if (n gt -1) then begin 
    152         y=strmid(site, n+1, n1-n-1) 
    153         y=180+(180-float(y)) 
    154     endif else begin 
    155         n=strpos(site, 'n') 
    156         y=strmid(site, n+1, n1-n-1) 
    157         y=180+(180-float(y)) 
    158    endelse 
    159 endelse 
    160 return,float(y) 
    161 end 
    162  
    163 ;-------------------------------------------------------------------------- 
    164  
Note: See TracChangeset for help on using the changeset viewer.