;+
 ;PROJECT: 
;   HESSI
;  
; NAME: 
;   brm2_check_energies
;  
; PURPOSE:
;   When a sharp break, eebrk, is present in the electron distribution function,
;   this sets it to eelow if its value is less than eelow, or to eehigh if its value
;   is greater than eehigh.  This assures that the integration routine done not
;   attempt to integrate over an interval that is outside the range of the electron
;   distribution function.  This is not done if the break is not sharp, as is the 
;   case for the return current distribution function.  
;   
; CATEGORY:
;   HESSI, Spectra, Modeling
;
; CALLING SEQUENCE:
;   brm2_check_energies, eelow, eebrk, eehigh, _extra=_extra
; 
; CALLED BY:
;   Brm2_DmlinO
;   
; CALLS:
;   none
;   
; INPUTS:
; 
;   eelow      -   Low energy cut-off. 
;
;   eebrk      -   Break energy. 
;
;   eehigh      -   High energy cut-off. 
;   
; OUTPUTS:
;
;   Modifies the value of eebrk if the value of eebrk is not between eelow and eehigh
;   and if the keyword is not return_current.
;   
; KEYWORDS:
;
;   return_current    -    eebrk is not modified if this keyword is set
;   
; MODIFICATION HISTORY:
;   Version 1, Kim Tolbert, 05-Mar-2013
;
;-

pro brm2_check_energies, eelow, eebrk, eehigh, _extra=_extra, return_current=return_current

if ~keyword_set(return_current) then begin
  IF eebrk lt eelow then eebrk=eelow
  IF eebrk gt eehigh then eebrk=eehigh
endif

end
