pro iug_load_mu_rass_txt, parameter=parameter, $
downloadonly=downloadonly, $
trange=trange, $
verbose=verbose
if (not keyword_set(verbose)) then verbose=2
parameter_all = strsplit('uwnd vwnd wwnd temp',' ', /extract)
if(not keyword_set(parameter)) then parameter='all'
parameters = thm_check_valid_name(parameter, parameter_all, /ignore_case, /include_all)
print, parameters
unit_all = strsplit('m/s degree',' ', /extract)
jj=0L
for ii=0L,n_elements(parameters)-1 do begin
if ~size(fns,/type) then begin
file_names = file_dailynames( $
file_format='YYYY/YYYYMMDD/YYYYMMDD',trange=trange,times=times,/unique)+'.'+parameters[ii]+'.csv'
source = file_retrieve(/struct)
source.verbose=verbose
source.local_data_dir = root_data_dir() + 'iugonet/rish/misc/mu/rass/csv/'
source.remote_data_dir = 'http://www.rish.kyoto-u.ac.jp/mu/rass/data/csv/'
local_paths=file_retrieve(file_names,_extra=source)
local_paths_all = ~(~size(local_paths_all,/type)) ? $
[local_paths_all, local_paths] : local_paths
if ~(~size(local_paths_all,/type)) then local_paths=local_paths_all
endif else file_names=fns
if (not keyword_set(downloadonly)) then downloadonly=0
if (downloadonly eq 0) then begin
s=''
mu_time=0
mu_data=0
for h=jj,n_elements(local_paths)-1 do begin
file= local_paths[h]
if file_test(/regular,file) then dprint,'Loading MU file: ',file $
else begin
dprint,'MU file',file,'not found. Skipping'
continue
endelse
openr,lun,file,/get_lun
readf, lun, s
h_data = strsplit(s,',',/extract)
altitude = fltarr(n_elements(h_data)-1)
for j=0L,n_elements(h_data)-2 do begin
altitude[j] = float(h_data[j+1])
endfor
while(not eof(lun)) do begin
readf,lun,s
ok=1
if strmid(s,0,1) eq '[' then ok=0
if ok && keyword_set(s) then begin
dprint,s ,dlevel=5
data = strsplit(s,',',/extract)
data2 = fltarr(1,n_elements(data)-1)
u=strsplit(data(0),' ',/extract)
date=strsplit(u[0],'-',/extract)
year = date[2]
month = date[1]
day = date[0]
if month eq 'JAN' then month ='01'
if month eq 'FEB' then month ='02'
if month eq 'MAR' then month ='03'
if month eq 'APR' then month ='04'
if month eq 'MAY' then month ='05'
if month eq 'JUN' then month ='06'
if month eq 'JUL' then month ='07'
if month eq 'AUG' then month ='08'
if month eq 'SEP' then month ='09'
if month eq 'OCT' then month ='10'
if month eq 'NOV' then month ='11'
if month eq 'DEC' then month ='12'
time = time_double(string(year)+'-'+string(month)+'-'+string(day)+'/'+u[1]) $
-time_double(string(1970)+'-'+string(1)+'-'+string(1)+'/'+string(9)+':'+string(0)+':'+string(0))
for j=0L,n_elements(h_data)-2 do begin
a = float(data[j+1])
wbad = where(a eq 999,nbad)
if nbad gt 0 then a[wbad] = !values.f_nan
data2[0,j]=a
endfor
append_array, mu_time, time
append_array, mu_data, data2
endif
endwhile
free_lun,lun
endfor
acknowledgstring = 'If you acquire the middle and upper atmospher (MU) radar data, ' $
+ 'we ask that you acknowledge us in your use of the data. This may be done by ' $
+ 'including text such as the MU data provided by Research Institute ' $
+ 'for Sustainable Humanosphere of Kyoto University. We would also ' $
+ 'appreciate receiving a copy of the relevant publications. '$
+ 'The distribution of MU radar data has been partly supported by the IUGONET '$
+ '(Inter-university Upper atmosphere Global Observation NETwork) project '$
+ '(http://www.iugonet.org/) funded by the Ministry of Education, Culture, '$
+ 'Sports, Science and Technology (MEXT), Japan.'
o=0
if size(mu_data,/type) eq 4 then begin
if strmid(parameters[ii],0,4) eq 'temp' then o=1
dlimit=create_struct('data_att',create_struct('acknowledgment',acknowledgstring,'PI_NAME', 'J. Furumoto'))
store_data,'iug_mu_rass_'+parameters[ii],data={x:mu_time, y:mu_data, v:altitude/1000.0},dlimit=dlimit
new_vars=tnames('iug_mu_rass_*')
if new_vars[0] ne '' then begin
options,'iug_mu_rass_'+parameters[ii],ytitle='MU-rass!CHeight!C[km]',ztitle=parameters[ii]+'!C['+unit_all[o]+']'
options,'iug_mu_rass_'+parameters[ii], labels='MU-rass [km]'
endif
endif
new_vars=tnames('iug_mu_rass_*')
if new_vars[0] ne '' then options, 'iug_mu_rass_'+parameters[ii], 'spec', 1
mu_time=0
mu_data=0
if new_vars[0] ne '' then tdegap, 'iug_mu_rass_'+parameters[ii],dt=600, /overwrite
endif
jj=n_elements(local_paths)
endfor
new_vars=tnames('iug_mu_rass_*')
if new_vars[0] ne '' then begin
print,'*****************************
print,'Data loading is successful!!'
print,'*****************************
endif
print, '****************************************************************
print, 'Acknowledgement'
print, '****************************************************************
print, 'If you acquire the middle and upper atmosphere (MU) radar data,'
print, 'we ask that you acknowledge us in your use of the data.'
print, 'This may be done by including text such as MU data provided'
print, 'by Research Institute for Sustainable Humanosphere of Kyoto University.'
print, 'We would also appreciate receiving a copy of the relevant publications.'
print, 'The distribution of MU radar data has been partly supported by the IUGONET'
print, '(Inter-university Upper atmosphere Global Observation NETwork) project'
print, '(http://www.iugonet.org/) funded by the Ministry of Education, Culture,'
print, 'Sports, Science and Technology (MEXT), Japan.'
end