pro iug_load_ionosonde_rish, site=site, $
fixed_freq = fixed_freq, $
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 = strlowcase(thm_check_valid_name(site, site_code_all, /ignore_case, /include_all))
if n_elements(site_code) eq 1 then begin
if site_code eq '' then begin
print, 'This station code is not valid. Please input the allowed keywords, all, and sgk.'
return
endif
endif
print, site_code
if ~size(fns,/type) then begin
file_names = file_dailynames_iug( $
file_format='YYYY/YYYYMM/YYYYMMDD/'+$
'YYYYMMDDhhmm',trange=trange,times=times,/unique,/minute_res)+'_ionogram.txt'
source = file_retrieve(/struct)
source.verbose=verbose
source.local_data_dir = root_data_dir() + 'iugonet/rish/misc/'+site_code+'/ionosonde/text/'
source.remote_data_dir = 'http://database.rish.kyoto-u.ac.jp/arch/mudb/data/ionosonde/text/'
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=''
header_data = strarr(9)
for j=0L,n_elements(local_paths_all)-1 do begin
file=local_paths_all[j]
if file_test(/regular,file) then dprint,'Loading the ionogram data taken by the ionosonde at Shigaraki:',file $
else begin
dprint,'The ionogram data taken by the ionosonde at Shigaraki', file,' not found. Skipping'
continue
endelse
lines = file_lines(file)
openr,lun,file,/get_lun
for i=0L, n_elements(header_data)-1 do begin
readf, lun, s
header_data[i]=s
endfor
date = strmid(header_data[1],12,10)
hhmm = strmid(header_data[1],23,5)
time = time_double(string(date)+'/'+string(hhmm))-3600*9
readf,lun, s
freq = float(strsplit(s,' ',/extract))
intensity = fltarr(1,n_elements(freq))
while(not eof(lun)) do begin
readf,lun, s
data = float(strsplit(s,' ',/extract))
height = data[0]
intensity [0,*] =data[1:n_elements(data)-1]
append_array, height2, height
append_array, intensity2,intensity
height3= height2
endwhile
free_lun,lun
intensity3 = transpose(intensity2)
intensity_all_f = fltarr(1,n_elements(freq),n_elements(height3))
intensity_all_f[0,*,*] = intensity3
append_array, site_time, time
append_array, intensity_all_f2,intensity_all_f
height2 = 0
intensity2 = 0
endfor
acknowledgstring = 'If you acquire the ionogram data, ' $
+ 'we ask that you acknowledge us in your use of the data. This may be done by' $
+ 'including text such as the ionogram 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 ' $
+ 'ionogram 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.'
dlimit=create_struct('data_att',create_struct('acknowledgment',acknowledgstring,'PI_NAME', 'M. Yamamoto'))
if size(intensity_all_f2,/type) eq 4 then begin
if not keyword_set(fixed_freq) then begin
store_data,'iug_ionosonde_sgk_ionogram',data={x:site_time,y:intensity_all_f2,v1:freq,v2:height3},dlimit=dlimit
endif
if keyword_set(fixed_freq) then begin
for i=0L, n_elements(freq)-1 do begin
power = fltarr(n_elements(site_time),n_elements(height3))
power[*,*] = intensity_all_f2[*,i,*]
if (i mod 10) eq 0 then begin
store_data,'iug_ionosonde_sgk_freq_'+strtrim(string(i/10+2),2)+'MHz',data={x:site_time,y:power,v:height3},dlimit=dlimit
options,'iug_ionosonde_sgk_freq_'+strtrim(string(i/10+2),2)+'MHz',ytitle = 'Height [km]', ztitle = 'Echo power at '+strtrim(string(i/10+2),2)+' [MHz]'
options, 'iug_ionosonde_sgk_freq_'+strtrim(string(i/10+2),2)+'MHz', spec=1
endif
endfor
endif
endif
endif
site_time = 0
aintensity_all_f2 = 0
height3 = 0
new_vars=tnames('iug_ionosonde_sgk_*')
if new_vars[0] ne '' then begin
print,'*****************************
print,'Data loading is successful!!'
print,'*****************************
endif
print, '****************************************************************
print, 'Acknowledgement'
print, '****************************************************************
print, 'If you acquire the ionogram data, we ask that you acknowledge us '
print, 'in your useof the data. This may be done by including text such as '
print, 'the ionogram data provided by Research Institute for Sustainable '
print, 'Humanosphere of Kyoto University. We would also appreciate receiving '
print, 'a copy of the relevant publications. The distribution of ionogram data '
print, 'has been partly supported by the IUGONET (Inter-university Upper '
print, 'atmosphere Global Observation NETwork) project (http://www.iugonet.org/) '
print, 'funded by the Ministry of Education, Culture, Sports, Science and '
print, 'Technology (MEXT), Japan.'
end