Blame view

src/idl/dustem_init_fixed_params.pro 1.24 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

;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
11
12
13
14
15
16
17
18
19
20
21
22
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
23

3c479f24   Ilyes Choubani   Allowing to fix p...
24
;fixing the parameters
427f1205   Jean-Michel Glorian   version 4.2 merged
25
26
IF count NE 0 THEN BEGIN
  dustem_set_params,[fiv]
427f1205   Jean-Michel Glorian   version 4.2 merged
27
28
ENDIF

0e608856   Jean-Philippe Bernard   improved
29
;set the fixed system variables, used to keep memory of the fixed
427f1205   Jean-Michel Glorian   version 4.2 merged
30
31
32
33
;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
34
;put back in place fit parameter descriptions and values into system variables, if needed.
427f1205   Jean-Michel Glorian   version 4.2 merged
35
36
37
38
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
39
40
41
ENDIF 


427f1205   Jean-Michel Glorian   version 4.2 merged
42
END