PRO eae_update_ref_vals, eae ; ; This procedure goes through the eae.reference_id and ; finds the effective area from them and puts the value ; into eae.reference_value for ir = 0, n_elements(eae)-1 do begin if eae(ir).reference_id NE '' then begin ; if there is an = then it is fixed value if STRPOS(eae(ir).reference_id,'=') GE 0 then begin value = 0.0 pieces = STR_SEP(eae(ir).reference_id, '=') READS, pieces(1), value eae(ir).reference_value = value end else begin ; strip off any factor pieces = STR_SEP(eae(ir).reference_id, '*') ref_ids = pieces(0) ; second piece is the factor if it is there factor = 1.0 if n_elements(pieces) EQ 2 then begin READS, pieces(1), factor end ; See if it is a compound pieces = STR_SEP(ref_ids,'+') value = 0.0 for ip=0,n_elements(pieces)-1 do begin match = where(eae.trw_id EQ pieces(ip), nmatch) if nmatch EQ 1 then begin value = value + factor*eae(match(0)).effective end else begin ; found zero or multiple times... print, 'eae_update_ref_vals: zero/multiple of:'+pieces(ip) if nmatch GT 1 then print, match end end eae(ir).reference_value = value end end end RETURN END