;+ ; NAME: ; DMSPOLAR ; PURPOSE: ; Extract data from above 45 deg N magnetic latitude from a one-day DMSP ; SSJ/4 data file. ; CATEGORY: ; DMSP processing ; CALLING SEQUENCE: ; DMSPOLAR, NAME ; INPUTS: ; NAME: The name of the one-day DMSP SSJ/4 data file from PL. ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; None. ; OUTPUTS: ; None. ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; The file NAME is opened and read. A temporary file named POLAR.DAT is ; created to hold the polar data from the specified file. ; RESTRICTIONS: ; The file NAME must exist. ; PROCEDURE: ; Straightforward. ; EXAMPLE: ; DMSPOLAR,'J4F12DEC2194.DAT' ; SEE ALSO: ; DMSPCOPY.PRO ; MODIFICATION HISTORY: ; Written by: DPS, ISR, 950522 ;- PRO dmspolar,name OPENR,ilun,name,/GET_LUN stat=FSTAT(ilun) nrec=stat.SIZE/5280 ncopy=0 record=INTARR(2640) tempname='polar.dat' FOR i=0,nrec-1 DO BEGIN READU,ilun,record IF ((i+1) MOD 20) EQ 0 THEN PRINT,i+1,FORMAT='(I5,$)' IF ((i+1) MOD 320) EQ 0 THEN PRINT,FORMAT='()' hw10=record(10) IF !VERSION.OS EQ 'RISC/os' THEN BYTEORDER,hw10 hw10=hw10-900 IF hw10 GE '800'XL THEN hw10=(hw10 OR 'FFFFF000'XL)+1 mlat=hw10/10. IF (mlat GE 45.) THEN BEGIN IF ncopy EQ 0 THEN BEGIN OPENW,olun,tempname,/GET_LUN PRINT,tempname,FORMAT='(/A," opened...")' ENDIF WRITEU,olun,record ncopy=ncopy+1 ENDIF ENDFOR FREE_LUN,ilun FREE_LUN,olun PRINT,ncopy,tempname,FORMAT='(/I4," blocks copied to ",A)' IF !VERSION.OS EQ 'RISC/os' $ THEN SPAWN,'/usr/bsd43/bin/mv polar.dat '+name $ ELSE BEGIN SPAWN,'rename '+tempname+' '+name SPAWN,'create/fdl=dmsp.fdl tmp.dat /log' SPAWN,'convert/nocreate/truncate '+name+' tmp.dat' SPAWN,'rename tmp.dat '+name SPAWN,'purge/log' ENDELSE RETURN END