Blame view

src/idl/dustem_init_fixed_params.pro 1.49 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
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)
607060e5   Ilyes Choubani   test version
25
26


427f1205   Jean-Michel Glorian   version 4.2 merged
27
28
IF count NE 0 THEN BEGIN
  dustem_set_params,[fiv]
452c334e   Ilyes Choubani   Implementation Of...
29
  ;dustem_create_functions,[fiv]/(*(*!dustem_fit).param_init_values)
607060e5   Ilyes Choubani   test version
30
  ;dustem_init_plugins,fpd
452c334e   Ilyes Choubani   Implementation Of...
31
  dustem_activate_plugins,[fiv]/(*(*!dustem_fit).param_init_values)
607060e5   Ilyes Choubani   test version
32
  ;dustem_set_params,[fiv]
427f1205   Jean-Michel Glorian   version 4.2 merged
33
34
ENDIF

607060e5   Ilyes Choubani   test version
35

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

607060e5   Ilyes Choubani   test version
41

0e608856   Jean-Philippe Bernard   improved
42
;put back in place fit parameter descriptions and values into system variables, if needed.
427f1205   Jean-Michel Glorian   version 4.2 merged
43
44
45
46
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)
607060e5   Ilyes Choubani   test version
47
48
49
50
ENDIF 



427f1205   Jean-Michel Glorian   version 4.2 merged
51
52

END