; ; read_mfi_asc_1m.pro ; ; Purpose: provide an example of how to read Wind/mfi 1 min ascii files ; ; Content of the ascii files in each recod: ; ; int yr Year (e.g., 1996) ; int mon Month (e.g. 1-January...12-December) ; int day Day of Month (1...28/29/30/31) ; int hr Hour (1 -24) ; int min Minute (0-59) ; int sec Second (0-59) ; float bgse(0) X component of B in GSE coordinate in nT ; float bgse(1) Y component of B in GSE coordinate in nT ; float bgse(2) Z component of B in GSE coordinate in nT ; float bgsm(0) X component of B in GSM coordinate in nT ; float bgsm(1) Y component of B in GSM coordinate in nT ; float bgsm(2) Z component of B in GSM coordinate in nT ; float bt Total magnetic flux in nT ; float brmsgsm(0) X component of the rms of B in nT ; float brmsgsm(1) Y component of the rms of B in nT ; float brmsgsm(2) Z component of the rms of B in nT ; float brmst Total magnitude of the rms of B in nT ; int npts No. of Points used in averaging ; float pgse(0) X component of s/c position in GSE coordinate in Re ; float pgse(1) Y component of s/c position in GSE coordinate in Re ; float pgse(2) Z component of s/c position in GSE coordinate in Re ; float pgsm(1) Y component of s/c position in GSM coordinate in Re ; float pgsm(2) Z component of s/c position in GSM coordinate in Re ; ; Note that the format used in generating the ascii files is in G floating ; with 6-digit precision. ; ; ; Create by, Sean Chen, HSTX 10/17/97 ; i=0L yr=0 mon=0 day=0 hr=0 min=0 npts=0 sec=0 bt=0.0 brmst=0.0 bgse=fltarr(3) bgsm=fltarr(3) pgse=fltarr(3) pgsm=fltarr(3) brmsgsm=fltarr(3) filename=strarr(1) temp0=0.0 temp1=0.0 temp2=0.0 temp3=0.0 read,'Input file? ',filename openr,lun,filename(0),/get_lun while(not EOF(lun)) do begin readf,lun,yr,mon,day,hr,min,sec,bgse,temp0,temp1,bt,brmsgsm,brmst,npts,$ pgse,temp2,temp3 bgsm(0)=bgse(0) bgsm(1)=temp0 bgsm(2)=temp1 pgsm(0)=pgse(0) pgsm(1)=temp2 pgsm(2)=temp3 i=i+1 print,yr,mon,day,hr,min,sec,bgse,bgsm,bt,brmsgsm,brmst,npts,$ pgse,pgsm,format='("(Year,mon,day,hr,min,sec)= ",i4,5i3," BGSE=(",g12.6,g12.6,g12.6,") " ," nT; BGSM=(",g12.6,g12.6,g12.6,") ",g12.6, " nT "," BRMSGSM=(",g12.6,g12.6,g12.6,") " ,g12.6," nT ",i8," PGSE=(",g12.6,g12.6,g12.6,") " ," Re; PGSM=(",g12.6,g12.6,g12.6,") Re")' endwhile close,lun free_lun,lun print,'Total number of records:',i end