dustem_plugin_phangs_stellar_isrf.pro
4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
FUNCTION dustem_plugin_phangs_stellar_isrf,key=key $
,val=val $
,scope=scope $
,paramtag=paramtag $
,age_values=age_values $
,metalicity_values=metalicity_values $
,paramdefault=paramdefault $
; ,object_distance=object_distance $
; ,object_thickness=object_thickness $
,Voronoi_Npix=Voronoi_Npix $
,help=help
;+
; NAME:
; dustem_plugin_phangs_stellar_isrf
; PURPOSE:
; DustEMWrap plugin to compute ISRF from stellar template emission
; CATEGORY:
; DustEM, Distributed, Mid-Level, Plugin
; CALLING SEQUENCE:
; ISRF=dustem_plugin_phangs_stellar_isrf([,key=][,val=][,scope=][,paramtag=][paramdefault=][,/help])
; INPUTS:
; None
; OPTIONAL INPUT PARAMETERS:
; key = input parameter number
; First parameter: Amplitude factor for the emission
; Second parameter: E(B-V) for extinction to stars applied to the template, as used in Phangs
; Following 13*6 parameters are weights by which to multiply the MILES templates [Msun/pc^2]
; val = corresponding input parameter value
; object_distance = distance to the object in MPc (default = 1 Mpc)
; object_thickness = thickness of the object in kpc (default = 1 kpc)
; OUTPUTS:
; ISRF = stellar ISRF in omega*Inu [ergs/s/cm2/Hz] for omega = 1 sr
; OPTIONAL OUTPUT PARAMETERS:
; scope = if set, return the scope of the plugin
; paramdefault = default values of parameters
; paramtag = if set, return the return plugin parameter names as strings
; ACCEPTED KEY-WORDS:
; help = if set, print this help
; method = SSP used. can be EMILES or CB19. default='EMILES'
; COMMON BLOCKS:
; None
; SIDE EFFECTS:
; None
; RESTRICTIONS:
; The DustEMWrap IDL code must be installed
; PROCEDURE:
; This is a DustEMWrap plugin for phangs
; It differs from dustem_plugin_emiles_stellar_continuum.pro only by the way the extinction is applied to the output spectrum
; EXAMPLES
; dustem_init
; vec=dustem_plugin_phangs_stellar_continuum(scope=scope)
; MODIFICATION HISTORY:
; Written by JPB June 2023
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;-
IF keyword_set(help) THEN BEGIN
doc_library,'dustem_plugin_phangs_stellar_isrf'
ISRF=0.
goto,the_end
ENDIF
IF keyword_set(scope) THEN BEGIN
scope='REPLACE_ISRF'
out=0
goto,the_end
ENDIF
;==== define parameter tags
IF keyword_set(paramtag) THEN BEGIN
ISRF=dustem_plugin_phangs_stellar_continuum(paramtag=paramtag,paramdefault=paramdefault,voronoi_Npix=voronoi_Npix) ;This is Inu stars MJy/sr
ISRF=0
GOTO,the_end
ENDIF
;use_object_distance=1. ;MPc
;use_object_thickness=1. ;Pc
;IF keyword_set(object_distance) THEN use_object_distance=object_distance
;IF keyword_set(object_thickness) THEN use_object_thickness=object_thickness
;use_omega_ratio=((use_object_thickness/2.*1.e3)/(use_object_distance*1.e6))^2
;This factor is to go from Inu_stars in MJy/sr to 4*pi*Iisrf in ergs/s/cm2/Hz
;==== JPB: I think it should say *1.e-4, not *1.e4 and /use_omega_ratio, not *use_omega_ratio
;use_factor=4.*!pi*1.e-20*1.e7*1.e4*use_omega_ratio
;so,
;use_factor=4.*!pi*1.e-20*1.e7*1.e-4/use_omega_ratio
;but in fact we go to a distance equal to the size of the Voronoi bin, ie (indep. of omega_ration ....)
;use_factor=4.*!pi*1.e-20*1.e7*1.e-4
use_factor=1.e-20*1.e7*1.e-4 ;This is to go from MJy/sr to ergs/s/cm2/Hz/sr
;stop
Inu_stars=dustem_plugin_phangs_stellar_continuum(key=key,val=val,voronoi_Npix=voronoi_Npix) ;This is in MJy/sr
ISRF=Inu_stars[*,0]*use_factor
;REM: Inu_stars is on lambir wavelength. For an ISRF plugins, needs to to be interpolated on isrf wavelengths
spec_wavelengths=dustem_get_wavelengths(isrf_wavelengths=isrf_wavelengths)
ISRF=interpol(ISRF,spec_wavelengths,isrf_wavelengths)
the_end:
RETURN,ISRF
END