pro iug_load_ltr_rish, site=site, $
parameter=parameter, $
downloadonly=downloadonly, $
trange=trange, $
verbose=verbose
if (not keyword_set(verbose)) then verbose=2
site_code_all = strsplit('sgk',' ', /extract)
if(not keyword_set(site)) then site='all'
site_code = thm_check_valid_name(site, site_code_all, /ignore_case, /include_all)
print, site_code
parameter_all = strsplit('uwnd vwnd wwnd pwr1 pwr2 pwr3 pwr4 pwr5 wdt1 wdt2 wdt3 wdt4 wdt5',' ', /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 dB',' ', /extract)
jj=0L
start_time=time_double('1999-7-7')
end_time=time_double('2006-3-29')
for iii=0L,n_elements(parameters)-1 do begin
if ~size(fns,/type) then begin
file_names = file_dailynames( $
file_format='YYYYMM/YYYYMMDD/'+$
'YYYYMMDD',trange=trange,times=times,/unique)+'.'+parameters[iii]+'.csv'
in_time = file_dailynames(file_format='YYYYMMDD',trange=trange,times=times,/unique)
data_time = time_double(strmid(in_time,0,4)+'-'+strmid(in_time,4,2)+'-'+strmid(in_time,6,2))
if (data_time[0] lt start_time) or (data_time[0] gt end_time) then break
source = file_retrieve(/struct)
source.verbose=verbose
source.local_data_dir = root_data_dir() + 'iugonet/rish/misc/sgk/ltr/csv/'
source.remote_data_dir = 'http://www.rish.kyoto-u.ac.jp/radar-group/blr/shigaraki/data/data/ver02.0212/'
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=''
ltr_data = 0
ltr_time = 0
for h=jj,n_elements(local_paths)-1 do begin
file= local_paths[h]
if file_test(/regular,file) then dprint,'Loading LTR-shigaraki file: ',file $
else begin
dprint,'LTR-shigaraki file ',file,' not found. Skipping'
continue
endelse
openr,lun,file,/get_lun
readf, lun, s
height = strsplit(s,',',/extract)
altitude = fltarr(70)
data = strarr(70)
data2 = fltarr(1,70)
for j=0L,n_elements(height)-2 do begin
altitude[j] = float(height[j+1])
endfor
for j=0L, n_elements(altitude)-1 do begin
b = float(altitude[j])
wbad = where(b eq 0,nbad)
if nbad gt 0 then b[wbad] = !values.f_nan
data[j] = !values.f_nan
data2[j] = !values.f_nan
altitude[j]=b
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)
year = strmid(data(0),0,4)
month = strmid(data(0),5,2)
day = strmid(data(0),8,2)
hour = strmid(data(0),11,2)
minute = strmid(data(0),14,2)
time = time_double(string(year)+'-'+string(month)+'-'+string(day)+'/'+hour+':'+minute) $
-time_double(string(1970)+'-'+string(1)+'-'+string(1)+'/'+string(9)+':'+string(0)+':'+string(0))
if time lt time_double(string(1992)+'-'+string(9)+'-'+string(1)+'/'+string(0)+':'+string(0)+':'+string(0)) then break
for j=0L,n_elements(height)-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, ltr_time, time
append_array, ltr_data, data2
endif
endwhile
free_lun,lun
endfor
acknowledgstring = 'If you acquire the lower troposphere radar (LTR) data, ' $
+ 'we ask that you acknowledge us in your use of the data. This may be done by' $
+ 'including text such as the LTR 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 '$
+ 'LTR 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.'
if size(ltr_data,/type) eq 4 then begin
o=0
if parameters[iii] eq 'pwr1' then o=1
if parameters[iii] eq 'pwr2' then o=1
if parameters[iii] eq 'pwr3' then o=1
if parameters[iii] eq 'pwr4' then o=1
if parameters[iii] eq 'pwr5' then o=1
dlimit=create_struct('data_att',create_struct('acknowledgment',acknowledgstring,'PI_NAME', 'H. Hashiguchi'))
store_data,'iug_ltr_'+site_code[0]+'_'+parameters[iii],data={x:ltr_time, y:ltr_data, v:altitude},dlimit=dlimit
new_vars=tnames('iug_ltr_'+site_code[0]+'_'+parameters[iii])
if new_vars[0] ne '' then begin
options,'iug_ltr_'+site_code[0]+'_'+parameters[iii],ytitle='LTR-'+site_code[0]+'!CHeight!C[km]',$
ztitle=parameters[iii]+'!C['+unit_all[o]+']'
options,'iug_ltr_'+site_code[0]+'_'+parameters[iii], labels='LTR-'+site_code[0]+' [km]'
options, 'iug_ltr_'+site_code[0]+'_'+parameters[iii], 'spec', 1
endif
endif
ltr_data = 0
ltr_time = 0
new_vars=tnames('iug_ltr_'+site_code[0]+'_'+parameters[iii])
if new_vars[0] ne '' then begin
tdegap, 'iug_ltr_'+site_code[0]+'_'+parameters[iii],/overwrite
endif
endif
jj=n_elements(local_paths)
endfor
new_vars=tnames('iug_ltr_*')
if new_vars[0] ne '' then begin
print,'*****************************
print,'Data loading is successful!!'
print,'*****************************
endif
print, '****************************************************************
print, 'Acknowledgement'
print, '****************************************************************
print, 'If you acquire LTR data, we ask that you acknowledge us in your use'
print, 'of the data. This may be done by including text such as LTR data'
print, 'provided by Research Institute for Sustainable Humanosphere of'
print, 'Kyoto University. We would also appreciate receiving a copy of the'
print, 'relevant publications. The distribution of LTR data has been partly'
print, 'supported by the IUGONET (Inter-university Upper atmosphere Global'
print, 'Observation NETwork) project (http://www.iugonet.org/) funded by the'
print, 'Ministry of Education, Culture, Sports, Science and Technology (MEXT), Japan.'
end