Commit 041ca6b60f34d07b0a4d9d8c76fa2965a9e49d9b
1 parent
ae0273b1
Exists in
master
updated help
Showing
7 changed files
with
294 additions
and
56 deletions
Show diff stats
src/idl/dustem_create_ionfrac.pro
1 | -function dustem_create_ionfrac, key=key, val=val | |
1 | +function dustem_create_ionfrac, key=key, val=val,help=help | |
2 | 2 | |
3 | +;+ | |
4 | +; NAME: | |
5 | +; dustem_create_ionfrac | |
6 | +; | |
7 | +; PURPOSE: | |
8 | +; Calculates the neutral/positive/negative PAH fractions for a given | |
9 | +; temperature, density and grain size distribution and writes it to | |
10 | +; the appropriate .DAT file (according to !run_ionfrac). Deprecated | |
11 | +; | |
12 | +; CATEGORY: | |
13 | +; DustEMWrap, Distributed, MidLevel, Deprecated | |
14 | +; | |
15 | +; CALLING SEQUENCE: | |
16 | +; | |
17 | +; INPUTS: | |
18 | +; key -- (1) gas temperature and (2) n_elec | |
19 | +; val -- values corresponding to parameters passed by key | |
20 | +; other physical parameters taken from the dust model as specified in | |
21 | +; the grain structure, i.e. (*!dustem_params).grains | |
22 | +; | |
23 | +; OPTIONAL INPUT PARAMETERS: | |
24 | +; | |
25 | +; OUTPUTS: | |
26 | +; | |
27 | +; OPTIONAL OUTPUT PARAMETERS: | |
28 | +; | |
29 | +; ACCEPTED KEY-WORDS: | |
30 | +; help = print this help | |
31 | +; | |
32 | +; COMMON BLOCKS: | |
33 | +; None | |
34 | +; | |
35 | +; SIDE EFFECTS: | |
36 | +; | |
37 | +; RESTRICTIONS: | |
38 | +; | |
39 | +; PROCEDURES AND SUBROUTINES USED: | |
40 | +; | |
41 | +; EXAMPLES | |
42 | +; | |
43 | +; MODIFICATION HISTORY: | |
44 | +; Written by NF 2007 | |
45 | +; Evolution details on the DustEMWrap gitlab. | |
46 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
47 | +;- | |
48 | + | |
49 | + | |
50 | + if N_PARAMS() LT 1 or keyword_set(help) then begin | |
51 | + doc_library,'dustem_create_ionfrac' | |
52 | + goto, the_end | |
53 | + end | |
54 | + | |
55 | + | |
3 | 56 | ;PURPOSE : |
4 | 57 | ;-------- |
5 | 58 | ; pour une Tempรฉrature et une densitรฉ donnรฉe |
... | ... | @@ -217,6 +270,7 @@ function dustem_create_ionfrac, key=key, val=val |
217 | 270 | dustem_write_size_lv, !dustem_dat, (*!dustem_params).size |
218 | 271 | endif |
219 | 272 | |
273 | +the_end: | |
220 | 274 | return,0 |
221 | 275 | |
222 | 276 | end | ... | ... |
src/idl/dustem_init_fixed_params.pro
1 | 1 | PRO dustem_init_fixed_params,fpd,fiv |
2 | 2 | |
3 | -;This routine is used to update the model input files with fixed | |
4 | -;parameters | |
3 | +;+ | |
4 | +; NAME: | |
5 | +; dustem_init_fixed_params | |
6 | +; | |
7 | +; PURPOSE: | |
8 | +; This routine updates the fixed parameters of both the | |
9 | +; dust models and plugins in the input files | |
10 | +; | |
11 | +; CATEGORY: | |
12 | +; DustEMWrap, Distributed, Low-Level, Initialization | |
13 | +; | |
14 | +; CALLING SEQUENCE: | |
15 | +; dustem_init_params, pd, iv, [,fpd=fpd,fiv=fiv,ulimed=ulimed,llimed=llimed,ulims=ulims,lolims=llims,tied=tied,fixed=fixed] | |
16 | +; | |
17 | +; INPUTS: | |
18 | +; model -- the dust model | |
19 | +; pd -- the parameter description vector | |
20 | +; iv -- the initial values of the free parameters | |
21 | +; | |
22 | +; OPTIONAL INPUT PARAMETERS: | |
23 | +; | |
24 | +; | |
25 | +; OUTPUTS: | |
26 | +; None | |
27 | +; | |
28 | +; OPTIONAL OUTPUT PARAMETERS: | |
29 | +; None | |
30 | +; | |
31 | +; ACCEPTED KEY-WORDS: | |
32 | +; model = specifies the interstellar dust mixture used by DustEM | |
33 | +; 'MC10' model from Compiegne et al 2010 (default) | |
34 | +; 'DBP90' model from Desert et al 1990 | |
35 | +; 'DL01' model from Draine & Li 2001 | |
36 | +; 'WD01_RV5p5B' model from Weingartner & Draine 2002 with Rv=5.5 | |
37 | +; 'DL07' model from Draine & Li 2007 | |
38 | +; 'J13' model from Jones et al 2013, as updated in | |
39 | +; Koehler et al 2014 | |
40 | +; 'G17_ModelA' model A from Guillet et al (2018). Includes | |
41 | +; polarisation. See Tables 2 and 3 of that paper for details. | |
42 | +; 'G17_ModelB' model B from Guillet et al (2018) | |
43 | +; 'G17_ModelC' model C from Guillet et al (2018) | |
44 | +; 'G17_ModelD' model A from Guillet et al (2018) | |
45 | +; help = if set, print this help | |
46 | +; | |
47 | +; COMMON BLOCKS: | |
48 | +; None | |
49 | +; | |
50 | +; SIDE EFFECTS: | |
51 | +; None | |
52 | +; | |
53 | +; RESTRICTIONS: | |
54 | +; The DustEM fortran code must be installed | |
55 | +; The DustEMWrap IDL code must be installed | |
56 | +; | |
57 | +; PROCEDURES AND SUBROUTINES USED: | |
58 | +; dustem_init_parinfo | |
59 | +; dustem_init_plugins | |
60 | +; dustem_init_fixed_params | |
61 | +; | |
62 | +; EXAMPLES | |
63 | +; | |
64 | +; MODIFICATION HISTORY: | |
65 | +; Written by AH October-2022 | |
66 | +; Evolution details on the DustEMWrap gitlab. | |
67 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
68 | +;- | |
69 | + | |
70 | +IF keyword_set(help) THEN BEGIN | |
71 | + doc_library,'dustem_init_fixed_params' | |
72 | + goto,the_end | |
73 | +END | |
5 | 74 | |
6 | 75 | ;Save the values of fit parameter descriptions and values |
7 | 76 | need_save=0 |
... | ... | @@ -38,5 +107,5 @@ IF need_save EQ 1 THEN BEGIN |
38 | 107 | (*!dustem_fit).param_func=ptr_new(find) |
39 | 108 | ENDIF |
40 | 109 | |
41 | - | |
110 | +the_end: | |
42 | 111 | END | ... | ... |
src/idl/dustem_init_params.pro
... | ... | @@ -15,7 +15,7 @@ PRO dustem_init_params,model,pd,iv, $ |
15 | 15 | ; DustEMWrap, Distributed, Mid-Level, Initialization |
16 | 16 | ; |
17 | 17 | ; CALLING SEQUENCE: |
18 | -; dustem_init_params, pd, iv, [,fpd=fpd,fiv=fiv,ulimed=ulimed,llimed=llimed,ulims=ulims,lolims=llims,tied=tied,fixed=fixed] | |
18 | +; dustem_init_params, model, pd, iv, [,fpd=fpd,fiv=fiv,ulimed=ulimed,llimed=llimed,ulims=ulims,lolims=llims,tied=tied,fixed=fixed] | |
19 | 19 | ; |
20 | 20 | ; INPUTS: |
21 | 21 | ; model -- the dust model |
... | ... | @@ -23,7 +23,15 @@ PRO dustem_init_params,model,pd,iv, $ |
23 | 23 | ; iv -- the initial values of the free parameters |
24 | 24 | ; |
25 | 25 | ; OPTIONAL INPUT PARAMETERS: |
26 | -; | |
26 | +; fpd -- the fixed parameter description vector | |
27 | +; fiv -- the initial values of the fixed parameters | |
28 | +; ulimed -- flag 1/0 if upper limits ON/OFF | |
29 | +; llimed -- flag 1/0 if lower limits ON/OFF | |
30 | +; ulims -- upper limit values | |
31 | +; llims -- lower limit values | |
32 | +; | |
33 | +; | |
34 | +; | |
27 | 35 | ; |
28 | 36 | ; OUTPUTS: |
29 | 37 | ; None |
... | ... | @@ -32,19 +40,7 @@ PRO dustem_init_params,model,pd,iv, $ |
32 | 40 | ; None |
33 | 41 | ; |
34 | 42 | ; ACCEPTED KEY-WORDS: |
35 | -; model = specifies the interstellar dust mixture used by DustEM | |
36 | -; 'MC10' model from Compiegne et al 2010 (default) | |
37 | -; 'DBP90' model from Desert et al 1990 | |
38 | -; 'DL01' model from Draine & Li 2001 | |
39 | -; 'WD01_RV5p5B' model from Weingartner & Draine 2002 with Rv=5.5 | |
40 | -; 'DL07' model from Draine & Li 2007 | |
41 | -; 'J13' model from Jones et al 2013, as updated in | |
42 | -; Koehler et al 2014 | |
43 | -; 'G17_ModelA' model A from Guillet et al (2018). Includes | |
44 | -; polarisation. See Tables 2 and 3 of that paper for details. | |
45 | -; 'G17_ModelB' model B from Guillet et al (2018) | |
46 | -; 'G17_ModelC' model C from Guillet et al (2018) | |
47 | -; 'G17_ModelD' model A from Guillet et al (2018) | |
43 | +; polarization = assume dustem is running in polarization mode | |
48 | 44 | ; help = if set, print this help |
49 | 45 | ; |
50 | 46 | ; COMMON BLOCKS: |
... | ... | @@ -135,34 +131,40 @@ end |
135 | 131 | |
136 | 132 | ; basic sanity checking of models |
137 | 133 | |
138 | -known_mdls=['MC10','DBP90','DL01','WD01_RV5P5B','DL07','J13','G17_MODELA','G17_MODELB','G17_MODELC','G17_MODELD'] | |
139 | -pol_mdls=['G17_MODELA','G17_MODELB','G17_MODELC','G17_MODELD'] | |
140 | -test_model = where(known_mdls eq model,ct) | |
141 | -if ct eq 0 then begin | |
142 | - message,'ISM dust model '+use_model+' unknown',/continue | |
143 | - message,'Known models are MC10,DBP90,DL01,WD01_RV5P5B,DL07,J13,G17_MODELA,G17_MODELB,G17_MODELC,G17_MODELD',/continue | |
144 | - stop | |
145 | -end | |
146 | - | |
147 | -if keyword_set(polarization) then begin | |
148 | - test_model = where(pol_mdls eq model,ct) | |
149 | - if ct eq 0 then begin | |
150 | - message,'The only models with polarisation are G17_MODELA,G17_MODELB,G17_MODELC,G17_MODELD',/continue | |
151 | - stop | |
152 | - end | |
153 | -end else begin | |
154 | - test_model = where(pol_mdls eq model,ct) | |
155 | - if ct eq 1 then begin | |
156 | - message,'You have requested a dust model with polarisation '+model+' but DustEMWrap is not initialized in polarisation mode',/info | |
157 | - message,'You should set dustem_init,model=use_model,polarization=1',/info | |
158 | - message,'and set polarization=1 in the call to this routine (dustem_init_params)',/info | |
159 | - stop | |
160 | - end | |
161 | -end | |
134 | +;;known_mdls=['MC10','DBP90','DL01','WD01_RV5P5B','DL07','J13','G17_MODELA','G17_MODELB','G17_MODELC','G17_MODELD'] | |
135 | +;;pol_mdls=['G17_MODELA','G17_MODELB','G17_MODELC','G17_MODELD'] | |
136 | +;;test_model = where(known_mdls eq model,ct) | |
137 | +;; if ct eq 0 then begin | |
138 | +;; message,'ISM dust model '+use_model+' unknown',/continue | |
139 | +;; message,'Known models are MC10,DBP90,DL01,WD01_RV5P5B,DL07,J13,G17_MODELA,G17_MODELB,G17_MODELC,G17_MODELD',/continue | |
140 | +;; stop | |
141 | +;; end | |
142 | +;; if keyword_set(polarization) then begin | |
143 | +;; test_model = where(pol_mdls eq model,ct) | |
144 | +;; if ct eq 0 then begin | |
145 | +;; message,'The only models with polarisation are G17_MODELA,G17_MODELB,G17_MODELC,G17_MODELD',/continue | |
146 | +;; stop | |
147 | +;; end | |
148 | +;; end else begin | |
149 | +;; test_model = where(pol_mdls eq model,ct) | |
150 | +;; if ct eq 1 then begin | |
151 | +;; message,'You have requested a dust model with polarisation '+model+' but DustEMWrap is not initialized in polarisation mode',/info | |
152 | +;; message,'You should set dustem_init,model=use_model,polarization=1',/info | |
153 | +;; message,'and set polarization=1 in the call to this routine (dustem_init_params)',/info | |
154 | +;; stop | |
155 | +;; end | |
156 | +;; end | |
157 | + | |
158 | +exists=dustem_test_model_exists(model) | |
159 | +if exists ne 1 then $ | |
160 | + message,'Unknown dust model '+model | |
161 | + | |
162 | +polexists=dustem_test_model_exists(use_model,/pol,/silent) | |
163 | +if keyword_set(polarization) and polexists eq 0 then $ | |
164 | + message,'You have requested polarization mode, but the '+model+' model does not predict polarization' | |
162 | 165 | |
163 | 166 | ; basic sanity checking of plugins |
164 | - | |
165 | - | |
167 | +; to be written | |
166 | 168 | |
167 | 169 | ;== INITIALIZE DUST MODEL PARAMETERS and PLUGIN FREE PARAMETERS |
168 | 170 | dustem_init_parinfo,pd,iv,up_limited=ulimed,lo_limited=llimed,up_limits=ulims,lo_limits=llims,fixed=fixed,tied=tied | ... | ... |
src/idl/dustem_serkowski.pro
1 | 1 | FUNCTION DUSTEM_SERKOWSKI, x, ka=ka, xmax=xmax, pmax=pmax |
2 | - IF N_PARAMS() EQ 0 THEN BEGIN | |
3 | - print,'FUNCTION SERKOWSKI, x, ka=ka, xmax=xmax, pmax=pmax ' | |
4 | - print,' computes the Serkowski law (Draine & Fraisse 2009)' | |
5 | - print,'' | |
6 | - print,' X (I): array(n_qabs) inverse wavenumber in 1/microns' | |
7 | - print,' KA (I): K factor' | |
8 | - print,' XMAX (I): x-position of max' | |
9 | - print,' PMAX (I): max polar. fraction' | |
10 | - ENDIF | |
2 | + | |
3 | +;+ | |
4 | +; NAME: | |
5 | +; dustem_serkwoski | |
6 | +; | |
7 | +; PURPOSE: | |
8 | +; computes the Serkowski law (as per Draine & Fraisse 2009) | |
9 | +; | |
10 | +; CATEGORY: | |
11 | +; DustEMWrap, Distributed, LowLevel, Helper | |
12 | +; | |
13 | +; CALLING SEQUENCE: | |
14 | +; serk = DUSTEM_SERKOWSKI(X,[KA=KA,XMAX=XMAX,PMAX=PMAX]) | |
15 | +; | |
16 | +; INPUTS: | |
17 | +; X -- array(n_qabs) inverse wavenumber in 1/microns' | |
18 | +; | |
19 | +; OPTIONAL INPUT PARAMETERS: | |
20 | +; KA (I): K factor, default = 0.92 | |
21 | +; XMAX (I): x-position of max, default = 1.82 | |
22 | +; PMAX (I): max polar. fraction, default = 0.03 | |
23 | +; | |
24 | +; OUTPUTS: | |
25 | +; | |
26 | +; OPTIONAL OUTPUT PARAMETERS: | |
27 | +; | |
28 | +; ACCEPTED KEY-WORDS: | |
29 | +; help = print this help | |
30 | +; | |
31 | +; COMMON BLOCKS: | |
32 | +; None | |
33 | +; | |
34 | +; SIDE EFFECTS: | |
35 | +; | |
36 | +; RESTRICTIONS: | |
37 | +; | |
38 | +; PROCEDURES AND SUBROUTINES USED: | |
39 | +; | |
40 | +; EXAMPLES | |
41 | +; | |
42 | +; MODIFICATION HISTORY: | |
43 | +; Written by LV (VG ?) | |
44 | +; Initially distributed with the Fortran, incorporated into DustEMWrap 2022 | |
45 | +; Evolution details on the DustEMWrap gitlab. | |
46 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
47 | +;- | |
48 | + | |
49 | + | |
50 | + if N_PARAMS() LT 1 or keyword_set(help) then begin | |
51 | + doc_library,'dustem_serkowski' | |
52 | + yy=0 | |
53 | + goto, the_end | |
54 | + end | |
55 | + | |
56 | + | |
57 | + ;; IF N_PARAMS() EQ 0 THEN BEGIN | |
58 | + ;; print,'FUNCTION SERKOWSKI, x, ka=ka, xmax=xmax, pmax=pmax ' | |
59 | + ;; print,' computes the Serkowski law (Draine & Fraisse 2009)' | |
60 | + ;; print,'' | |
61 | + ;; print,' X (I): array(n_qabs) inverse wavenumber in 1/microns' | |
62 | + ;; print,' KA (I): K factor' | |
63 | + ;; print,' XMAX (I): x-position of max' | |
64 | + ;; print,' PMAX (I): max polar. fraction' | |
65 | + ;; ENDIF | |
66 | + | |
11 | 67 | IF n_elements(KA) EQ 0 THEN ka = 0.92 ; Draine & Fraisse (2009) |
12 | 68 | IF n_elements(XMAX) EQ 0 THEN xmax = 1.82 |
13 | 69 | IF n_elements(pMAX) EQ 0 THEN pmax = 0.03 |
... | ... | @@ -18,5 +74,8 @@ FUNCTION DUSTEM_SERKOWSKI, x, ka=ka, xmax=xmax, pmax=pmax |
18 | 74 | ix = WHERE( x LE x0, cx ) |
19 | 75 | IF cx GT 0 THEN yy(ix) = y0 * (x(ix)/x0)^1.7 |
20 | 76 | |
77 | + | |
78 | +the_end: | |
21 | 79 | RETURN, yy |
80 | + | |
22 | 81 | END | ... | ... |
src/idl/dustem_set_data.pro
... | ... | @@ -13,6 +13,7 @@ PRO dustem_set_data,m_fit=m_fit $ |
13 | 13 | ; PURPOSE: |
14 | 14 | ; Set the *!dustem data (and *!dustem_show) datasets in emission and/or extinction from input data structures |
15 | 15 | ; *!dustem_data is important for the fitting of data and its general handling by DustEMWrap. |
16 | +; | |
16 | 17 | ; CATEGORY: |
17 | 18 | ; DustEMWrap, Mid-Level, Distributed, Initialization |
18 | 19 | ; | ... | ... |
src/idl/dustem_set_params.pro
1 | -PRO dustem_set_params,params | |
1 | +PRO dustem_set_params,params,help=help | |
2 | + | |
3 | +;+ | |
4 | +; NAME: | |
5 | +; dustem_set_params | |
6 | +; | |
7 | +; PURPOSE: | |
8 | +; Initialise the *!dustem_fit system variable with the free | |
9 | +; parameters used in the fit and their general handling by DustEMWrap. | |
10 | +; | |
11 | +; CATEGORY: | |
12 | +; DustEMWrap, Mid-Level, Distributed, Initialization | |
13 | +; | |
14 | +; CALLING SEQUENCE: | |
15 | +; dustem_set_params,params[,/help] | |
16 | +; | |
17 | +; INPUTS: | |
18 | +; params -- free parameters to be used in the fit | |
19 | +; | |
20 | +; OPTIONAL INPUT PARAMETERS: | |
21 | +; | |
22 | +; OUTPUTS: | |
23 | +; None | |
24 | +; | |
25 | +; OPTIONAL OUTPUT PARAMETERS: | |
26 | +; None | |
27 | +; | |
28 | +; ACCEPTED KEY-WORDS: | |
29 | +; help = If set print this help | |
30 | +; | |
31 | +; COMMON BLOCKS: | |
32 | +; None | |
33 | +; | |
34 | +; SIDE EFFECTS: | |
35 | +; initializes information in !dustem_fit | |
36 | +; | |
37 | +; RESTRICTIONS: | |
38 | +; The DustEMWrap IDL code must be installed | |
39 | +; | |
40 | +; PROCEDURE: | |
41 | +; None | |
42 | +; | |
43 | +; EXAMPLES | |
44 | +; | |
45 | +; MODIFICATION HISTORY: | |
46 | +; Written by J.-Ph. Bernard 2007 | |
47 | +; Evolution details on the DustEMWrap gitlab. | |
48 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
49 | +;- | |
50 | + | |
51 | +IF keyword_set(help) THEN BEGIN | |
52 | + doc_library,'dustem_set_params' | |
53 | + goto,the_end | |
54 | +ENDIF | |
2 | 55 | |
3 | 56 | ;if empty description, do nothing |
4 | 57 | ind=where(*(*!dustem_fit).param_descs EQ '',count) | ... | ... |
src/idl/dustem_stellarpopisrf_example.pro