dustem_init_fixed_params.pro
3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
PRO dustem_init_fixed_params,fpd,fiv
;+
; NAME:
; dustem_init_fixed_params
;
; PURPOSE:
; This routine updates the fixed parameters of both the
; dust models and plugins in the input files
;
; CATEGORY:
; DustEMWrap, Distributed, Low-Level, Initialization
;
; CALLING SEQUENCE:
; dustem_init_params, pd, iv, [,fpd=fpd,fiv=fiv,ulimed=ulimed,llimed=llimed,ulims=ulims,lolims=llims,tied=tied,fixed=fixed]
;
; INPUTS:
; model -- the dust model
; pd -- the parameter description vector
; iv -- the initial values of the free parameters
;
; OPTIONAL INPUT PARAMETERS:
;
;
; OUTPUTS:
; None
;
; OPTIONAL OUTPUT PARAMETERS:
; None
;
; ACCEPTED KEY-WORDS:
; model = specifies the interstellar dust mixture used by DustEM
; 'MC10' model from Compiegne et al 2010 (default)
; 'DBP90' model from Desert et al 1990
; 'DL01' model from Draine & Li 2001
; 'WD01_RV5p5B' model from Weingartner & Draine 2002 with Rv=5.5
; 'DL07' model from Draine & Li 2007
; 'J13' model from Jones et al 2013, as updated in
; Koehler et al 2014
; 'G17_ModelA' model A from Guillet et al (2018). Includes
; polarisation. See Tables 2 and 3 of that paper for details.
; 'G17_ModelB' model B from Guillet et al (2018)
; 'G17_ModelC' model C from Guillet et al (2018)
; 'G17_ModelD' model A from Guillet et al (2018)
; help = if set, print this help
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; None
;
; RESTRICTIONS:
; The DustEM fortran code must be installed
; The DustEMWrap IDL code must be installed
;
; PROCEDURES AND SUBROUTINES USED:
; dustem_init_parinfo
; dustem_init_plugins
; dustem_init_fixed_params
;
; EXAMPLES
;
; MODIFICATION HISTORY:
; Written by AH October-2022
; 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_init_fixed_params'
goto,the_end
END
;Save the values of fit parameter descriptions and values
need_save=0
;This routine will use (*!dustem_fit).param_descs)
;Therefore, if the variable already exists, it's content is saved, and will be put back in place later
IF ptr_valid((*!dustem_fit).param_descs) THEN BEGIN
pd=*(*!dustem_fit).param_descs
iv=*(*!dustem_fit).param_init_values
;find=*(*!dustem_fit).param_func
need_save=1
ENDIF
;temporarily use the regular parameter system variables to update
(*!dustem_fit).param_descs=ptr_new(fpd)
(*!dustem_fit).param_init_values=ptr_new(fiv)
;Trimmed JPB on 08 March 2024
;dustem_set_func_ind,fpd,fiv
ind=where(fpd NE '',count)
;fixing the parameters
IF count NE 0 THEN BEGIN
dustem_set_params,[fiv]
ENDIF
;set the fixed system variables, used to keep memory of the fixed
;parameters description and values
(*!dustem_fit).fixed_param_descs=ptr_new(fpd)
(*!dustem_fit).fixed_param_init_values=ptr_new(fiv)
;put back in place fit parameter descriptions and values into system variables, if needed.
IF need_save EQ 1 THEN BEGIN
(*!dustem_fit).param_descs=ptr_new(pd)
(*!dustem_fit).param_init_values=ptr_new(iv)
;(*!dustem_fit).param_func=ptr_new(find)
ENDIF
the_end:
END