Blame view

src/idl/dustem_init_fixed_params.pro 1.45 KB
0e608856   Jean-Philippe Bernard   improved
1
PRO dustem_init_fixed_params,fpd,fiv
427f1205   Jean-Michel Glorian   version 4.2 merged
2
3
4
5
6
7

;This routine is used to update the model input files with fixed
;parameters

;Save the values of fit parameter descriptions and values
need_save=0
0e608856   Jean-Philippe Bernard   improved
8
9
10
11
12
;stop
;toto=dustem_parameter_description2type(fpd[0],string_name=string_name)

;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
427f1205   Jean-Michel Glorian   version 4.2 merged
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)
dustem_set_func_ind,fpd,fiv
ind=where(fpd NE '',count)
IF count NE 0 THEN BEGIN
  dustem_set_params,[fiv]
452c334e   Ilyes Choubani   Implementation Of...
27
28
  ;dustem_create_functions,[fiv]/(*(*!dustem_fit).param_init_values)
  dustem_activate_plugins,[fiv]/(*(*!dustem_fit).param_init_values)
427f1205   Jean-Michel Glorian   version 4.2 merged
29
30
31
  dustem_set_params,[fiv]
ENDIF

0e608856   Jean-Philippe Bernard   improved
32
;set the fixed system variables, used to keep memory of the fixed
427f1205   Jean-Michel Glorian   version 4.2 merged
33
34
35
36
;parameters description and values
(*!dustem_fit).fixed_param_descs=ptr_new(fpd)
(*!dustem_fit).fixed_param_init_values=ptr_new(fiv)

0e608856   Jean-Philippe Bernard   improved
37
;put back in place fit parameter descriptions and values into system variables, if needed.
427f1205   Jean-Michel Glorian   version 4.2 merged
38
39
40
41
42
43
44
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

END