ica_spec_com.pro 1.66 KB
;===========================================================
;
;===================== ========================================
pro ica_spec_com 

common IcaSpecCom, Spec
common GraphC, graph, GraphN, Item
common Etab, Flag, Tab
Common Record, Record

 if (N_ELEMENTS(Flag) eq 0) then Flag = GraphN

 FillValue =  !Values.F_NAN
 Sampling = 192.0
 Sz =  Long((Graph[GraphN].DeltaT)/Sampling + 1)

  Spec = record
  Spec.DefSize = long(Graph[GraphN].DeltaT/Sampling + 1)
  Spec.Sampling = Sampling
  Graph[GraphN].FillValue[Item] = FillValue
  ; Graph[GraphN].Lag[Item] = double(Delay)

  Spec.Time = PTR_NEW(/ALLOCATE_HEAP)
  Spec.Val = PTR_NEW(/ALLOCATE_HEAP)
  Spec.LastTime = PTR_NEW(/ALLOCATE_HEAP)
  Spec.LastVal = PTR_NEW(/ALLOCATE_HEAP)

  if (Flag eq GraphN) then begin
      Tab = record;
      Tab.DefSize = long(Graph[GraphN].DeltaT/Sampling + 1)
      Tab.Sampling = Sampling
      
      Tab.Time = PTR_NEW(/ALLOCATE_HEAP)
      Tab.Val = PTR_NEW(/ALLOCATE_HEAP)
      Tab.LastTime = PTR_NEW(/ALLOCATE_HEAP)
      Tab.LastVal = PTR_NEW(/ALLOCATE_HEAP)
      Flag = GraphN;
  endif

  Graph[GraphN].Sampling[Item] =  Sampling
  Graph[GraphN].Time[Item] =  Spec.Time
  Graph[GraphN].Val[Item] = Spec.Val
 
  if (Graph[GraphN].Step GT Sampling*2.0) then begin
    *(Spec.Time) = indgen(Graph[GraphN].ppp)*Graph[GraphN].Step + Graph[GraphN].Step/2.0
    *(Spec.Val)  =  replicate(FillValue, 16L*96L*16L*Graph[GraphN].ppp)
    if (Flag eq GraphN) then begin
	*(Tab.Time) = indgen(Graph[GraphN].ppp)*Graph[GraphN].Step + Graph[GraphN].Step/2.0
	*(Tab.Val)  =  replicate(FillValue, Graph[GraphN].ppp)
    endif
  endif
  

return
end
;------------------------------------------------------------