Function dustem_plugin_modify_dust_polar_angle, key=key, val=val, scope=scope,help=help ;+ ; NAME: ; dustem_create_stokes ; PURPOSE: ; Produces stokes emission parameters for the dust and synchrotron components ; CATEGORY: ; DUSTEM Wrapper ; CALLING SEQUENCE: ; dustem_create_stokes(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 stokes emission parameters associated to the dust/synchrotron component or a concatenated version for both ; 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_stokes' out=0. goto,the_end ENDIF scope='MODIFY_DUST_POLAR_ANGLE' IF ptr_valid((*!dustem_fit).CURRENT_PARAM_VALUES) THEN BEGIN p_di=(*(*!dustem_fit).CURRENT_PARAM_VALUES) st=dustem_run(p_di) ENDIF ELSE BEGIN p_di=(*(*!dustem_fit).PARAM_INIT_VALUES) st=dustem_run(p_di) ENDELSE psi=0. IF keyword_set(key) THEN BEGIN a=where(key EQ 1,count1) IF count1 NE 0 THEN psi=val[a[0]] ; setting psi from pd print, 'psi in modify_dust_polar_angle is:' print, psi ENDIF fact = 1.e4*1.E20/(4.*!pi)/(3.e8/1.e-6/(st.polsed).wav)*1.e20/1.e7 P=st.polsed.em_tot*fact I=st.sed.em_tot*fact Nwaves=(size(I))[1] frac=P/I tes=where(finite(frac) eq 0) frac(tes)=0. polar_ippsi2iqu,I,Q,U,frac,replicate(psi,Nwaves) print, 'U in modify_dust_polar_angle is:' print, U print, 'Q in modify_dust_polar_angle is:' print, Q out=fltarr(Nwaves,2) out[*,0]=Q out[*,1]=U return, out the_end: end