Blame view

src/idl/dustem_initialize_sed.pro 3.73 KB
96d87510   Jean-Philippe Bernard   modified after di...
1
FUNCTION dustem_initialize_sed,Nsed,comments=comments,help=help,double=double
427f1205   Jean-Michel Glorian   version 4.2 merged
2

ef75e0b6   Jean-Philippe Bernard   added polarizatio...
3
4
5
;+
; NAME:
;    dustem_initialize_sed
b17359ea   Annie Hughes   updated help
6
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
7
; PURPOSE:
b17359ea   Annie Hughes   updated help
8
9
;    Initializes an empty DustEMWrapper SED structure
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
10
; CATEGORY:
b17359ea   Annie Hughes   updated help
11
12
;    DustEMWrapper, Distributed, Lowlevel
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
13
14
; CALLING SEQUENCE:
;    st=dustem_initialize_sed(Nsed[,/help])
b17359ea   Annie Hughes   updated help
15
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
16
; INPUTS:
4fd64cbb   Ilyes Choubani   dustem_fit_sed_po...
17
;    Nsed: Number of elements/filters in the SED structure
b17359ea   Annie Hughes   updated help
18
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
19
; OPTIONAL INPUT PARAMETERS:
9fb4644d   Jean-Philippe Bernard   added comments ke...
20
;    None
b17359ea   Annie Hughes   updated help
21
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
22
23
24
25
26
; 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 ...
9fb4644d   Jean-Philippe Bernard   added comments ke...
27
28
;      wave    : wavelength in microns. Actually not used by DustemWrap. [microns]
;      spec    : Total intensity Intensity (a.k.a. Stokes I) [MJy/sr]
9fb4644d   Jean-Philippe Bernard   added comments ke...
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;      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]
b17359ea   Annie Hughes   updated help
43
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
44
; OPTIONAL OUTPUT PARAMETERS:
9fb4644d   Jean-Philippe Bernard   added comments ke...
45
;    comments : string comments about the SED
b17359ea   Annie Hughes   updated help
46
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
47
48
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
b17359ea   Annie Hughes   updated help
49
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
50
51
; COMMON BLOCKS:
;    None
b17359ea   Annie Hughes   updated help
52
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
53
54
; SIDE EFFECTS:
;    None
b17359ea   Annie Hughes   updated help
55
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
56
57
; RESTRICTIONS:
;    None
b17359ea   Annie Hughes   updated help
58
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
59
60
; PROCEDURE:
;    Straightforward
b17359ea   Annie Hughes   updated help
61
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
62
63
64
; EXAMPLES
;    st=dustem_initialize_sed(10)
;    help,st
b17359ea   Annie Hughes   updated help
65
;
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
66
67
; MODIFICATION HISTORY:
;    Written by JPB 
b17359ea   Annie Hughes   updated help
68
69
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
ef75e0b6   Jean-Philippe Bernard   added polarizatio...
70
71
72
73
74
75
76
77
78
;-

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.}
9fb4644d   Jean-Philippe Bernard   added comments ke...
79
iv=la_undef(4)
96d87510   Jean-Philippe Bernard   modified after di...
80
81
IF keyword_set(double) THEN iv=la_undef(5)

0c7104bf   Jean-Philippe Bernard   adapted to new fi...
82
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}
9fb4644d   Jean-Philippe Bernard   added comments ke...
83
84
85
86
comments=['Dustem-Wrap SED']
comments=[comments,'instru: Instrument name']
comments=[comments,'filter: Instrument filter']
comments=[comments,'wave: Filter reference wavelength [mic]']
8a88c1a3   Jean-Philippe Bernard   can't remember wh...
87
comments=[comments,'StokesI: SED intensity [MJy/sr]']
9fb4644d   Jean-Philippe Bernard   added comments ke...
88
89
90
91
92
93
94
95
96
97
98
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]']
66d0acb9   Jean-Philippe Bernard   replaced P,p,psi ...
99
100
101
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]']
dc1d71e5   Jean-Philippe Bernard   added a comment o...
102
comments=[comments,'CAUTION: p, P and psi values are NOT debiased']
9fb4644d   Jean-Philippe Bernard   added comments ke...
103

427f1205   Jean-Michel Glorian   version 4.2 merged
104
105
sed=replicate(one_st,Nsed)

ef75e0b6   Jean-Philippe Bernard   added polarizatio...
106
the_end:
427f1205   Jean-Michel Glorian   version 4.2 merged
107
108
109
RETURN,sed

END