pro iug_load_lfrto, site=site, trans=trans, parameter=parameter, datatype=datatype,$
downloadonly=downloadonly, no_download=no_download, verbose=verbose, trange=trange
site_code_all = strsplit('ath nal', /extract)
if(n_elements(site) eq 0) then site='all'
site_code=thm_check_valid_name(site, site_code_all, /ignore_case, /include_all)
if(site_code[0] eq '') then return
print, site_code
trans_code_ath_all = strsplit('wwvb ndk nlk npm nau nrk nwc', /extract)
trans_code_nal_all = strsplit('msf dcf nrk gbz', /extract)
if(n_elements(trans) eq 0) then trans='all'
trans_code_ath = thm_check_valid_name(trans, trans_code_ath_all, /ignore_case, /include_all, /no_warning)
trans_code_nal = thm_check_valid_name(trans, trans_code_nal_all, /ignore_case, /include_all, /no_warning)
if(trans_code_ath[0] eq '' and trans_code_nal[0] eq '') then begin
dprint,'!!! Trans code error !!!'
dprint,'Valid Trans codes:'
dprint,'wwvb ndk nlk npm nau nrk nwc (for site "ath")'
dprint,'msf dcf nrk gbz (for site "nal")'
return
endif
tres_all = ['30sec']
if(n_elements(datatype) eq 0) then datatype='all'
datatype=strjoin(datatype, ' ')
datatype=strsplit(strlowcase(datatype), ' ', /extract)
if(where(datatype eq '30s') ne -1) then datatype[where(datatype eq '30s')]='30sec'
tres = thm_check_valid_name(datatype, tres_all, /ignore_case, /include_all)
if (tres[0] eq '') then return
param_all = strsplit('power phase', /extract)
if(n_elements(parameter) eq 0) then parameter='all'
parameter=strjoin(parameter, ' ')
parameter=strsplit(strlowcase(parameter), ' ', /extract)
if(where(parameter eq 'pow') ne -1) then parameter[where(parameter eq 'pow')]='power'
if(where(parameter eq 'pha') ne -1) then parameter[where(parameter eq 'pha')]='phase'
param = thm_check_valid_name(parameter, param_all, /ignore_case, /include_all)
if (param[0] eq '') then return
if (not keyword_set(verbose)) then verbose=0
if (not keyword_set(downloadonly)) then downloadonly=0
if (not keyword_set(no_download)) then no_download=0
source = file_retrieve(/struct)
source.verbose = verbose
filedate = file_dailynames(file_format='YYYYMMDD', trange=trange)
filemonth = strmid(filedate,0,6)
if keyword_set(no_download) then source.no_download = 1
show_text=0
for i=0,n_elements(site_code)-1 do begin
source.local_data_dir = root_data_dir() + 'iugonet/TohokuU/radio_obs/'+site_code[i]+'/lf/'
source.remote_data_dir = 'http://iprt.gp.tohoku.ac.jp/lf/cdf/'+site_code[i]+'/'
case site_code[i] of
'ath': trans_code=trans_code_ath
'nal': trans_code=trans_code_nal
endcase
for j=0,n_elements(trans_code)-1 do begin
for k=0,n_elements(tres)-1 do begin
relfnames = filemonth+'/'+'lfrto'+'_'+tres[k]+'_'+site_code[i]+'_'+trans_code[j]+'_'+filedate+'_v01.cdf'
datfiles = file_retrieve(relfnames, _extra=source)
filenum=n_elements(datfiles)
file_exist=intarr(filenum)
for it=0,filenum-1 do begin
file_exist[it] = file_test(datfiles[it])
endfor
if(downloadonly eq 0 and (where(file_exist eq 1))[0] ne -1) then begin
datfiles = datfiles[where(file_exist eq 1)]
show_text = 1
for l=0,n_elements(param)-1 do begin
cdf2tplot, file=source.local_data_dir+relfnames,varformat='lf_'+param[l]+'_'+tres[k]
if (param[l] eq 'power' and tres[k] eq '30sec') then ptr = 'pow30s'
if (param[l] eq 'phase' and tres[k] eq '30sec') then ptr = 'pha30s'
copy_data, 'lf_'+param[l]+'_'+tres[k], 'lfrto_'+site_code[i]+'_'+trans_code[j]+'_'+ptr
store_data, 'lf_'+param[l]+'_'+tres[k], /delete
endfor
endif
endfor
endfor
endfor
datfile = source.local_data_dir+relfnames[0]
if (show_text eq 1) then begin
gatt = cdf_var_atts(datfile)
dprint, '**********************************************************************'
dprint, gatt.project
dprint, ''
dprint, 'PI and Host PI(s): ', gatt.PI_name
dprint, 'Affiliations: ', 'PPARC, Tohoku University'
dprint, ''
dprint, 'Rules of the Road for LFRTO Data Use:'
for igatt=0, n_elements(gatt.text)-1 do print_str_maxlet, gatt.text[igatt], 70
dprint, ''
dprint, gatt.LINK_TEXT, ' ', gatt.HTTP_LINK
dprint, '**********************************************************************'
dprint, ''
endif else begin
dprint, 'No data is loaded'
dprint, ''
endelse
return
end