From be6b622d3ce194ccf066acadd212ce4ed4622641 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernard Date: Fri, 8 Mar 2024 11:35:16 +0100 Subject: [PATCH] Trimmed unused code, including param_func, run_ion_frac, ... --- src/idl/dustem_activate_plugins.pro | 25 +++++++++++++++++-------- src/idl/dustem_create_ionfrac.pro | 7 +++++-- src/idl/dustem_init.pro | 7 +++++-- src/idl/dustem_init_fixed_params.pro | 7 ++++--- src/idl/dustem_init_parinfo.pro | 5 +++-- src/idl/dustem_mpfit_run.pro | 3 ++- src/idl/dustem_set_func_ind.pro | 5 +++++ src/idl/dustem_set_params.pro | 3 ++- 8 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/idl/dustem_activate_plugins.pro b/src/idl/dustem_activate_plugins.pro index c16600c..99ee515 100755 --- a/src/idl/dustem_activate_plugins.pro +++ b/src/idl/dustem_activate_plugins.pro @@ -67,13 +67,17 @@ IF isa((*!dustem_fit).fixed_param_descs) THEN BEGIN param_values = param_values[sort(param_descs)] ;should we put it back to the way it was? param_descs = param_descs[sort(param_descs)] ;Taking care of the param_func vector (not sure if this is of any use anymore) - dustem_set_func_ind, param_descs, param_values ; this sets (*(*!dustem_fit).param_func) - param_func = (*(*!dustem_fit).param_func) - dustem_set_func_ind, (*(*!dustem_fit).param_descs), p_dim ;setting the pointers back to their original valyes + ;Trimmed JPB on 08 March 2024 + ;dustem_set_func_ind, param_descs, param_values ; this sets (*(*!dustem_fit).param_func) + ;param_func = (*(*!dustem_fit).param_func) + ;param_func =0 ;not used anyway later in dustem_run_plugins + ;Trimmed JPB on 08 March 2024 + ;dustem_set_func_ind, (*(*!dustem_fit).param_descs), p_dim ;setting the pointers back to their original valyes ENDIF ELSE BEGIN param_descs = (*(*!dustem_fit).param_descs) param_values = p_dim - param_func = (*(*!dustem_fit).param_func) + ;param_func = (*(*!dustem_fit).param_func) + ;param_func=0 ;not used anyway later in dustem_run_plugins ENDELSE ;stop @@ -88,17 +92,22 @@ ENDELSE ;using '**' so not to write the entire scope ;=== This runs the plugins +;JPB: Removed allusion to param_func not used in dustem_run_plugins.pro (08 March 2024) ;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['ADD_SED'], avoid=1,use_previous_fortran=use_previous_fortran -dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 1, avoid=1,use_previous_fortran=use_previous_fortran +;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 1, avoid=1,use_previous_fortran=use_previous_fortran +dustem_run_plugins, p_dim ,param_descs, param_values, 1, avoid=1,use_previous_fortran=use_previous_fortran ;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['ADD_ISRF','REPLACE_ISRF'] ,force_dustem_run=1,st=st,use_previous_fortran=use_previous_fortran ;dustem output is available at this step. -dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 2,force_dustem_run=1,st=st,use_previous_fortran=use_previous_fortran ;dustem output is available at this step. +;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 2,force_dustem_run=1,st=st,use_previous_fortran=use_previous_fortran ;dustem output is available at this step. +dustem_run_plugins, p_dim ,param_descs, param_values, 2,force_dustem_run=1,st=st,use_previous_fortran=use_previous_fortran ;dustem output is available at this step. ;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['REPLACE_SED'],use_previous_fortran=use_previous_fortran -dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 3,use_previous_fortran=use_previous_fortran +;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 3,use_previous_fortran=use_previous_fortran +dustem_run_plugins, p_dim ,param_descs, param_values, 3,use_previous_fortran=use_previous_fortran ;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['REPLACE_SED'],use_previous_fortran=use_previous_fortran -dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 4,use_previous_fortran=use_previous_fortran +;dustem_run_plugins, p_dim ,param_descs, param_values, param_func, 4,use_previous_fortran=use_previous_fortran +dustem_run_plugins, p_dim ,param_descs, param_values, 4,use_previous_fortran=use_previous_fortran the_end: diff --git a/src/idl/dustem_create_ionfrac.pro b/src/idl/dustem_create_ionfrac.pro index a4765b0..2083e98 100755 --- a/src/idl/dustem_create_ionfrac.pro +++ b/src/idl/dustem_create_ionfrac.pro @@ -52,7 +52,10 @@ function dustem_create_ionfrac, key=key, val=val,help=help goto, the_end end - +message,'Obsolete. Should not be run',/continue +stop +GOTO,the_end + ;PURPOSE : ;-------- ; pour une Température et une densité donnée @@ -271,6 +274,6 @@ function dustem_create_ionfrac, key=key, val=val,help=help endif the_end: - return,0 +RETURN,0 end diff --git a/src/idl/dustem_init.pro b/src/idl/dustem_init.pro index c0d94ee..399a440 100644 --- a/src/idl/dustem_init.pro +++ b/src/idl/dustem_init.pro @@ -171,7 +171,9 @@ defsysv, '!dustem_iter', {prv:1,act:1} ;define !dustem_fit dustem_fit_st={data:ptr_new(), $ ;,wavelength:ptr_new(), ;because wavelength arrays in the different datasets (data) can be different - param_descs:ptr_new(),param_init_values:ptr_new(),param_func:ptr_new(), $ + param_descs:ptr_new(), $ + param_init_values:ptr_new(), $ + ;param_func:ptr_new(), $ ;Should be Trimmed (JPB) not used anymore fixed_param_descs:ptr_new(),fixed_param_init_values:ptr_new(), $ chi2:0.D0,rchi2:0.D0, $ qchi2:0.D0,qrchi2:0.D0, $ @@ -301,7 +303,8 @@ defsysv, '!dustem_params', ptr_new() ;Contains the values of all Desert Model pa ;The following is not used in the RELEASE version of the code, only in VERSTRAETE ;IF getenv('DUSTEM_WHICH') EQ 'VERSTRAETE' THEN BEGIN - defsysv, '!run_ionfrac', 0. ; 0:no call to dustem_create_ionfrac UNLESS it is called as a param +;JPB:Trimmed on March 08 2024 +;defsysv, '!run_ionfrac', 0. ; 0:no call to dustem_create_ionfrac UNLESS it is called as a param ; 1:call to dustem_create_ionfrac with the MIX_xxx.DAT files ; 2:call to dustem_create_ionfrac with the SIZE_xxx.DAT files ;ENDIF diff --git a/src/idl/dustem_init_fixed_params.pro b/src/idl/dustem_init_fixed_params.pro index 1048a39..334b607 100755 --- a/src/idl/dustem_init_fixed_params.pro +++ b/src/idl/dustem_init_fixed_params.pro @@ -80,14 +80,15 @@ need_save=0 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 + ;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 +;Trimmed JPB on 08 March 2024 +;dustem_set_func_ind,fpd,fiv ind=where(fpd NE '',count) ;fixing the parameters @@ -104,7 +105,7 @@ ENDIF 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) + ;(*!dustem_fit).param_func=ptr_new(find) ENDIF the_end: diff --git a/src/idl/dustem_init_parinfo.pro b/src/idl/dustem_init_parinfo.pro index 6df089e..eeec50c 100755 --- a/src/idl/dustem_init_parinfo.pro +++ b/src/idl/dustem_init_parinfo.pro @@ -54,9 +54,10 @@ END (*!dustem_fit).param_init_values=ptr_new(iv) (*!dustem_fit).current_param_values = ptr_new(iv/iv) ;These are normalized to the initial values -;stop -dustem_set_func_ind,pd,iv +;stop +;JPB: cutting this which is not used anymore (March 8 2024) +;dustem_set_func_ind,pd,iv one_parinfo={value:0.D0, fixed:0, limited:[0,0], limits:[0.D0,0], parname:'', relstep:0., step:0.0, mpside:0, tied:''} Npar=n_elements(pd) diff --git a/src/idl/dustem_mpfit_run.pro b/src/idl/dustem_mpfit_run.pro index e4656d2..3481095 100755 --- a/src/idl/dustem_mpfit_run.pro +++ b/src/idl/dustem_mpfit_run.pro @@ -62,7 +62,8 @@ ENDIF p_dim=p_min*(*(*!dustem_fit).param_init_values) -IF !run_ionfrac gt 0. THEN toto = dustem_create_ionfrac() +;Trimmed JPB on 08 March 2024 +;IF !run_ionfrac gt 0. THEN toto = dustem_create_ionfrac() ;RUN THE MODEL AND GET THE SPECTRUM diff --git a/src/idl/dustem_set_func_ind.pro b/src/idl/dustem_set_func_ind.pro index 3f400c5..52bd76e 100755 --- a/src/idl/dustem_set_func_ind.pro +++ b/src/idl/dustem_set_func_ind.pro @@ -32,6 +32,9 @@ PRO dustem_set_func_ind,pd,iv ; Written by NF,JPB,DP Jan-2007 ;- +message,'Obsolete. Should not be run',/continue +stop +GOTO,the_end ;nparam = n_elements(*(*!dustem_fit).param_descs) @@ -129,4 +132,6 @@ FOR i=0L,nparam-1 DO BEGIN ENDIF ENDFOR +the_end: + END \ No newline at end of file diff --git a/src/idl/dustem_set_params.pro b/src/idl/dustem_set_params.pro index add3b24..dbba230 100755 --- a/src/idl/dustem_set_params.pro +++ b/src/idl/dustem_set_params.pro @@ -63,7 +63,8 @@ ENDIF Nparams=n_elements(*(*!dustem_fit).param_descs) -dustem_set_func_ind,*(*!dustem_fit).param_descs,params +;Trimmed JPB on 08 March 2024 +;dustem_set_func_ind,*(*!dustem_fit).param_descs,params ;SET THE PARAMETER VALUES IN DUSTEM INPUT FILES FOR i=0L,Nparams-1 DO BEGIN -- libgit2 0.21.2