pro goes_mag_load,trange=trange,verbose=verbose,downloadonly=downloadonly, $
varformat=varformat,datatype=datatype, $
probes=probes, $
addmaster=addmaster,tplotnames=tn,source_options=source
if not keyword_set(probes) then probes = ['10','11','12']
nprobes = n_elements(probes)
datatype = 'k0'
istp_init
if not keyword_set(source) then source = !istp
for i=0,nprobes-1 do begin
probe=probes[i]
if datatype eq 'k0' then begin
dprint,dlevel=2,verbose=source.verbose,'Loading GOES ',probe,' MAG data'
case probe of
'10': pathformat = 'goes/goes10/mag_k0/YYYY/g0_k0_mag_YYYYMMDD_v03.cdf'
'6': pathformat = 'goes/goes06/mag_k0/YYYY/g6_k0_mag_YYYYMMDD_v02.cdf'
'7': pathformat = 'goes/goes07/mag_k0/YYYY/g7_k0_mag_YYYYMMDD_v02.cdf'
'8': pathformat = 'goes/goes08/mag_k0/YYYY/g8_k0_mag_YYYYMMDD_v03.cdf'
'9': pathformat = 'goes/goes09/mag_k0/YYYY/g9_k0_mag_YYYYMMDD_v03.cdf'
'11': pathformat = 'goes/goes11/mag_k0/YYYY/goes11_k0_mag_YYYYMMDD_v03.cdf'
'12': pathformat = 'goes/goes12/mag_k0/YYYY/goes12_k0_mag_YYYYMMDD_v03.cdf'
else: pathformat = ''
endcase
endif
if not keyword_set(pathformat) then begin
dprint,'Not a valid probe'
return
endif
if not keyword_set(varformat) then begin
varformat = 'SC_pos_* B_???_c'
endif
relpathnames = file_dailynames(file_format=pathformat,trange=trange,addmaster=addmaster)
files = file_retrieve(relpathnames, _extra=source, /last_version)
if keyword_set(downloadonly) then continue
prefix = 'goes'+probe+'_'
cdf2tplot,file=files,varformat=varformat,verbose=source.verbose,prefix=prefix ,tplotnames=tn
dprint,dlevel=3,'tplotnames: ',tn
options,/def,strfilter(tn,'*GSE* *GSM* *pos* *lcl*',delim=' '),/lazy_ytitle , colors='bgr'
endfor
end