Kolbjorn Bekkelund wrote:
> On Fri, 16 Aug 2002 09:08:42 +0000, Reimar Bauer wrote:
>
>
>> Dear Kolbjorn
>>
>> I was believing that's in idl5.5 the "& $" isn't any more necessary. Am
>> I wrong? Or did you use idl 5.4 ?
>
> You're right !
> I'm using 5.4.
>
>>
>> One more comment to your code. you should use [] for arrays and () for
>> functions. itim(i) is an array. If you always use only () you can get in
>> a conflict if sometimes a variable is named like a function.
>
> I'll tryu to clean it after the functionality is ok. The base of the
> program is remains after some older guys working here earlier. They
> preferred the "manual" way. I'm trying to automate this old program, and
> it works 95 %, but I've got a new problem that I found today when I had
> the system running past midnight. The plot timescale is supposed to be a
> result of the old manual inout of start- and stop time. ie: if I enter 22
> 00 and 03 00, the
> timescale is 22-03.
>
Dear Kolbjorn
this is a more general problem with the handling of time series data.
I speak from a general problem because their might be an easy fix of
this but then you have always later on to do more fixes too.
For example if you like to do some interpolations or comparisions etc.
My suggestion is to use as we do julian seconds for the time.
Julian seconds is based on 2000-01-01 00:00:00 UTC.
It wss defined by Ray Sterner
(http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html)
and he and we too have a lot of routines for this timeforamt.
( http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/idl_work_libraries.htm)
The idea of this is all timeseries data are stored continously.
The advantages is plenty described by Ray.
( http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time_series.html)
This is a small example for a plot
you need the package setup_time_axis and string2js from our library.
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/setup_time_axis.tar.gz
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/jstring2.tar.gz
or as idl 5.5 binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/setup_time_axis.sav
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/js2string.sav
(Remember a idl compiled file with the extension sav is automaticly loaded
the first time it is used. This is the same behaviour as for idl sources
(.pro). They run on each idl platform with the same idl version)
Please have a look for further routines and licensing at
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
Only for my interest, which kind of format is the data you have is it
NASA Ames ?
pro test
x=dindgen(30)*3600.0+string2js(/now)
y=sin(findgen(30)/10.)
tf='DD-MM!CHH:MM'
setup_time_axis, x, XRANGE = xrange, XSTYLE = xstyle, $
XTITLE = 'time UTC', $
XTICKS = xticks, XMINOR = xminor,$
XTICKV = xtickv, XTICKNAME = xtickname, $
TIMEFORMAT = tf, TIMESTEP = ts, NO_DATE = nod
help,xrange,yrange
help,xtickname
help,xtickv
plot,x,y,XRANGE = xrange, XSTYLE = xstyle, XTITLE = 'time UTC', $
XTICKS = xticks, XMINOR = xminor, XTICKV = xtickv, XTICKNAME = xtickname
end
In the description of js2time which is included into the package are the
several time formats descibed.
best regards
Reimar
> With my way of doing it, setting the inputs to fixed 00-24 I get a nice
> timescale of 24 hours, but all files occuring after 24 is not plotted. I
> would really like some help getting that set up right. Any ideas ?
>
> A system where the plot is moving the timescale to the left as soon as it
> hits the upper time limit would be nice. At least I would like to get rid
> of the stupid way is't done now.
>
>> Labels as Label1: are very bad program style in my eyes and the code
>> could be very hard to understand.
>
> As I said above- I'll certainly clean the code in the end !!
> Runtime license is not an option. Economics you see. We've got two server
> licenses soon, so I'll survive.
>
> I've included the whole code below for you to see.
>
> ====================================================
>
> PRO BATCH_CALC_QUALITY_DUAL_ONLINE_AUTO, filnam
> device, decomposed = 0
> loadct, 23
>
> fil_dir = ''
> fil_dir = '/data/ozon/dialdata/ozon-online/*'
> filnam = findfile(fil_dir)
> iff = N_ELEMENTS(filnam)
>
> dummy = ''
> idat = intarr(3) & idat0 = 0 & dat = fltarr(2) & idat1 = lonarr(4)
> ref308 = fltarr(iff) & ref353 = fltarr(iff) & itim = fltarr(iff)
> back308 = fltarr(iff) & back353 = fltarr(iff) & dz = fltarr(iff)
> hr = 0 & min = 0 & stim = 0. & etim = 0.
> hr='00'
> min='00'
> stim = hr + min/60.
> hr='24'
> min='00'
> etim = hr + min/60.
> IF etim LT stim THEN etim = etim + 24.
>
> FOR i = 0, iff-1 DO BEGIN & $
> openr, resf, filnam(i), /get_lun & $
> filnavn=STRMID(filnam(i), 32,5) & $
> FOR j = 0, 5 DO readf, resf, dummy & $
> readf,resf,format = '(a36,i2,1x,i2,1x,i2)',dummy,idat & $
> itim(i) = idat(0) + (idat(1) + idat(2)/60.)/60. & $
> IF itim(i) LT itim(0) THEN itim(i) = itim(i) + 24. & $
> IF itim(i) LT stim OR itim(i) GT etim THEN GOTO, label1 & $
>
> readf, resf, dummy & $
> readf, resf, format = '(a24,i6)', dummy, ishot & $
> FOR j = 0, 5 DO readf, resf, dummy & $
> iback = 0 & $
> WHILE NOT eof(resf) DO BEGIN & $
> readf,resf,idat0,dat,idat1 & $
> IF dat(1) EQ 19.993 THEN BEGIN & $
> dz(i) = dat(0)/1000. & $
> ref308(i) = idat1(0)/dz(i) & $
> ref353(i) = idat1(2)/dz(i) & $
> ENDIF & $
> IF dat(1) GE 85. AND dat(1) LT 87. THEN BEGIN & $
> back308(i) = back308(i) + idat1(0)/dz(i) & $
> back353(i) = back353(i) + idat1(2)/dz(i) & $
> iback = iback + 1 & $
> ENDIF & $
> ENDWHILE & $
> back308(i) = (back308(i)/iback)/ishot & $
> back353(i) = (back353(i)/iback)/ishot & $
>
> ref308(i) = (ref308(i)/ishot)-back308(i) & $
> ref353(i) = (ref353(i)/ishot)-back353(i) & $
> Label1: & $
> free_lun, resf & $
> ENDFOR ; i
>
> dato= systime()
>
> !p.multi = [0,1,2]
>
> window, 0, xsize=800, ysize=600, title='ALOMAR Ozone Lidar Combined
> Signal/Background Count'
> usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ], color=166, /fill
> ; filled downward triangle
> plot_io, itim, ref308, psym = 8, color=119, yrange = [0.001, 200.],
> yticklen=1, ygridstyle=2, ystyle = 1, xstyle = 1, $
> xrange = [stim,etim],xtitle = 'Time printed [UT]: '+ dato +'', title =
> 'Signal at 19.993 km ' + filnavn
> axis, yaxis = 0, color=119, yrange = [0.001, 200.], ystyle = 1, $
> xrange = [stim,etim],ytitle = 'normalized countrate [cts/km.shot]'
> usersym, [ -1, 0, 1, -1 ], [ -1, 1, -1, -1 ], color=217, /fill
> ; filled upward triangle
> oplot,itim,ref353,psym = 8
>
> ;xyouts, 460, 450, 'Green: 308 nm', /device
> ;xyouts, 460, 460, 'Yellow: 353 nm', /device
>
> usersym, [ -1, 0, 1, -1 ], [ -1, 1, -1, -1 ], color=217, /fill
> ; filled upward triangle
> plot_io, itim, back353, psym = 8, color=119, yrange = [1e-5,
> 100],yticklen=1, ygridstyle=2, ystyle = 1, xstyle = 1, $
> xrange = [stim,etim],xtitle = 'Time printed [UT]: '+ dato +'', title =
> 'Background on ' + filnavn + ', 85 - 87 km', $ ytitle = 'normalized
> countrates [cts/km.shot]'
>
> usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ], color=166, /fill
> ; filled downward triangle
> oplot,itim,back308,psym = 8
>
> ;xyouts, 460, 450, 'Green: 308 nm', /device
> ;xyouts, 460, 460, 'Yellow: 353 nm', /device
>
> write_png, '/data/ozon/plots/latest-combined.png', tvrd(/true)
>
> close,/all
> exit, status=45
> END
>
> ====================================================
>
>
> Best regards,
> Kolbjorn
>
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|