;+
; NAME:
;     GET_ND_EFF
; PURPOSE:
;     Routine to get a properly normalized "effective noise diode" value
;     given a list of noise diode increments and the indexes corresponding to
;     the key frequencies.
; CATEGORY:
;     OVRO APC DATA ANALYSIS
; CALLING SEQUENCE:
;     nd_eff = get_nd_eff(idx,ndlist)
; INPUTS:
;     idx      the list of indexes into the NDLIST array corresponding to
;                the key frequencies (currently harmonics 7,9,14,25,41,53)
;     ndlist   the list of noise diode factors in which to select the key
;                values (typically 85 values, one for each frequency).
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
; ROUTINES CALLED:
; OUTPUTS:
;     nd_eff   the single value corresponding to the key noise diode value.
; COMMENTS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     Written 22-Jul-1999 by Dale E. Gary
;-
function get_nd_eff,ikey,ndlist
   good = where(ndlist[ikey] ne 0,ngood)
   if (ngood eq 0) then begin
      nd_eff = 0.0
   endif else begin
      igd = ikey[good]
      if (ngood eq 1) then nd_eff = ndlist[igd]/500. $
                      else nd_eff = (10^(total(alog10(ndlist[igd]))/ngood))/500.
   endelse
return,nd_eff
end