pro iug_load_mu_meso_nc, level = level, $
downloadonly=downloadonly, $
trange=trange, $
verbose=verbose
if (not keyword_set(verbose)) then verbose=2
level_all = strsplit('org scr',' ', /extract)
if (not keyword_set(level)) then level='all'
levels = thm_check_valid_name(level, level_all, /ignore_case, /include_all)
print, levels
for ii=0L, n_elements(levels)-1 do begin
if ~size(fns,/type) then begin
file_names = file_dailynames( $
file_format='YYYY/YYYYMM/'+$
'YYYYMMDD',trange=trange,times=times,/unique)+'.nc'
source = file_retrieve(/struct)
source.verbose=verbose
source.local_data_dir = root_data_dir() + 'iugonet/rish/misc/sgk/mu/mesosphere/nc/'
source.remote_data_dir = 'http://www.rish.kyoto-u.ac.jp/mu/mesosphere/data/netcdf/'
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
mu_time = 0
pwr1 = 0
wdt1 = 0
dpl1 = 0
if_cond = 0
pn1 = 0
for j=0L,n_elements(local_paths)-1 do begin
file= local_paths[j]
if file_test(/regular,file) then dprint,'Loading the mesosphere observation data taken by the MU radar: ',file $
else begin
dprint,'The mesosphere observation data taken by 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, 'sealvl', sealvl
ncdf_varget, cdfid, 'bmwdh', bmwdh
ncdf_varget, cdfid, 'beam', beam
ncdf_varget, cdfid, 'range', range
ncdf_varget, cdfid, 'az', az
ncdf_varget, cdfid, 'ze', ze
ncdf_varget, cdfid, 'date', date
ncdf_varget, cdfid, 'time', time
ncdf_varget, cdfid, 'height_v', height_v
ncdf_varget, cdfid, 'height_mz', height_mz
ncdf_varget, cdfid, 'pwr', pwr
ncdf_varget, cdfid, 'wdt', wdt
ncdf_varget, cdfid, 'dpl', dpl
ncdf_varget, cdfid, 'if_cond', if_cond
ncdf_varget, cdfid, 'pnoise', pnoise
year = fix(strmid(strtrim(string(date),1),0,4))
month = fix(strmid(strtrim(string(date),1),4,2))
day = fix(strmid(strtrim(string(date),1),6,2))
unix_time = dblarr(n_elements(time))
pwr1_mu=fltarr(n_elements(time),n_elements(range),n_elements(beam))
wdt1_mu=fltarr(n_elements(time),n_elements(range),n_elements(beam))
dpl1_mu=fltarr(n_elements(time),n_elements(range),n_elements(beam))
if_cond_mu=lonarr(n_elements(time),n_elements(range),n_elements(beam))
pnoise1_mu=fltarr(n_elements(time),n_elements(beam))
for i=0L, n_elements(time)-1 do begin
unix_time[i] = double(time[i]) +time_double(string(year)+'-'+string(month)+'-'+string(day)+'/'+'00:00:00')-time_diff2
for k=0L, n_elements(range)-1 do begin
for l=0L, n_elements(beam)-1 do begin
a = if_cond[i,k,l]
if levels[ii] eq 'scr' then begin
if a gt 4 then begin
pwr[i,k,l] = !values.f_nan
wdt[i,k,l] = !values.f_nan
dpl[i,k,l] = !values.f_nan
endif
endif
pwr1_mu[i,k,l]=pwr[i,k,l]
wdt1_mu[i,k,l]=wdt[i,k,l]
dpl1_mu[i,k,l]=dpl[i,k,l]
pnoise1_mu[i,l]=pnoise[i,l]
endfor
endfor
endfor
append_array, mu_time, unix_time
append_array, pwr1, pwr1_mu
append_array, wdt1, wdt1_mu
append_array, dpl1, dpl1_mu
append_array, pn1, pnoise1_mu
ncdf_close,cdfid
endfor
if n_elements(mu_time) gt 1 then begin
height = fltarr(n_elements(range),n_elements(beam))
bname2=strarr(n_elements(beam))
bname=strarr(n_elements(beam))
pwr2_mu=fltarr(n_elements(mu_time),n_elements(range))
wdt2_mu=fltarr(n_elements(mu_time),n_elements(range))
dpl2_mu=fltarr(n_elements(mu_time),n_elements(range))
pnoise2_mu=fltarr(n_elements(mu_time))
height[*,0] = height_v
height[*,1] = height_mz
height[*,2] = height_mz
height[*,3] = height_mz
height[*,4] = height_mz
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.'
if size(dpl1,/type) eq 4 then begin
dlimit=create_struct('data_att',create_struct('acknowledgment',acknowledgstring,'PI_NAME', 'T. Nakamura'))
for l=0L, n_elements(beam)-1 do begin
bname2[l]=string(beam[l]+1)
bname[l]=strsplit(bname2[l],' ', /extract)
for i=0L, n_elements(mu_time)-1 do begin
for k=0L, n_elements(range)-1 do begin
pwr2_mu[i,k]=pwr1[i,k,l]
endfor
endfor
store_data,'iug_mu_meso_pwr'+bname[l]+'_'+levels[ii],data={x:mu_time, y:pwr2_mu, v:height[*,l]},dlimit=dlimit
new_vars=tnames('iug_mu_meso_pwr*')
if new_vars[0] ne '' then begin
options,'iug_mu_meso_pwr'+bname[l]+'_'+levels[ii],ytitle='MUR-meso!CHeight!C[km]',ztitle='pwr'+bname[l]+'-'+levels[ii]+'!C[dB]'
options, 'iug_mu_meso_pwr'+bname[l]+'_'+levels[ii],'spec',1
endif
for i=0L, n_elements(mu_time)-1 do begin
for k=0L, n_elements(range)-1 do begin
wdt2_mu[i,k]=wdt1[i,k,l]
endfor
endfor
store_data,'iug_mu_meso_wdt'+bname[l]+'_'+levels[ii],data={x:mu_time, y:wdt2_mu, v:height[*,l]},dlimit=dlimit
new_vars=tnames('iug_mu_meso_wdt*')
if new_vars[0] ne '' then begin
options,'iug_mu_meso_wdt'+bname[l]+'_'+levels[ii],ytitle='MUR-meso!CHeight!C[km]',ztitle='wdt'+bname[l]+'-'+levels[ii]+'!C[m/s]'
options, 'iug_mu_meso_wdt'+bname[l]+'_'+levels[ii],'spec',1
endif
for i=0L, n_elements(mu_time)-1 do begin
for k=0L, n_elements(range)-1 do begin
dpl2_mu[i,k]=dpl1[i,k,l]
endfor
endfor
store_data,'iug_mu_meso_dpl'+bname[l]+'_'+levels[ii],data={x:mu_time, y:dpl2_mu, v:height[*,l]},dlimit=dlimit
new_vars=tnames('iug_mu_meso_dpl*')
if new_vars[0] ne '' then begin
options,'iug_mu_meso_dpl'+bname[l]+'_'+levels[ii],ytitle='MUR-meso!CHeight!C[km]',ztitle='dpl'+bname[l]+'-'+levels[ii]+'!C[m/s]'
options, 'iug_mu_meso_dpl'+bname[l]+'_'+levels[ii],'spec',1
endif
for i=0L, n_elements(mu_time)-1 do begin
pnoise2_mu[i]=pn1[i,l]
endfor
store_data,'iug_mu_meso_pn'+bname[l]+'_'+levels[ii],data={x:mu_time, y:pnoise2_mu},dlimit=dlimit
new_vars=tnames('iug_mu_meso_pn*')
if new_vars[0] ne '' then begin
options,'iug_mu_meso_pn'+bname[l]+'_'+levels[ii],ytitle='MUR-meso!Cpn'+bname[l]+'!C[dB]'
endif
endfor
endif
new_vars=tnames('iug_mu_meso_*')
if new_vars[0] ne '' then begin
print,'******************************
print,'Data loading is successful!!'
print,'******************************
endif
endif
endif
mu_time=0
pwr1 = 0
wdt1 = 0
dpl1 = 0
pn1 = 0
pwr2_mu = 0
wdt2_mu = 0
dpl2_mu = 0
pnoise2_mu = 0
endfor
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