;+
; NAME:
;     GET_GPARM_STRUCT
; PURPOSE:
;     Define structure necessary for holding gain parameter calibration information
;     from the GAINPARM segment.
; CATEGORY:
;     OVRO APC DATA ANALYSIS
; CALLING SEQUENCE:
;     gainparm = get_gparm_struct()
; INPUTS:
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
; ROUTINES CALLED:
; OUTPUTS:
;     gainparm    an empty gain parameter structure
; COMMENTS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     Written 24-Nov-1999 by Dale E. Gary
;-
function get_gparm_struct

   ; Define EPOCH structure
   epoch = {epoch, yr:0, doy:0, sec:0L}

   ; Define GNP structure
   gnp = {gnp, nlparm:0.0, attn: fltarr(3), ndfac:0.0, resid:0.0}

   ; Define GCAL structure
   gcal = {gcal, rcvr:0.0, nd:0.0, resid:0.0}

   ; Define GAINPARM structure
   gainparm = {   epoch:      {epoch}, $ ; An EPOCH structure for date/time of parameters
               pOffsets:   ptr_new(0), $ ; Pointer to NANT x NANT array holding offsets
                   pGNP:   ptr_new(0), $ ; Pointer to array of GNP structures of size NANT
                  dlcal: fltarr(4,14), $ ; Static array to hold DLCAL data
                  pGCAL:   ptr_new(0)}   ; Pointer to array of GCAL structures

return,gainparm
end