Changeset 3317 for DPPP


Ignore:
Timestamp:
06/02/08 14:54:23 (12 years ago)
Author:
mkochan
Message:

Added enforcement of interpretation of times as UTC times -- in CSML dataset all times should be UTC, and pylab uses local timezone as default. Therefore, to make this code deployable out of UK, we must enforce this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/pylonsstack/pylonsstack/controllers/csmlGrapher.py

    r3316 r3317  
    4343            print 'Feature "%s" (%s) at: (%f,%f)' % (feature.id, feature.description.CONTENT, lon, lat) 
    4444 
     45            def _enforce_UTC_timezone(datestr): 
     46                if datestr[-1] == 'Z': 
     47                    return datestr 
     48                else: 
     49                    return datestr + 'Z' 
    4550            times=feature.value.pointSeriesDomain.timePositionList.CONTENT.split() 
     51            times = map(_enforce_UTC_timezone, times) 
     52                 
    4653            print 'All times (%s of them): '% len(times) 
    4754            print times 
     
    8491            ax.xaxis.set_major_formatter(tickFormatter) 
    8592            fig.autofmt_xdate() 
    86             time_format = '%d-%b-%Y, %H:%M:%S' 
    87             xlabel('Times between %s and %s' % (start_date.strftime(time_format), end_date.strftime(time_format))) 
     93            time_format = '%d-%b-%Y %H:%M:%S UTC' 
     94            xlabel('Times between %s and %s ' % (start_date.strftime(time_format), end_date.strftime(time_format))) 
    8895            ylabel('Values [%s]' % uom) 
    8996            title('"%s" (%s)' % (feature.id, feature.description.CONTENT)) 
    9097            grid(True) 
     98 
     99            print start_date 
     100            print end_date 
    91101 
    92102            # Save the figure to a temporary file 
Note: See TracChangeset for help on using the changeset viewer.