;+ ; Contains the load_mfl procedure ; ; :Author: ; Laurent Lamy ; ; :History: ; 2008/01/19: Created ; ; 2012/08/01: Last Edit ;- ; ;+ ; Procédure de tracé de lignes de champ magnétiques SPV+anneau de courant ; (précalculées et stockées dans /Groups) ; ; N.B: décalage de 2° de la latitude du pied de la même ligne au nord et au sud ; ; :Params: ; lat_cass: in, required, type=sometype ; A parameter named lat_cass ; tl_cass: in, required, type=sometype ; A parameter named tl_cass ; lat_mfl: in, required, type=sometype ; A parameter named lat_mfl ; tl_mfl: in, required, type=sometype ; A parameter named tl_mfl ; x: in, required, type=sometype ; A parameter named x ; y: in, required, type=sometype ; A parameter named y ; ; :Keywords: ; verb: in, optional, type=sometype ; A keyword named verb ; path: in, optional, type=sometype ; A keyword named path ; sat: in, optional, type=sometype ; A keyword named sat ;- PRO LOAD_MFL,lat_cass,tl_cass,lat_mfl,tl_mfl,x,y,verb=verb,path=path,sat=sat ;------------------------------------------------------------------------------ ; Chargement MFL: ;------------------------------------------------------------------------------ if ~keyword_set(sat) then begin if lat_cass gt 0. then begin repN='OvaleN_SPV/'+strtrim(string(long(90.-lat_mfl)>7<50),1)+'.lsr' repS='OvaleN_SPV/conjugate_mfl/'+strtrim(string(long(90.-lat_mfl)>7<50),1)+'.lsr' endif else begin repN='OvaleS_SPV/conjugate_mfl/'+strtrim(string(long(90.-lat_mfl)>130<172),1)+'.lsr' repS='OvaleS_SPV/'+strtrim(string(long(90.-lat_mfl)>130<172),1)+'.lsr' endelse stop n=0l if keyword_set(path) then file=path+repN else file='/Volumes/Groups/SERPE/'+repN if keyword_set(verb) then message,/info,'Loading '+file openr,unit, file,/get_lun,/swap_if_little_endian readu,unit,n x_read = dblarr(3,n) xt = dblarr(n) readu,unit, xt & x_read(0,*) = xt readu,unit, xt & x_read(1,*) = xt readu,unit, xt & x_read(2,*) = xt xt = 0 close, unit & free_lun, unit nn=n_elements(x_read(0,*)) x_mfl=fltarr(nn) & y_mfl=x_mfl & z_mfl=x_mfl for i=0,nn-1l do begin x_mfl(i)=-x_read(1,nn-1l-i) y_mfl(i)=-x_read(0,nn-1l-i) z_mfl(i)=x_read(2,nn-1l-i) endfor n=0l if keyword_set(path) then file=path+repS else file='/Volumes/Groups/SERPE/'+repS if keyword_set(verb) then message,/info,'Loading '+file openr,unit, file,/get_lun,/swap_if_little_endian readu,unit,n x_read = dblarr(3,n) xt = dblarr(n) readu,unit, xt & x_read(0,*) = xt readu,unit, xt & x_read(1,*) = xt readu,unit, xt & x_read(2,*) = xt xt = 0 close, unit & free_lun, unit x_mfl=[x_mfl,-reform(x_read(1,*))] y_mfl=[y_mfl,-reform(x_read(0,*))] z_mfl=[z_mfl,reform(x_read(2,*))] endif else begin if keyword_set(path) then file=path+'SPV_'+sat+'.mfl' else file='/Volumes/Groups/SERPE/OvaleS_SPV/SPV_'+sat+'.mfl' n=0l openr,unit, file,/get_lun,/swap_if_little_endian readu,unit,n x_mfl = dblarr(n) y_mfl = dblarr(n) z_mfl = dblarr(n) b_mfl = dblarr(3,n) bmod_mfl = dblarr(n) readu,unit,x_mfl,y_mfl,z_mfl,b_mfl,bmod_mfl & bmod_mfl*=1e3 close, unit & free_lun, unit endelse phi=double((tl_mfl-tl_cass)/24.*2.*!pi) ; ref = méridien de cassini rl=sqrt(x_mfl^2+y_mfl^2) xx1=rl*cos(phi) xx2=rl*sin(phi) xx3=z_mfl ;------------------------------------------------------------------------------ ; Changement de repere: ;------------------------------------------------------------------------------ alp=0. bet=lat_cass sa=double(sin(alp*!dtor)) ca=double(cos(alp*!dtor)) sb=double(sin(bet*!dtor)) cb=double(cos(bet*!dtor)) tb=double(tan(bet*!dtor)) a11=cb & a12=0. & a13=sb a21=sa*sb & a22=ca & a23=-sa*cb a31=-sb*ca & a32=sa & a33=ca*cb x1=a11*xx1+a12*xx2+a13*xx3 x2=a21*xx1+a22*xx2+a23*xx3 x3=a31*xx1+a32*xx2+a33*xx3 x=x2 y=x3 end