Commit 4d1fdbd693297239a56b33cf2a68b44073136508

Authored by Jean-Philippe Bernard
1 parent a2fead4e
Exists in master

added some synchroton

Showing 1 changed file with 38 additions and 2 deletions   Show diff stats
src/idl/dustem_make_polarization_sed_example.pro
... ... @@ -102,6 +102,30 @@ pd = [ $
102 102 ]
103 103 p_truth=[1.,7.8000E-04,7.8000E-04,7.8000E-04]
104 104  
  105 +pd = [ $
  106 + '(*!dustem_params).G0', $ ;G0
  107 + '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
  108 + '(*!dustem_params).grains(1).mdust_o_mh',$ ;PAH0 mass fraction
  109 + '(*!dustem_params).grains(2).mdust_o_mh', $ ;PAH1 mass fraction
  110 + 'dustem_plugin_synchrotron_2', $ ;Synchrotron amplitude at 10 mm
  111 + 'dustem_plugin_synchrotron_3', $ ;Synchrotron polarization angle
  112 + 'dustem_plugin_synchrotron_4' $ ;Synchrotron polarization fraction
  113 + ]
  114 +p_truth=[1.,7.8000E-04,7.8000E-04,7.8000E-04, 1., 45., 0.3]
  115 +
  116 +pd = [ $
  117 + '(*!dustem_params).G0', $ ;G0
  118 + '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
  119 + '(*!dustem_params).grains(1).mdust_o_mh',$ ;PAH0 mass fraction
  120 + '(*!dustem_params).grains(2).mdust_o_mh', $ ;PAH1 mass fraction
  121 + 'dustem_plugin_synchrotron_1', $ ;Synchrotron spectra index
  122 + 'dustem_plugin_synchrotron_2', $ ;Synchrotron amplitude at 10 mm
  123 + 'dustem_plugin_synchrotron_3', $ ;Synchrotron polarization fraction
  124 + 'dustem_plugin_synchrotron_4' $ ;Synchrotron polarization angle
  125 + ]
  126 +p_truth=[1.,7.8000E-04,7.8000E-04,7.8000E-04,3., 1.e-2, 0.3, 45.]
  127 +
  128 +
105 129 ;iv=p_truth+[0.,8.e-4,8.e-4,8.e-4] ;shifted from solution
106 130 iv=p_truth
107 131  
... ... @@ -120,6 +144,12 @@ toto=dustem_compute_stokes(p_truth,sstqu,dustem_Qsed,dustem_Used) ;this procedur
120 144  
121 145 print,dustem_Qsed,dustem_Used
122 146  
  147 +sed.stokesI=dustem_Ised
  148 +sed.stokesQ=dustem_Qsed
  149 +sed.stokesU=dustem_Used
  150 +
  151 +
  152 +goto,no_change
123 153 ;=modifies the Fortran outputs Q,U SED values to reflect a fixed polarization fraction and angle
124 154 ;normaly, this could also be doen using the plugin:
125 155 ;toto=dustem_plugin_modify_dust_pol(ssti, key=key, val=val, scope=scope, paramtag=paramtag, help=help)
... ... @@ -129,12 +159,13 @@ psi_used=10. ;10 degrees
129 159 smallp=dustem_Ised*0.+frac_used
130 160 psi=dustem_Ised*0.+psi_used
131 161 polar_ippsi2iqu,dustem_Ised,Q,U,smallp,psi
132   -;print,Q,U
133 162  
134 163 sed.stokesI=dustem_Ised
135 164 sed.stokesQ=Q
136 165 sed.stokesU=U
137 166  
  167 +no_change:
  168 +
138 169 ;=== set arbitrary uncertainties
139 170 sed.sigmaII=abs(sed.StokesI*0.000001)
140 171 sed.sigmaQQ=abs(sed.StokesQ*0.000001)
... ... @@ -147,7 +178,12 @@ sed.sigmaQU=0.
147 178 print,sed.stokesI,sed.stokesQ,sed.stokesU
148 179 print,sed.sigmaII,sed.sigmaQQ,sed.sigmaUU
149 180  
150   -;stop
  181 +;==== fill in dependent columns of the SED.
  182 +sed=dustem_fill_sed_dependent_columns(sed)
  183 +
  184 +cgplot,sed.wave,sed.stokesI,psym=-3,/xlog,/ylog
  185 +
  186 +stop
151 187 ;======== save the SED
152 188 filename='/tmp/fake_polarization_sed.xcat'
153 189 write_xcat,sed,filename
... ...