diff --git a/src/idl_misc/JPBLib_for_Dustemwrap/General/polar_iqu2ippsi.pro b/src/idl_misc/JPBLib_for_Dustemwrap/General/polar_iqu2ippsi.pro index d9341c8..7ffbcf8 100755 --- a/src/idl_misc/JPBLib_for_Dustemwrap/General/polar_iqu2ippsi.pro +++ b/src/idl_misc/JPBLib_for_Dustemwrap/General/polar_iqu2ippsi.pro @@ -1,4 +1,4 @@ -PRO polar_iqu2ippsi,I,Q,U,p,psi,p2=p2,help=help,lac=lac +PRO polar_iqu2ippsi,I,Q,U,p,psi,p2=p2,help=help,lac=lac,largep=largep ;+ ; NAME: @@ -41,17 +41,23 @@ IF n_params(0) LE 4 THEN BEGIN ENDIF IF keyword_set(lac) THEN BEGIN + largep=la_power((la_add(la_power(Q,2.),la_power(U,2.))),0.5) p2=la_div(la_add(la_power(Q,2.),la_power(U,2.)),la_power(I,2.)) - p=la_div(la_power((la_add(la_power(Q,2.),la_power(U,2.))),0.5),I) + p=la_div(largep,I) psi=0.5*atan(U,Q)/!dtor ind=where(U EQ la_undef() OR Q EQ la_undef(),count) IF count NE 0 THEN psi[ind]=la_undef() ENDIF ELSE BEGIN + largep=sqrt(Q^2+U^2) p2=(Q^2+U^2)/I^2 - p=sqrt(Q^2+U^2)/I + p=largep/I psi=0.5*atan(U,Q)/!dtor ENDELSE +;set polarization angle to undefined where P is 0 +ind=where(largep EQ 0.,count) +IF count NE 0 THEN psi[ind]=la_undef() + sortie: END -- libgit2 0.21.2