From: <ai...@us...> - 2009-04-29 15:42:29
|
Revision: 9865 http://plplot.svn.sourceforge.net/plplot/?rev=9865&view=rev Author: airwin Date: 2009-04-29 15:42:02 +0000 (Wed, 29 Apr 2009) Log Message: ----------- Revert temporarily to revision 9644 for the release so that the python results match the C results. The post-release plan is to bring back revision 9662 with its extra pages to test the new time API, add some additional pages to expand those tests, then propagate the expanded example to C and the rest of the languages we support. Revision Links: -------------- http://plplot.svn.sourceforge.net/plplot/?rev=9644&view=rev http://plplot.svn.sourceforge.net/plplot/?rev=9662&view=rev Modified Paths: -------------- trunk/examples/python/xw29.py Modified: trunk/examples/python/xw29.py =================================================================== --- trunk/examples/python/xw29.py 2009-04-29 04:46:02 UTC (rev 9864) +++ trunk/examples/python/xw29.py 2009-04-29 15:42:02 UTC (rev 9865) @@ -48,9 +48,7 @@ plot3() - plot4() - # Plot a model diurnal cycle of temperature def plot1(): @@ -172,110 +170,4 @@ plpoin(x, y, 2) plline(x, y) -def plot4(): - - # TAI-UTC (seconds) as a function of time. - # Use Besselian epochs as the continuous time interval just to prove - # this does not introduce any issues. - - # Use the definition given in http://en.wikipedia.org/wiki/Besselian_epoch - # - # B = 1900. + (JD -2415020.31352)/365.242198781 - # ==> (as calculated with aid of "bc -l" command) - # B = (MJD + 678940.364163900)/365.242198781 - # ==> - # MJD = B*365.24219878 - 678940.364163900 - scale = 365.242198781 - offset1 = -678940. - offset2 = -0.3641639 - plconfigtime(scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0.) - - for kind in range(7): - if kind == 0: - xmin = plctime(1950,0,2,0,0,0.) - xmax = plctime(2020,0,2,0,0,0.) - npts = 70*12 + 1 - ymin = 0.0 - ymax = 36.0 - time_format = "%Y%" - if_TAI_time_format = True - title_suffix = "from 1950 to 2020" - xtitle = "Year" - xlabel_step = 10. - elif kind == 1 or kind ==2: - xmin = plctime(1961,7,1,0,0,1.64757-.20) - xmax = plctime(1961,7,1,0,0,1.64757+.20) - npts = 1001 - ymin = 1.625 - ymax = 1.725 - time_format = "%S%2%" - title_suffix = "near 1961-08-01 (TAI)" - xlabel_step = 0.05/(scale*86400.) - if kind == 1: - if_TAI_time_format = True - xtitle = "Seconds (TAI)" - else: - if_TAI_time_format = False - xtitle = "Seconds (TAI) labelled with corresponding UTC" - elif kind == 3 or kind ==4: - xmin = plctime(1963,10,1,0,0,2.6972788-.20) - xmax = plctime(1963,10,1,0,0,2.6972788+.20) - npts = 1001 - ymin = 2.55 - ymax = 2.75 - time_format = "%S%2%" - title_suffix = "near 1963-11-01 (TAI)" - xlabel_step = 0.05/(scale*86400.) - if kind == 3: - if_TAI_time_format = True - xtitle = "Seconds (TAI)" - else: - if_TAI_time_format = False - xtitle = "Seconds (TAI) labelled with corresponding UTC" - elif kind == 5 or kind == 6: - xmin = plctime(2009,0,1,0,0,34.-5.) - xmax = plctime(2009,0,1,0,0,34.+5.) - npts = 1001 - ymin = 32.5 - ymax = 34.5 - time_format = "%S%2%" - title_suffix = "near 2009-01-01 (TAI)" - xlabel_step = 1./(scale*86400.) - if kind == 5: - if_TAI_time_format = True - xtitle = "Seconds (TAI)" - else: - if_TAI_time_format = False - xtitle = "Seconds (TAI) labelled with corresponding UTC" - - i = arange(npts) - x = xmin + i*(xmax-xmin)/float(npts-1) - y = zeros(npts) - for j in range(npts): - plconfigtime(scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0.) - tai = x[j] - (tai_year, tai_month, tai_day, tai_hour, tai_min, tai_sec) = plbtime(tai) - plconfigtime(scale, offset1, offset2, 0x2, 0, 0, 0, 0, 0, 0, 0.) - (utc_year, utc_month, utc_day, utc_hour, utc_min, utc_sec) = plbtime(tai) - plconfigtime(scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0.) - utc = plctime(utc_year, utc_month, utc_day, utc_hour, utc_min, utc_sec) - y[j]=(tai-utc)*scale*86400. - - pladv(0) - plvsta() - plwind(xmin, xmax, ymin, ymax) - plcol0(1) - if if_TAI_time_format: - plconfigtime(scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0.) - else: - plconfigtime(scale, offset1, offset2, 0x2, 0, 0, 0, 0, 0, 0, 0.) - pltimefmt(time_format) - plbox("bcnstd", xlabel_step, 0, "bcnstv", 0., 0) - plcol0(3) - pllab(xtitle, "TAI-UTC (sec)", "@frPLplot Example 29 - TAI-UTC " + title_suffix) - - plcol0(4) - - plline(x, y) - main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |