mex_h_vel_.pro 1.12 KB
function MEX_H_VEL_RESTR_, StartTime, TimeInt, Time, RetSize, Sampling, close=close
common GraphC, graph, GraphN
common MEXHDVEL_COM, ID

   FillValue = !Values.F_NAN 
   if n_elements(ID) EQ 0 then ID = -1L
   sampling = 192.0
   Size = long(graph[GraphN].DeltaT/sampling)
     
   Bdata=fltarr(3,Size)
   Time=dblarr(Size)
   
   Mission ="mex";
 
    VI = Mission + ':ima:param'
    ParamName = "Velocity_P";
 
    RetSize = call_external(!PROJLIB + 'libParam.so', 'getLocalData', $
                          ID, VI, ParamName, StartTime, TimeInt, Size, Time, Bdata)
                          
  
   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,0.0,0.0]
   endif
   
   Time=Time[0:Retsize-1]
   Bdata=Bdata[*,0:Retsize-1]
   
   num_gap = where(finite(Bdata[0,*]), Cntr)
  
   if Cntr le 0 then begin
       Retsize = -999
       Time = 0.D0
       return, [0.0,0.0,0.0] 
   endif
   
    Time=Time[num_gap]
    Bdata=Bdata[*,num_gap];
    Retsize=Cntr
 
return, Bdata
end