Commit 502f6450266baf21bcfb131c3d5a085fab4f8e09

Authored by Ilyes Choubani
2 parents 3f93c873 71e7375d
Exists in master

Merge branch 'master' of https://gitlab.irap.omp.eu/OV-GSO-DC/dustem-wrapper_idl

src/idl/dustem_read_fits_table.pro
@@ -3,29 +3,42 @@ PRO dustem_read_fits_table,filename=filename,help=help,dustem_spectra_st=dustem_ @@ -3,29 +3,42 @@ PRO dustem_read_fits_table,filename=filename,help=help,dustem_spectra_st=dustem_
3 ;+ 3 ;+
4 ; NAME: 4 ; NAME:
5 ; dustem_read_fits_table 5 ; dustem_read_fits_table
  6 +;
6 ; PURPOSE: 7 ; PURPOSE:
7 ; Reads a Dustem fits table into current DustEMWrap system variables 8 ; Reads a Dustem fits table into current DustEMWrap system variables
  9 +;
8 ; CATEGORY: 10 ; CATEGORY:
9 ; DustEMWrap, High-Level, Distributed, User convenience 11 ; DustEMWrap, High-Level, Distributed, User convenience
  12 +;
10 ; CALLING SEQUENCE: 13 ; CALLING SEQUENCE:
11 ; dustem_read_fits_table[,filename=][,/help] 14 ; dustem_read_fits_table[,filename=][,/help]
  15 +;
12 ; INPUTS: 16 ; INPUTS:
  17 +;
13 ; OPTIONAL INPUT PARAMETERS: 18 ; OPTIONAL INPUT PARAMETERS:
14 ; filename = File name to be read (default='./dustemwrap_results.fits') 19 ; filename = File name to be read (default='./dustemwrap_results.fits')
  20 +;
15 ; OUTPUTS: 21 ; OUTPUTS:
16 ; None 22 ; None
  23 +;
17 ; OPTIONAL OUTPUT PARAMETERS: 24 ; OPTIONAL OUTPUT PARAMETERS:
18 ; dustem_spectra_st = emission and extinction spectra (total and for each grain type) 25 ; dustem_spectra_st = emission and extinction spectra (total and for each grain type)
  26 +;
19 ; ACCEPTED KEY-WORDS: 27 ; ACCEPTED KEY-WORDS:
20 ; help = If set, print this help 28 ; help = If set, print this help
  29 +;
21 ; COMMON BLOCKS: 30 ; COMMON BLOCKS:
22 ; None 31 ; None
  32 +;
23 ; SIDE EFFECTS: 33 ; SIDE EFFECTS:
24 ; DustEMWrap system variables are set 34 ; DustEMWrap system variables are set
  35 +;
25 ; RESTRICTIONS: 36 ; RESTRICTIONS:
26 ; The DustEMWrap IDL code must be installed 37 ; The DustEMWrap IDL code must be installed
  38 +;
27 ; PROCEDURE: 39 ; PROCEDURE:
28 ; None 40 ; None
  41 +;
29 ; EXAMPLES 42 ; EXAMPLES
30 ; 43 ;
31 ; MODIFICATION HISTORY: 44 ; MODIFICATION HISTORY:
src/idl/dustem_write_fits_table.pro
@@ -3,30 +3,43 @@ PRO dustem_write_fits_table,filename=filename,help=help @@ -3,30 +3,43 @@ PRO dustem_write_fits_table,filename=filename,help=help
3 ;+ 3 ;+
4 ; NAME: 4 ; NAME:
5 ; dustem_write_fits_table 5 ; dustem_write_fits_table
  6 +;
6 ; PURPOSE: 7 ; PURPOSE:
7 ; Write a FITS table with content of current DustEMWrap system variables 8 ; Write a FITS table with content of current DustEMWrap system variables
  9 +;
8 ; CATEGORY: 10 ; CATEGORY:
9 ; DustEMWrap, Distributed, High-Level, User Convenience 11 ; DustEMWrap, Distributed, High-Level, User Convenience
  12 +;
10 ; CALLING SEQUENCE: 13 ; CALLING SEQUENCE:
11 ; dustem_write_fits_table,file[,/help] 14 ; dustem_write_fits_table,file[,/help]
  15 +;
12 ; INPUTS: 16 ; INPUTS:
13 ; file = File name to be written (default='./dustemwrap_results.fits') 17 ; file = File name to be written (default='./dustemwrap_results.fits')
  18 +;
14 ; OPTIONAL INPUT PARAMETERS: 19 ; OPTIONAL INPUT PARAMETERS:
15 ; None 20 ; None
  21 +;
16 ; OUTPUTS: 22 ; OUTPUTS:
17 ; None 23 ; None
  24 +;
18 ; OPTIONAL OUTPUT PARAMETERS: 25 ; OPTIONAL OUTPUT PARAMETERS:
19 ; None 26 ; None
  27 +;
20 ; ACCEPTED KEY-WORDS: 28 ; ACCEPTED KEY-WORDS:
21 ; help = If set, print this help 29 ; help = If set, print this help
  30 +;
22 ; COMMON BLOCKS: 31 ; COMMON BLOCKS:
23 ; None 32 ; None
  33 +;
24 ; SIDE EFFECTS: 34 ; SIDE EFFECTS:
25 ; Output FITS file is written to disk. 35 ; Output FITS file is written to disk.
  36 +;
26 ; RESTRICTIONS: 37 ; RESTRICTIONS:
27 ; The DustEMWrap IDL code must be installed 38 ; The DustEMWrap IDL code must be installed
  39 +;
28 ; PROCEDURE: 40 ; PROCEDURE:
29 ; None 41 ; None
  42 +;
30 ; EXAMPLES 43 ; EXAMPLES
31 ; 44 ;
32 ; MODIFICATION HISTORY: 45 ; MODIFICATION HISTORY:
@@ -43,14 +56,15 @@ ENDIF @@ -43,14 +56,15 @@ ENDIF
43 56
44 ;===== run dustem to get predicted spectrum and sed 57 ;===== run dustem to get predicted spectrum and sed
45 dustem_predicted_sed=dustem_compute_sed(*(*!dustem_fit).current_param_values,out_st=dustem_spectra_st) 58 dustem_predicted_sed=dustem_compute_sed(*(*!dustem_fit).current_param_values,out_st=dustem_spectra_st)
46 -;stop 59 +
47 IF !run_pol THEN BEGIN 60 IF !run_pol THEN BEGIN
48 ;This is needed to compute Q,U of both SED and spectra 61 ;This is needed to compute Q,U of both SED and spectra
49 - dustem_predicted_polsed=dustem_compute_stokes(*(*!dustem_fit).current_param_values,bidon, $  
50 - dustem_predicted_Qsed,dustem_predicted_Used, $  
51 - dustem_predicted_Q_spec,dustem_predicted_U_spec,dustem_predicted_PSI_spec, $  
52 - dustem_psi_em,out_st=out_st)  
53 - ;Same in extinction, but does not work in polarization extinction was not fitted. 62 + dustem_predicted_polsed=dustem_compute_stokes(*(*!dustem_fit).current_param_values,bidon, $
  63 + dustem_predicted_Qsed,dustem_predicted_Used, $
  64 + dustem_predicted_Q_spec,dustem_predicted_U_spec,dustem_predicted_PSI_spec, $
  65 + dustem_psi_em,out_st=out_st)
  66 +
  67 +;Same in extinction, but does not work in polarization extinction was not fitted.
54 ; dustem_predicted_polext=dustem_compute_stokext(*(*!dustem_fit).current_param_values,bidon, $ 68 ; dustem_predicted_polext=dustem_compute_stokext(*(*!dustem_fit).current_param_values,bidon, $
55 ; dustem_predicted_Qext,dustem_predicted_Uext, $ 69 ; dustem_predicted_Qext,dustem_predicted_Uext, $
56 ; dustem_predicted_Qext_spec,dustem_predicted_Uext_spec,dustem_predicted_PSI_ext, $ 70 ; dustem_predicted_Qext_spec,dustem_predicted_Uext_spec,dustem_predicted_PSI_ext, $
@@ -80,7 +94,7 @@ str_predicted_EXT=replicate(one_str_predicted_SED,N_predicted_sed) @@ -80,7 +94,7 @@ str_predicted_EXT=replicate(one_str_predicted_SED,N_predicted_sed)
80 fully_undefined_sed=str_predicted_SED 94 fully_undefined_sed=str_predicted_SED
81 str_predicted_SED.FILTER=(*(*!dustem_data).sed).filt_names ;taken from input SED 95 str_predicted_SED.FILTER=(*(*!dustem_data).sed).filt_names ;taken from input SED
82 str_predicted_SED.Wavelength=(*(*!dustem_data).sed).wav ;taken from input SED 96 str_predicted_SED.Wavelength=(*(*!dustem_data).sed).wav ;taken from input SED
83 -str_predicted_SED.I=dustem_predicted_sed ;but where is Q,U ?? 97 +str_predicted_SED.I=dustem_predicted_sed
84 ;stop 98 ;stop
85 IF !run_pol THEN BEGIN 99 IF !run_pol THEN BEGIN
86 str_predicted_SED.Q=dustem_predicted_Qsed 100 str_predicted_SED.Q=dustem_predicted_Qsed
@@ -215,7 +229,7 @@ ENDFOR @@ -215,7 +229,7 @@ ENDFOR
215 sxaddpar,header_predicted_SED,'COMMENT','===================================================',after='PARF'+strtrim(i,2) 229 sxaddpar,header_predicted_SED,'COMMENT','===================================================',after='PARF'+strtrim(i,2)
216 230
217 ;===== complement extension header for predicted spectrum total 231 ;===== complement extension header for predicted spectrum total
218 -sxaddpar,header_predicted_spectrum_tot,'TITLE','OUTPUT BEST FIT TOTAL SPECTRUM BY DUSTEMWRAP' 232 +;sxaddpar,header_predicted_spectrum_tot,'TITLE','OUTPUT BEST FIT TOTAL SPECTRUM BY DUSTEMWRAP'
219 sxaddpar,header_predicted_spectra,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOTAL EMISSION SPECTRA BY DUSTEMWRAP' 233 sxaddpar,header_predicted_spectra,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOTAL EMISSION SPECTRA BY DUSTEMWRAP'
220 sxaddpar,header_predicted_extinctions,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOTAL EXTINCTION BY DUSTEMWRAP' 234 sxaddpar,header_predicted_extinctions,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOTAL EXTINCTION BY DUSTEMWRAP'
221 235