Blame view

src/idl/dustem_write_isrf_lv.pro 1.57 KB
389a2b1d   Jean-Philippe Bernard   improved
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
PRO dustem_write_isrf_lv,file,st,help=help

;+
; NAME:
;    dustem_write_isrf_lv
; PURPOSE:
;    Writes file ISRF.DAT used by DustemWrapper
; CATEGORY:
;    Dustem
; CALLING SEQUENCE:
;    dustem_write_isrf_lv,file,st[,/help]
; INPUTS:
;    file : file name 
;    st   : input ISRF structure
; OPTIONAL INPUT PARAMETERS:
;    None
; OUTPUTS:
;    None
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help      = If set print this help
4750086c   Ilyes Choubani   nouvelle philosph...
23
; COMMON BLOCKS: 
389a2b1d   Jean-Philippe Bernard   improved
24
25
26
27
28
29
30
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    The dustem fortran code must be installed
;    The dustem idl wrapper must be installed
; PROCEDURE:
4750086c   Ilyes Choubani   nouvelle philosph...
31
;    a Stellar ISRF is added based on the content of (*(*!dustem_plugin).stellar_population)
389a2b1d   Jean-Philippe Bernard   improved
32
33
34
;-

IF keyword_set(help) THEN BEGIN
4750086c   Ilyes Choubani   nouvelle philosph...
35
  doc_library,'dustem_write_isrf_lv'
389a2b1d   Jean-Philippe Bernard   improved
36
37
38
  goto,the_end
ENDIF

427f1205   Jean-Michel Glorian   version 4.2 merged
39

759a527d   Ilyes Choubani   general update
40
IF tag_exist(*!dustem_plugin,'STELLAR_POPULATION') THEN BEGIN
8bab7d4b   Ilyes Choubani   small corrections...
41
    IF isa((*!dustem_plugin).stellar_population.spec) THEN goto, the_end
759a527d   Ilyes Choubani   general update
42
ENDIF
19e26da9   Ilyes Choubani   corrected stellar...
43

19e26da9   Ilyes Choubani   corrected stellar...
44

8bab7d4b   Ilyes Choubani   small corrections...
45
;MODIFY THIS TO DISPLAY THE ACTUAL VALUES BECAUSE IT IS JUST DISPLAYING EMPTY STRINGS AT THE MOMENT
19e26da9   Ilyes Choubani   corrected stellar...
46
47
48
Ncomments=6
c=strarr(Ncomments)

19e26da9   Ilyes Choubani   corrected stellar...
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

;First lines of the ISRF.DAT file
c(0)='# DUSTEM: exciting radiation field featuring'
c(1)='# Mathis ISRF'
c(2)='# Blackbody with     T=   0.0000E+00'
c(3)='# dilution factor wdil=   1.0000E+00'
c(4)='# Nbr of points'
c(5)='# wave (microns), 4*pi*Inu (erg/cm2/s/Hz)'

openw,unit,file,/get_lun

FOR i=0,Ncomments-1 DO BEGIN
    printf,unit,c(i)
ENDFOR

n_waves=n_elements(st)
printf,unit,n_waves

FOR i=0L,n_waves-1 DO BEGIN
    printf,unit,st(i).lambisrf,st(i).isrf
ENDFOR

close,unit
free_lun,unit

the_end:
389a2b1d   Jean-Philippe Bernard   improved
75

427f1205   Jean-Michel Glorian   version 4.2 merged
76
77

END