dustem_read_ionfrac.pro 1.26 KB
FUNCTION dustem_read_ionfrac,file,silent=silent,help=help

;+
; NAME:
;   dustem_read_ionfrac
;
; PURPOSE:
;   reads information for the fractions of neutral, positive, negative PAHs
;   from the corresponding .DAT file
;
; CATEGORY:
;    DustEMWrap, Distributed, LowLevel, Initialization
;
; CALLING SEQUENCE:
;   st=dustem_read_ionfrac(file)
;
; INPUTS:
;    file  : output file to be read
;
; OPTIONAL INPUT PARAMETERS:
;    None
;
; OUTPUTS:
;    st   : dustem data structure
;
; OPTIONAL OUTPUT PARAMETERS:
;    None
;
; ACCEPTED KEY-WORDS:
;    help     : writes this help
;
; COMMON BLOCKS:
;    None
;
; SIDE EFFECTS:
;
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
;
; PROCEDURES AND SUBROUTINES USED:  
;
; EXAMPLES:
;
; MODIFICATION HISTORY:
;    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_read_ionfrac'
   st=0.
   goto,the_end
ENDIF

  
readcol,file,frac_cat, frac_neu, frac_ani,silent=silent
nlines=n_elements(frac_cat)

one_st={frac_cat:0., frac_neu:0., frac_ani:0.}
st=replicate(one_st,Nlines)

st.frac_cat = frac_cat
st.frac_neu = frac_neu
st.frac_ani = frac_ani

the_end:
return,st

END