dustem_show_file_dependencies.pro 2.32 KB
PRO dustem_show_file_dependencies,help=help

;== make a list of routines used by DustEMWrap
;+
; NAME:
;    dustem_show_file_dependencies
; PURPOSE:
;    Generate a list of routines called by DustEMWrap runs
; CATEGORY:
;    DustEMWrap, Distributed, Low-Level
; CALLING SEQUENCE:
;    dustem_show_file_dependencies[,help=help]
; INPUTS:
;    None
; OPTIONAL INPUT PARAMETERS:
;    None
; OUTPUTS:
; OPTIONAL OUTPUT PARAMETERS:
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
; PROCEDURES AND SUBROUTINES USED:
;    *** COMMENT AH --> is this really NONE? ****
; EXAMPLES
; MODIFICATION HISTORY:
;    Written by JPB Apr-2011
;    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_show_file_dependencies'
  goto,the_end
END

dustem_run_example
;dustem_fit_sed_readme
;dustem_run_readme
help,/function,output=ff
help,/pro,output=pp
   
ff=ff[1:*]
pp=pp[2:*]

nff=n_elements(ff)
npp=n_elements(pp)

one_func={name:'',path:'',args:ptr_new()}
one_pro={name:'',path:'',args:ptr_new()}

func_list=replicate(one_func,nff)
pro_list=replicate(one_pro,npp)

message,'Found '+string(nff)+' functions',/info

FOR i=0L,nff-1 DO BEGIN
  str=strcompress(ff(i))
  vv=str_sep(str,' ')
  func_list(i).name=vv(0)
  func_list(i).args=ptr_new(vv(1:*))
  wh=which_pro(strlowcase(func_list(i).name))
  func_list(i).path=wh(0)
ENDFOR

message,'Found '+string(npp)+' routines',/info
FOR i=0L,npp-1 DO BEGIN
  str=strcompress(pp(i))
  vv=str_sep(str,' ')
  pro_list(i).name=vv(0)
  pro_list(i).args=ptr_new(vv(1:*))
  wh=which_pro(strlowcase(pro_list(i).name))
  pro_list(i).path=wh(0)
ENDFOR

one_st={name:'',path:''}
st=replicate(one_st,nff+npp)
st.name=[func_list.name,pro_list.name]
st.path=[func_list.path,pro_list.path]

;=== remove empty names
ind=where(st.name NE '')
st=st(ind)
;=== remove empty path (are entries without .pro)
ind=where(st.path NE '')
st=st(ind)

;=== order by path
order=sort(st.path)
st=st(order)

;file=!dustem_wrap_soft_dir+'/src/idl/all_dustem_dependencies.xcat'
file='DustEMWrap_file_dependencies.xcat'
write_xcat,st,file,/wiki
message,'Wrote '+file,/continue

;stop
the_end:
END