dustem_nir_continuum.pro 1.4 KB
FUNCTION dustem_nir_continuum,key=key,val=val,scope=scope,help=help

;+
; NAME:
;    dustem_nir_continuum
; PURPOSE:
;    Dustem Wrapper plugin to add NIR continuum to SED
; CATEGORY:
;    DUSTEM Wrapper (plugin)
; CALLING SEQUENCE:
;    cont=dustem_nir_continuum([key=][,val=][,scope=][,/help])
; INPUTS:
;    
; OPTIONAL INPUT PARAMETERS:
;    key  = input parameter numbers (starting at 1)
;    val  = input parameter values (same dimension as key)
; OUTPUTS:
;    result = continuum spectrum (computed on DustemWrap SED wavelengths)
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    None
; PROCEDURE:
;    This is a dustem pluggin
; EXAMPLES
;
; MODIFICATION HISTORY:
;    Written by JPB 
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_nir_continuum'
  output=0.
  goto,the_end
ENDIF

;stop

;default values of input parameters
temp=1000.
ampl=1.d-2

IF keyword_set(key) THEN BEGIN 
  a=where(key EQ 1,count1)
  b=where(key EQ 2,count2)
  IF count1 NE 0 then temp=(val(a))[0]
  IF count2 NE 0 then ampl=(val(b))[0]
ENDIF

scope=['ADD_SED']


lambir=((*!dustem_params).lambda.lambda)

;=== normalize spectrum to the requested amplitude.
norm = max(dustem_planck_function(temp,lambir))
output = ampl*dustem_planck_function(temp,lambir)/norm
;stop

the_end:
RETURN,output
  
END