;+
; NAME:
;     GET_INDEX_STRUCT
; PURPOSE:
;     Define structure necessary for holding information from OVRO APC
;     index segment.
; CATEGORY:
;     OVRO APC DATA ANALYSIS
; CALLING SEQUENCE:
;     idx = get_index_struct()
; INPUTS:
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
; ROUTINES CALLED:
; OUTPUTS:
;     idx     an empty index segment structure
; COMMENTS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     Written 29-Nov-1999 by Dale E. Gary
;-
function get_index_struct

   ; Define SCNTRY structure
   scn = {scntry, scancode: 0, segcode: 0, srec: 0, syear: 0, sday: 0, smsec: 0L,$
          srcname:' ', hao: 0.0, deco:0.0, erec: 0, eyear: 0, eday: 0, emsec: 0L,$
          recs: intarr(20)}

   ; Define SGNTRY structure
   seg = {sgntry, segcode: 0, srec:0, syear:0, sday: 0, smsec: 0L}

   ; Define INDEX structure
   idx = {index,    recn:          0,$  ; The start record number of the INDEX segment
                 n_templ:          0,$  ; Number of segment codes in template
                   codes: intarr(20),$  ; Array of segment codes in template
                  nscans:          0,$  ; Number of scan entries
                   nsegs:          0,$  ; Number of special segment entries
                   pScan: ptr_new(0),$  ; ptr to array of scan entry structures
                   pSegs: ptr_new(0)}   ; ptr to array of segment entry structures

return,idx
end