; NAME : displ ; PURPOSE : ; plot magnetic field lines ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; displ, mparam ; INPUTS : ; mparam = magnetogram parameters ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; filename = name of field line file ; whitebg = white background (default is dark background) ; list : if set, parameter values in the input file are printed ; OUTPUTS : ; creates field line plot ; COMMON BLOCKS : none ; SIDE EFFECTS : ; if filename is not supplied, it has to be typed in from keyboard ; RESTRICTIONS : X-window environment is assumed ; PROCEDURE : ; ; MODIFICATION HISTORY : ; T.Sakurai, 1992 ; ;------------------------------------------------------------------------ ; pro displ, mparam, filename=filename, whitebg=whitebg, list=list ; if keyword_set(filename) then begin loffile = filename endif else begin loffile = ' ' read,'(proc.displ1) enter input file name > ',loffile endelse setcolor, bandwidth, w_start, rb_start, g_start, color8, $ whitebg=whitebg openr, u_lof, loffile, /get_lun point_lun,u_lof,0 rsp = mparam.rsp ncomp=8 nbytel=4 lofno = 0 height0 = 50.0 bright0 = 0.3 lhdr1 = deflh1() lhdr2 = deflh2() str4 = ' ' while ( not eof(u_lof) ) do begin readu, u_lof, lhdr1 np = fix(lhdr1.np) if (np le 0) then goto, endlofread $ else if (np eq 1) then begin if(lhdr1.nex eq str4) then $ nex = 0 $ else $ nex = fix(lhdr1.nex) readu, u_lof, lhdr2 kindl =long(lhdr2.kindl) nbytel =fix(lhdr2.nbytel) ncomp =fix(lhdr2.ncomp) xfactor =float(lhdr2.xfactor) bfactor =float(lhdr2.bfactor) if keyword_set(list) then begin print,'parameters in ',loffile print,'kind,nbyte,ncomp=',kindl,nbytel,ncomp print,'xfactor,bfactor=',xfactor,bfactor print,'lfile=',lhdr2.lfile print,'mtag=',lhdr2.mtag print,'ltag=',lhdr2.ltag if nex ne 0 then print,'nex=',nex print,'nfinit=',lhdr1.nfinit print,'ns1,2,3=',lhdr1.ns1,lhdr1.ns2,lhdr1.ns3 print,'bmin1,bmin2=',lhdr1.bmin1,lhdr1.bmin2 print,'flxpwr=',lhdr1.flxpwr endif endif else begin if ( abs(nbytel) eq 2) then begin if (ncomp eq 3 ) then $ xyzb = intarr(3,np) $ else $ xyzb = intarr(8,np) endif else begin if (ncomp eq 3 ) then $ xyzb = lonarr(3,np) $ else $ xyzb = lonarr(8,np) endelse readu, u_lof, xyzb nlast = ( abs(nbytel)*ncomp*np) mod 80 if ( nlast ne 0 and not eof(u_lof) ) then begin skipstr = replicate(' ', 80 - nlast ) readu, u_lof, skipstr endif lofno = lofno +1 if ( nbytel lt 0 ) then byteorder,xyzb xx = xfactor*xyzb(0,*) yy = xfactor*xyzb(1,*) zz = xfactor*xyzb(2,*) if ( kindl mod 10 lt 2 ) then $ height = zz $ else $ height = sqrt( xx^2 + yy^2 + (zz + rsp )^2 ) -rsp maxheight = max(height) for i=1, np-1 do begin if ( maxheight gt height0 ) then $ bright = height(i) / height0 $ else $ bright = ( height(i)+height0-maxheight) /height0 bright = bright < 1.0 bright = bright > 0.0 bright = bright0+ bright*(1.0- bright0) oplot, xx(i-1:i), yy(i-1:i), $ color = g_start + bright *(bandwidth-1), $ thick=1 endfor endelse endwhile endlofread: return end