From 6baf9f1f3ea0166c06463ed5f1946cd3af9c729a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernard Date: Sun, 11 Feb 2024 09:26:22 +0100 Subject: [PATCH] fixed a few issues with plugin --- src/idl/dustem_get_wavelengths.pro | 3 ++- src/idl/dustem_nir_continuum.pro | 3 ++- src/idl/dustem_plugin_continuum.pro | 20 ++++++++++++-------- src/idl/dustem_plugin_modify_isrf.pro | 12 +++--------- src/idl/dustem_plugin_stellar_population.pro | 1 + src/idl/dustem_stellarpopisrf_example.pro | 4 ++-- src/idl/dustem_write_isrf_release.pro | 10 +++++----- 7 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/idl/dustem_get_wavelengths.pro b/src/idl/dustem_get_wavelengths.pro index 27a2c65..d92b7e4 100644 --- a/src/idl/dustem_get_wavelengths.pro +++ b/src/idl/dustem_get_wavelengths.pro @@ -64,6 +64,7 @@ ENDELSE isrf_wavelengths=(*!dustem_params).ISRF.lambisrf the_end: -RETURN,lambir[1:*] +;RETURN,lambir[1:*] +RETURN,lambir END diff --git a/src/idl/dustem_nir_continuum.pro b/src/idl/dustem_nir_continuum.pro index df94c8f..ea3c11d 100755 --- a/src/idl/dustem_nir_continuum.pro +++ b/src/idl/dustem_nir_continuum.pro @@ -40,7 +40,8 @@ IF keyword_set(help) THEN BEGIN goto,the_end ENDIF -;stop +message,'This is deprecated. Use dustem_plugin_continuum.pro',/continue +stop ;default values of input parameters temp=1000. diff --git a/src/idl/dustem_plugin_continuum.pro b/src/idl/dustem_plugin_continuum.pro index b924772..d76f5c6 100755 --- a/src/idl/dustem_plugin_continuum.pro +++ b/src/idl/dustem_plugin_continuum.pro @@ -44,12 +44,22 @@ IF keyword_set(help) THEN BEGIN goto,the_end ENDIF +IF keyword_set(scope) THEN BEGIN + scope='ADD_SED' + output=0 + goto, the_end +ENDIF + +IF keyword_set(paramtag) THEN BEGIN + paramtag=[textoidl('T_{BB}')+' [K]','Amp'] + output=0 + goto, the_end +ENDIF + ;default values of input parameters temp=1000. ampl=1.d-2 -scope='ADD_SED' -paramtag=[textoidl('T_{BB}')+' [K]','Amp'] paramdefault=[temp,ampl] IF keyword_set(key) THEN BEGIN @@ -61,12 +71,6 @@ IF keyword_set(key) THEN BEGIN ENDIF -; IF !dustem_which EQ 'DESERT' THEN BEGIN -; lambir=((*!dustem_params).gemissiv.lambir) -; ENDIF ELSE BEGIN -; lambir=((*!dustem_params).lambda.lambda) -; ENDELSE - lambir=dustem_get_wavelengths() ;=== normalize spectrum to the requested amplitude. diff --git a/src/idl/dustem_plugin_modify_isrf.pro b/src/idl/dustem_plugin_modify_isrf.pro index ad1fcc4..20384e5 100644 --- a/src/idl/dustem_plugin_modify_isrf.pro +++ b/src/idl/dustem_plugin_modify_isrf.pro @@ -56,12 +56,14 @@ IF keyword_set(help) THEN BEGIN goto,the_end ENDIF -IF keyword_set(scope) THEN BEGIN +IF keyword_set(scope) THEN BEGIN + scope='REPLACE_ISRF' out=0 goto, the_end ENDIF IF keyword_set(paramtag) THEN BEGIN + paramtag=['Amplitude'] out=0 goto, the_end ENDIF @@ -79,15 +81,7 @@ IF isa(!dustem_isrf_file) THEN user_ISRF = dustem_read_isrf(*!dustem_isrf_file) out=amp*User_ISRF.isrf -;print,amp -;stop - the_end: -;scope='USER_ISRF' -scope='REPLACE_ISRF' - -;paramtag will only matter if G0 is fitted through the plugin. -paramtag=['Amplitude'] RETURN, out END diff --git a/src/idl/dustem_plugin_stellar_population.pro b/src/idl/dustem_plugin_stellar_population.pro index 680ee3c..d27e125 100644 --- a/src/idl/dustem_plugin_stellar_population.pro +++ b/src/idl/dustem_plugin_stellar_population.pro @@ -124,6 +124,7 @@ IF keyword_set(key) THEN BEGIN ;pass output into ergs/cm2/s/Hz fact=1./1.e20*1.e7/1.e4 stellar_isrf=stellar_isrf*fact ;ergs/cm2/s/Hz + stellar_isrf=stellar_isrf/(*!dustem_params).G0 ENDIF ;stop diff --git a/src/idl/dustem_stellarpopisrf_example.pro b/src/idl/dustem_stellarpopisrf_example.pro index f9abb0d..b4603a4 100644 --- a/src/idl/dustem_stellarpopisrf_example.pro +++ b/src/idl/dustem_stellarpopisrf_example.pro @@ -135,8 +135,8 @@ iv = true_vals+[1.] ; distance we use as an initial guess fpd=['dustem_plugin_stellar_population_'+strtrim(ind2+1,2) , $ ;number of O7V star (FIXED) '(*!dustem_params).G0'] ; Mathis field (FIXED TO ~ZERO) -;fiv=[1.,1.e-12] -fiv=[1.,1.] +fiv=[1.,1.e-12] +;fiv=[1.,1.] Npar=n_elements(pd) ulimed=replicate(0,Npar) & ulimed[0]=0 diff --git a/src/idl/dustem_write_isrf_release.pro b/src/idl/dustem_write_isrf_release.pro index 9b790e4..f895e6c 100755 --- a/src/idl/dustem_write_isrf_release.pro +++ b/src/idl/dustem_write_isrf_release.pro @@ -59,6 +59,11 @@ ENDIF ;IF PLUGINS AREN'T SET. WRITE THE DEFAULT DUSTEM ISRF.DAT FILE Nplugins=n_elements(*!dustem_plugin) scopes = strarr(Nplugins) +Ncomments=3 ;default number of comments in the .DAT file (minus the ISRF used) +c=strarr(Ncomments) +c[*]='#' +c[0]='# DUSTEM_WRAP: Interstellar radiation field ' + IF (*!dustem_plugin)[0].name EQ 'NONE' THEN GOTO,write_isrf_file ;IF PLUGINS ARE SET, LOOP OVER THEIR SCOPES. @@ -69,11 +74,6 @@ FOR i=0L, Nplugins-1 DO BEGIN ;ENDIF ELSE goto, the_after ENDFOR -Ncomments=3 ;default number of comments in the .DAT file (minus the ISRF used) -c=strarr(Ncomments) -c[*]='#' -c[0]='# DUSTEM_WRAP: Interstellar radiation field ' - ;Testing for the two current ISRF plugin scopes ind_replace_isrf = where(scopes EQ 'REPLACE_ISRF',count_replace_isrf) ind_add_isrf = where(scopes EQ 'ADD_ISRF',count_add_isrf) -- libgit2 0.21.2