Blame view

src/idl/dustem_create_stext.pro 1.33 KB
4750086c   Ilyes Choubani   nouvelle philosph...
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
FUNCTION dustem_create_stext ,st, key=key, val=val, scope, help=help

;+
; NAME:
;    dustem_create_stext
; PURPOSE:
;    Produces stokes extinction parameters (cross sections / optical depths)
; CATEGORY:
;    DUSTEM Wrapper
; CALLING SEQUENCE:
;    dustem_create_stext(st,key=key,val=val)
; INPUTS:
;    st (st = dustem_run(p_dim))
; OPTIONAL INPUT PARAMETERS:
;    key  = input parameter number
;    val  = input parameter value
; OUTPUTS:
;    out = array containing the extinction stokes parameters
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    The dustem fortran code must be installed
;    The dustem idl wrapper must be installed
; PROCEDURE:
;    This is a dustem plugin
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_create_stext'
  goto,the_end
ENDIF

e7938fa3   Ilyes Choubani   Corrected02: Impl...
39
40
41
42
43
44
45
46
47
48
49
50
51

psi_ref_ext=0 
  

out=['']

IF keyword_set(key) THEN BEGIN 
  a=where(key EQ 1,count1)


  IF count1 NE 0 then begin
  psi_ref_ext=(val(a))(0)
  ;test to not devide by zero
4750086c   Ilyes Choubani   nouvelle philosph...
52
  frac=st.polext.ext_tot/st.ext.ext_tot
e7938fa3   Ilyes Choubani   Corrected02: Impl...
53
54
55
56
57
58
59
60
61
62
63
64
65
  tes=where(finite(frac) eq 0)
  frac(tes)=0.
 
  polar_ippsi2iqu,((st.polext).ext_tot),Q_ext,U_ext,frac,psi_ref_ext
  
  out=[out,Q_ext,U_ext]
  endif    
ENDIF

scope=((*!dustem_scope).stext)

return, out[1:*]

4750086c   Ilyes Choubani   nouvelle philosph...
66
the_end:
e7938fa3   Ilyes Choubani   Corrected02: Impl...
67
END