dustem_initialize_sed.pro 3.67 KB
FUNCTION dustem_initialize_sed,Nsed,comments=comments,help=help

;+
; NAME:
;    dustem_initialize_sed
;
; PURPOSE:
;    Initializes an empty DustEMWrapper SED structure
;
; CATEGORY:
;    DustEMWrapper, Distributed, Lowlevel
;
; CALLING SEQUENCE:
;    st=dustem_initialize_sed(Nsed[,/help])
;
; INPUTS:
;    Nsed: Number of elements/filters in the SED structure
;
; OPTIONAL INPUT PARAMETERS:
;    None
;
; OUTPUTS:
;    st = SED structure
;    The structure contains the following tags
;      instru  : name of the instrument. Actually not used by DustemWrap.
;      filter  : name of the filter. Actually defines the wavelength, the flux convention, etc ...
;      wave    : wavelength in microns. Actually not used by DustemWrap. [microns]
;      spec    : Total intensity Intensity (a.k.a. Stokes I) [MJy/sr]
;      StokesQ : Stokes Q intensity [MJy/sr]
;      StokesU : Stokes U intensity [MJy/sr]
;      largeP  : polarized intensity [MJy/sr] (computed from StokesQ,StokesU)
;      smallp  : polarization fraction [] (computed from StokesI, StokesQ,StokesU)
;      psi     : polarization angle [deg] (computed from StokesQ,StokesU)
;      sigmaII : = error^2 (for completness on sigmas) [MJy/sr^2]
;      sigmaQQ : variance on Q [MJy/sr^2]
;      sigmaUU : variance on U [MJy/sr^2]
;      sigmaIQ : IQ covariance [MJy/sr^2]
;      sigmaIU : IU covariance [MJy/sr^2]
;      sigmaQU : QU covariance [MJy/sr^2]
;      sigma_largep : uncertainty on largep [MJy/sr]
;      sigma_smallp: uncertainty on smallp []
;      sigma_psi  : uncertainty on psi [deg]
;
; OPTIONAL OUTPUT PARAMETERS:
;    comments : string comments about the SED
;
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
;
; COMMON BLOCKS:
;    None
;
; SIDE EFFECTS:
;    None
;
; RESTRICTIONS:
;    None
;
; PROCEDURE:
;    Straightforward
;
; EXAMPLES
;    st=dustem_initialize_sed(10)
;    help,st
;
; MODIFICATION HISTORY:
;    Written by JPB 
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
;-

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

;one_st={instru:'',filter:'',wave:0.,spec:0.,error:0.}
iv=la_undef(4)
one_st={instru:'',filter:'',wave:iv,StokesI:iv,StokesQ:iv,StokesU:iv,largeP:iv,smallp:iv,psi:iv,sigmaII:iv,sigmaQQ:iv,sigmaUU:iv,sigmaIQ:iv,sigmaIU:iv,sigmaQU:iv,sigma_largep:iv,sigma_smallp:iv,sigma_psi:iv}
comments=['Dustem-Wrap SED']
comments=[comments,'instru: Instrument name']
comments=[comments,'filter: Instrument filter']
comments=[comments,'wave: Filter reference wavelength [mic]']
comments=[comments,'StokesI: SED intensity [MJy/sr]']
comments=[comments,'StokesQ: Q Stokes parameter intensity [MJy/sr]']
comments=[comments,'StokesU: U Stokes parameter intensity [MJy/sr]']
comments=[comments,'largeP: Polarized intensity P [MJy/sr]']
comments=[comments,'smallp: polarization fraction []']
comments=[comments,'psi: polarization angle [deg]']
comments=[comments,'sigmaII: variance on Stokes I [(MJy/sr)^2]']
comments=[comments,'sigmaQQ: variance on Stokes Q [(MJy/sr)^2]']
comments=[comments,'sigmaUU: variance on Stokes U [(MJy/sr)^2]']
comments=[comments,'sigmaIQ: covariance on Stokes I and Q [(MJy/sr)^2]']
comments=[comments,'sigmaIU: covariance on Stokes I and U [(MJy/sr)^2]']
comments=[comments,'sigmaQU: covariance on Stokes Q and U [(MJy/sr)^2]']
comments=[comments,'sigma_largep: variance on Polarized Intensity (P) [(MJy/sr)^2]']
comments=[comments,'sigma_smallp: variance on polarisation fraction (p) []']
comments=[comments,'sigma_psi: variance on polarisation fraction (psi) [deg^2]']
comments=[comments,'CAUTION: p, P and psi values are NOT debiased']

sed=replicate(one_st,Nsed)

the_end:
RETURN,sed

END