c1_whi_ne_.pro 1.07 KB

; $Id: whi_ne_c1_.pro,v 1.1 2010/02/22 09:36:19 budnik Exp $
;
function c1_whi_ne_, StartTime, TimeInt, Time, RetSize, MaxSampling, close=close 
 common GraphC, graph, graphN
 common WHINEC1_COM, ID

   FillValue = -1.0
 
   if n_elements(ID) EQ 0 then ID = -1L
   Sampling = 1.5
   MaxSampling = 104.0
   Size = long(graph[graphN].DeltaT/sampling)

    VI = 'clust1:whi:whi'    
    Val = fltarr(Size)
    
    Time = dblarr(Size)

 
    RetSize = call_external(!PROJLIB + 'libParam.so', 'getLocalData', $
                             ID, VI, 'Density', StartTime, TimeInt, Size, Time, Val)
 
     if KEYWORD_SET(CLOSE) then begin
      error = call_external(!DDLIB+'DD_idl.so','CloseID',ID)
      ID = -1L
     endif

    if (RetSize LE 0) then begin
      Time = 0.D0
      return, 0.0
   endif
   
   Time=Time[0:Retsize-1]
   Val=Val[0:Retsize-1]
   
   num_gap = where(Val ne FillValue, Cntr)
  
   if Cntr le 0 then begin
       Retsize = -999
       Time = 0.D0
       return, [0.0, 0.0, 0.0]
   endif
   
    Time=Time[num_gap]
    Val=Val[num_gap]
    Retsize=Cntr
  
return, Val
end