; NAME : vector ; PURPOSE : ; vectorize a magnetogram ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; vector, mparam, rdata ; INPUTS : ; mparam, rdata ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; faceon = assume the region is at the disk center ; keep_bp = store bxp and byp in rdata ; OUTPUTS : ; vectorized BX and BY will overwrite pseudo vector BX and BY ; COMMON BLOCKS : none ; SIDE EFFECTS : mparam will be modified ; RESTRICTIONS : none ; PROCEDURE : ; vectorize by referring to the current-free field ; MODIFICATION HISTORY : ; T.Sakurai, 1992 ; ;------------------------------------------------------------------------ ; pro vector, mparam, rdata, faceon=faceon, keep_bp=keep_bp if mparam.kindm lt 0 then pol2b, mparam, rdata kindm = mparam.kindm kindm = (kindm/10) *10 nx = mparam.nx ny = mparam.ny dx = mparam.dx dy = mparam.dy nx2 = 2*nx ny2 = 2*ny kx = kloc( mparam, /x) ky = kloc( mparam, /y) kz = kloc( mparam, /z) if kx eq -1 or ky eq -1 or kz eq -1 then begin print,'(proc vector) error:kx,ky,kz=',kx,ky,kz return endif cff1, mparam, rdata, bxp, byp, faceon=faceon flip = where( $ rdata(*,*,kx)*bxp + rdata(*,*,ky)*byp lt 0.0, count ) if count gt 0 then begin rdata( flip+nx*ny*kx ) = -rdata( flip+nx*ny*kx ) rdata( flip+nx*ny*ky ) = -rdata( flip+nx*ny*ky ) end if keyword_set(keep_bp) then begin kxp = kloc( mparam, /px ) if kxp eq -1 then begin kxp = newk( mparam, rdata ) mparam.status.bxp = kxp endif kyp = kloc( mparam, /py ) if kyp eq -1 then begin kyp = newk( mparam, rdata ) mparam.status.byp = kyp endif rdata(*,*,kxp) = bxp rdata(*,*,kyp) = byp mparam.status.blp = kz mparam.nframe = mparam.nframe +3 mparam.kindm = kindm + 7L endif else begin mparam.kindm = kindm + 3L endelse print,'(proc.vector) end' return end