PRO read_ask_ascii_nipr, filename, tvec, keodata
ndata=86400L
keodata=dblarr(ndata, 60)
tvec=dblarr(ndata)
tstr = {time_structr,year:0,month:0,date:0,hour:0,min:0,sec:0, $
fsec:0, daynum:0l,doy:0,dow:0,sod:!values.d_nan, $
dst:0,tzone:0,tdiff:0}
dumm=' '
yyyymmdd=0L
hhmmss=0L
keo=fltarr(60)
openr, lun, filename, /get_lun
readf, lun, dumm
readf, lun, dumm
i=0L
while(not EOF(lun)) do begin
readf, lun, yyyymmdd, hhmmss, keo
tstr.year=fix(yyyymmdd/10000.)
tstr.month=fix((yyyymmdd-tstr.year*10000L)/100.)
tstr.date=fix(yyyymmdd-tstr.year*10000L-tstr.month*100L)
tstr.hour=fix(hhmmss/10000.)
tstr.min=fix((hhmmss-tstr.hour*10000L)/100.)
tstr.sec=fix(hhmmss-tstr.hour*10000L-tstr.min*100L)
tvec[i]=time_double(tstr)
keodata[i, *]=double(keo)
i++
endwhile
free_lun, lun
tvec=tvec[0:i-1]
keodata=reverse(keodata[0:i-1, *], 2)
END
pro iug_load_ask_nipr, site = site, downloadonly=downloadonly
if ~keyword_set(verbose) then verbose=0
vsnames = 'tro lyr'
vsnames_all = strsplit(vsnames, ' ', /extract)
if(keyword_set(site)) then site_in = site else site_in = 'all'
sites = thm_check_valid_name(site_in, vsnames_all, $
/ignore_case, /include_all)
if sites[0] eq '' then return
nsites = n_elements(sites)
acknowledgstring = 'The optical data are the intellectual property of National '$
+ 'Institute of Polar Research, JAPAN. They may be freely used for the purpose '$
+ 'of illustration for teaching and for non-commercial scientific research, '$
+ 'provided that the source is acknowledged. Substantial use of the data should '$
+ 'be discussed at an early stage with the PI of each instrument. NIPR receachers '$
+ 'are hoping collaborative studies and fluitful scientific outputs using these '$
+ 'data. The distribution of the optical data from NIPR 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.'
instr='ask'
for i=0, nsites-1 do begin
pathformat= sites[i] + '/awi/ascii/YYYYMM/' + $
sites[i] + '_awi_YYYYMMDD_hh.txt'
relpathnames = file_dailynames(file_format=pathformat, trange=trange, /hour_res)
source = file_retrieve(/struct)
source.verbose = verbose
source.local_data_dir = root_data_dir() + 'iugonet/nipr/'+instr+'/'
source.remote_data_dir = 'http://pc115.seg20.nipr.ac.jp/www/optical/watec/'
local_files = file_retrieve(relpathnames, _extra=source)
if keyword_set(downloadonly) then continue
for j=0,n_elements(local_files)-1 do begin
file = local_files[j]
if file_test(/regular,file) then begin
dprint,'Loading data file: ', file
fexist = 1
endif else begin
dprint,'Data file ',file,' not found. Skipping'
continue
endelse
read_ask_ascii_nipr, file, tvec, keodata
append_array, databuf, keodata
append_array, timebuf, tvec
endfor
if size(databuf,/type) eq 5 then begin
print_str_maxlet, acknowledgstring
tplot_name = 'iug_ask_' + strlowcase(sites[i])
wbad = where(finite(databuf) eq -99, nbad)
if nbad gt 0 then databuf[wbad] = !values.f_nan
dlimit=create_struct('data_att',create_struct('acknowledgment', acknowledgstring))
case sites[i] of
'tro' : begin
vdata=-70.+findgen(60)*2.4
end
'lyr' : begin
vdata=-65.+findgen(60)*2.4
end
endcase
store_data, tplot_name, data={x:timebuf, y:databuf, v:vdata}, dlimit=dlimit
options, tplot_name, ytitle = sites[i]+'!CN-S Keogram', ysubtitle='[deg]', $
spec=1, ztitle = '[Counts]'
case sites[i] of
'tro' : begin
ylim, tplot_name, -90, 90, 0
end
'lyr' : begin
ylim, tplot_name, -90, 90, 0
end
endcase
endif
databuf = 0
timebuf = 0
endfor
end