NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 114

Show
Ignore:
Timestamp:
02/15/08 12:35:01
Author:
jcleary
Message:

Added use of epoch for UTC sample time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • raw2proc/trunk/raw2proc/proc_jpier_ascii_met.py

    r113 r114  
    3333from procutil import * 
    3434from ncutil import * 
     35import time 
    3536 
    3637now_dt = datetime.utcnow() 
     
    6364                # assign specific fields 
    6465                n = len(tws) 
    65                 # get sample datetime from data 
    66                 sample_str = '%04d-%02d-%02d %04d:00' % tuple(tws[0:4]) 
    67                 sample_dt = scanf_datetime(sample_str, fmt='%Y-%m-%d %H%M:%S') 
    68                 #   datetime(*strptime(sample_str, "%y-%m-%d %H:%M:%S")[0:6]) 
     66 
     67                # get sample datetime in UTC from data 
     68                # use epoch tws[4] to get time in UTC 
     69                sample_str = '%04d-%02d-%02d %02d:%02d:00' % tuple(time.gmtime(float(tws[4]))[0:5]) 
     70                sample_dt = scanf_datetime(sample_str, fmt='%Y-%m-%d %H:%M:%S') 
    6971 
    7072                air_temp = tws[5]          # Air Temperature (deg F)