PRO rdmsp,file,sat,start,finish,ps=ps IF N_ELEMENTS(sat) EQ 0 THEN sat='' ELSE sat=STRUPCASE(sat) IF N_ELEMENTS(start) EQ 0 THEN start=0. ELSE start=start(0) IF N_ELEMENTS(finish) EQ 0 THEN finish=24. ELSE finish=finish(0) t0=SYSTIME(1) inf=qgetfile(file) nl=N_ELEMENTS(inf) name=STRARR(nl) time=name date=name dlat=FLTARR(nl) dlon=dlat mlat=dlat mlon=dlat mlt=dlat tmlat=dlat tmlon=dlat p=spc(nl) j=0 FOR i=0,nl-1 DO BEGIN CASE 1 OF (isnumber(STRMID(inf(i),0,2)) NE 0): $ BEGIN ; process data s=inf(i) nw=nwrds(s) date(j)=getwrd(s,0) time(j)=getwrd(s,1) tj=secstr(time(j)) name(j)=getwrd(s,2) IF (name(j) EQ STRUPCASE(sat)) AND $ (start*3600. LT tj) AND $ (tj LT finish*3600.) THEN BEGIN dlat(j)=FLOAT(getwrd(s,3)) dlon(j)=FLOAT(getwrd(s,4)) mlat(j)=FLOAT(getwrd(s,5)) mlon(j)=FLOAT(getwrd(s,6)) mlt(j)=secstr(getwrd(s,7)) IF nw GT 8 THEN BEGIN w8=getwrd(s,8) IF (isnumber(STRTRIM(w8,2)) NE 0) $ THEN tmlat(j)=FLOAT(w8) $ ELSE tmlat(j)=-0.00 ENDIF IF nw GT 9 THEN BEGIN w9=getwrd(s,9) IF (isnumber(STRTRIM(w9,2)) NE 0) $ THEN tmlon(j)=FLOAT(w9) $ ELSE tmlon(j)=-0.00 ENDIF CASE 1 OF (mlat(j) LT -55.0): STRPUT,p,' ',j (55.0 LT mlat(j)): STRPUT,p,'N',j ELSE: ENDCASE j=j+1 ENDIF END ELSE: ENDCASE ENDFOR date=date(0:j-1) time=time(0:j-1) name=name(0:j-1) dlat=dlat(0:j-1) dlon=dlon(0:j-1) mlat=mlat(0:j-1) mlon=mlon(0:j-1) mlt=mlt(0:j-1) tmlat=tmlat(0:j-1) tmlon=tmlon(0:j-1) IF TOTAL(tmlat) GT 0. THEN maglat=tmlat ELSE maglat=mlat nl=j t1=SYSTIME(1) PRINT,'Reading ',j,' lines of data took ',t1-t0,' sec' $ ,FORMAT='(A,I0,A,F6.2,A)' fndwrd,p,np,pstart,plen hem=STRARR(np) FOR i=0,np-1 DO hem(i)=STRMID(p,pstart(i),1) north=WHERE(hem EQ 'N',nnorth) IF nnorth GT 0 THEN BEGIN pstart=pstart(north) plen=plen(north) IF KEYWORD_SET(ps) THEN BEGIN psopen,file+'.ps' DEVICE,XSIZE=6,YSIZE=6,XOFFSET=1,YOFFSET=2,/INCHES psres=300 posn=[0,0,scl(1800,res=psres),scl(1800,res=psres)] ENDIF ELSE BEGIN WINDOW,0,XSIZE=640,YSIZE=640 posn=[0,0,639,639] ENDELSE PLOT,[0,20],[-180,180]*!DTOR,/POLAR,/NODATA,/DEVICE $ ,POSITION=posn,XRANGE=[-20,20],XSTYLE=5 $ ,YRANGE=[-20,20],YSTYLE=5 rt=25.5 tt=310.*!DTOR XYOUTS,rt*COS(tt),rt*SIN(tt),date(pstart(0)) $ ,ALIGNMENT=1,CHARSIZE=2,CHARTHICK=2 FOR i=0,7 DO BEGIN ang=45*i-90 radii,0,30,ang XYOUTS,17.5*COS(ang*!DTOR),17.5*SIN(ang*!DTOR) $ ,STRTRIM(FIX(3*i),2),ALIGNMENT=1 $ ,CHARSIZE=2,CHARTHICK=2 ENDFOR cos30=COS(!PI/6.) sin30=SIN(!PI/6.) FOR i=1,5 DO BEGIN arcs,5*i,0,360 XYOUTS,5*i*cos30,5*i*sin30,STRTRIM(90-5*i,2) $ ,ALIGNMENT=0,CHARSIZE=2,CHARTHICK=2 ENDFOR FOR i=0,nnorth-1 DO BEGIN IF ((MAX(STRPOS(sat,name(pstart(i)))) GE 0) AND $ (start*3600. LE secstr(time(pstart(i)))) AND $ (secstr(time(pstart(i))) LT finish*3600.)) THEN BEGIN OPLOT,90.-maglat(pstart(i):pstart(i)+plen(i)-1) $ ,(mlt(pstart(i):pstart(i)+plen(i)-1)/240.-90.)*!DTOR $ ,/POLAR,PSYM=-1 r=90.-maglat(pstart(i)) theta=(mlt(pstart(i))/240.-90.)*!DTOR devco=CONVERT_COORD(r*COS(theta),r*SIN(theta) $ ,/DATA,/TO_DEVICE) XYOUTS,devco(0)-!D.X_CH_SIZE,devco(1)+0.2*!D.Y_CH_SIZE $ ,STRTRIM(name(pstart(i)),2),/DEVICE,ALIGNMENT=1.0 XYOUTS,devco(0)-!D.X_CH_SIZE,devco(1)-1.2*!D.Y_CH_SIZE $ ,STRMID(time(pstart(i)),0,5),/DEVICE,ALIGNMENT=1.0 ENDIF ENDFOR IF KEYWORD_SET(ps) THEN psclose ENDIF RETURN END