pro iug_load_mu_iono_drift_nc, downloadonly = downloadonly, $
trange = trange, $
verbose = verbose
if (not keyword_set(verbose)) then verbose=2
h=0L
site_time=0
if ~size(fns,/type) then begin
file_names = file_dailynames(file_format='YYYY/YYYYMMDD',trange=trange,times=times,/unique)+'_drift.nc'
source = file_retrieve(/struct)
source.verbose=verbose
source.local_data_dir = root_data_dir() + 'iugonet/rish/misc/sgk/mu/ionosphere/drift/nc/'
source.remote_data_dir = 'http://www.rish.kyoto-u.ac.jp/mu/isdata/data/drift/netcdf/'
local_paths=file_retrieve(file_names,_extra=source, /last_version)
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
for h=0L,n_elements(local_paths)-1 do begin
file= local_paths[h]
if file_test(/regular,file) then dprint,'Loading the ionosphere data estimated from the incoherent scatter observation of the MU radar: ',file $
else begin
dprint,'The ionosphere data estimated from the incoherent scatter observation of the MU radar ',file,' not found. Skipping'
continue
endelse
cdfid = ncdf_open(file,/NOWRITE)
glob = ncdf_inquire( cdfid )
print,'Dimensions', glob.ndims
for i=0L,glob.ndims-1 do begin
ncdf_diminq, cdfid, i, name,size
if i EQ glob.recdim then $
print,' ', name, size, '(Unlimited dim)' $
else $
print,' ', name, size
endfor
print
print, 'Variables'
for m=0L,glob.nvars-1 do begin
info = ncdf_varinq(cdfid, m)
FmtStr = '(A," (",A," ) Dimension Ids = [ ", 10(I0," "),$)'
print, FORMAT=FmtStr, info.name,info.datatype, info.dim[*]
print, ']'
for l=0L,info.natts-1 do begin
attname = ncdf_attname(cdfid,m,l)
ncdf_attget,cdfid,m,attname,attvalue
print,' Attribute ', attname, '=', string(attvalue)
if (info.name eq 'time') and (attname eq 'units') then time_data=string(attvalue)
endfor
endfor
time_info=strsplit(time_data,' ',/extract)
syymmdd=time_info[2]
shhmmss=time_info[3]
time_diff=strsplit(time_info[4],':',/extract)
time_diff2=fix(time_diff[0])*3600+fix(time_diff[1])*60
ncdf_varget, cdfid, 'lat', lat
ncdf_varget, cdfid, 'lon', lon
ncdf_varget, cdfid, 'obsdate', obsdate
ncdf_varget, cdfid, 'beam', beam
ncdf_varget, cdfid, 'az', az
ncdf_varget, cdfid, 'ze', ze
ncdf_varget, cdfid, 'time', time
ncdf_varget, cdfid, 'Vperp_e', Vperp_e
ncdf_varget, cdfid, 'Vperp_n', Vperp_n
ncdf_varget, cdfid, 'Vpara_u', Vpara_u
ncdf_varget, cdfid, 'Vz_ns', Vz_ns
ncdf_varget, cdfid, 'Vz_ew', Vz_ew
ncdf_varget, cdfid, 'Vd_b', Vd_b
unix_time = dblarr(n_elements(time))
for i=0L, n_elements(time)-1 do begin
unix_time[i] = double(time[i])+time_double(syymmdd+'/'+shhmmss)-time_diff2
a = Vperp_e[i]
wbad = where(a eq 999.0,nbad)
if nbad gt 0 then a[wbad] = !values.f_nan
Vperp_e[i] =a
b = Vperp_n[i]
wbad = where(b eq 999.0,nbad)
if nbad gt 0 then b[wbad] = !values.f_nan
Vperp_n[i] =b
c = Vpara_u[i]
wbad = where(c eq 999.0,nbad)
if nbad gt 0 then c[wbad] = !values.f_nan
Vpara_u[i] =c
d = Vz_ns[i]
wbad = where(d eq 999.0,nbad)
if nbad gt 0 then d[wbad] = !values.f_nan
Vz_ns[i] =d
e = Vz_ew[i]
wbad = where(e eq 999.0,nbad)
if nbad gt 0 then e[wbad] = !values.f_nan
Vz_ew[i] =e
for k=0L, n_elements(beam)-1 do begin
f = Vd_b[i,k]
wbad = where(f eq 999.0,nbad)
if nbad gt 0 then f[wbad] = !values.f_nan
Vd_b[i,k] =f
endfor
endfor
append_array, site_time, unix_time
append_array, Vperp_e_app, Vperp_e
append_array, Vperp_n_app, Vperp_n
append_array, Vpara_u_app, Vpara_u
append_array, Vz_ns_app, Vz_ns
append_array, Vz_ew_app, Vz_ew
append_array, Vd_b_app, Vd_b
ncdf_close,cdfid
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 ' $
+ '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.'
if size(Vperp_e_app,/type) eq 4 then begin
dlimit=create_struct('data_att',create_struct('acknowledgment',acknowledgstring,'PI_NAME', 'Y. Otsuka'))
store_data,'iug_mu_iono_Vperp_e',data={x:site_time, y:Vperp_e_app},dlimit=dlimit
options,'iug_mu_iono_Vperp_e',ytitle='MU-iono!CVperp_e!C[m/s]'
store_data,'iug_mu_iono_Vperp_n',data={x:site_time, y:Vperp_n_app},dlimit=dlimit
options,'iug_mu_iono_Vperp_n',ytitle='MU-iono!CVperp_n!C[m/s]'
store_data,'iug_mu_iono_Vpara_u',data={x:site_time, y:Vpara_u_app},dlimit=dlimit
options,'iug_mu_iono_Vpara_u',ytitle='MU-iono!CVpara_u!C[m/s]'
store_data,'iug_mu_iono_Vz_ns',data={x:site_time, y:Vz_ns_app},dlimit=dlimit
options,'iug_mu_iono_Vz_ns',ytitle='MU-iono!CVz_ns!C[m/s]'
store_data,'iug_mu_iono_Vz_ew',data={x:site_time, y:Vz_ew_app},dlimit=dlimit
options,'iug_mu_iono_Vz_ew',ytitle='MU-iono!CVz_ew!C[m/s]'
store_data,'iug_mu_iono_Vd_b',data={x:site_time, y:Vd_b_app},dlimit=dlimit
options,'iug_mu_iono_Vd_b',ytitle='MU-iono!CVd_b!C[m/s]'
endif
site_time=0
Vperp_e_app=0
Vperp_n_app=0
Vpara_u_app=0
Vz_ew_app=0
Vz_ns_app=0
Vd_b_app=0
tdegap, 'iug_mu_iono_Vperp_e',dt=3600,/overwrite
tdegap, 'iug_mu_iono_Vperp_n',dt=3600,/overwrite
tdegap, 'iug_mu_iono_Vpara_u',dt=3600,/overwrite
tdegap, 'iug_mu_iono_Vz_ew',dt=3600,/overwrite
tdegap, 'iug_mu_iono_Vz_ns',dt=3600,/overwrite
tdegap, 'iug_mu_iono_Vd_b',dt=3600,/overwrite
endif
new_vars=tnames('iug_mu_iono_V*')
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 ionogram 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