-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check which timestamps are correct! #110
Comments
Me too. Pain in the *ss. |
It was using `fromtimestamp` which 'returns the local date and time'. The `utcfromtimestamp` returns a UTC datetime. This probably explains the reason for the inconsistency seen in #110.
Probably fixed with 2fd6331, but may need to reprocess all configs. |
Currently the time shown in http://data.hisparc.nl/api/station/510/config/ is wrong. |
I checked one of the returned timestamps (with the current method of |
Not entirely fixed yet. |
Can Perhaps be fixed by adding: from django.utils import timezone
[...].replace(tzinfo=timezone.utc) where [...] is the datetime object from a configuration.timestamp.. |
I checked if the timestamps in the GPS Source TSV from station 501 are equal to those in the raw datastore. Most match, several can not be found, and some recent configs do not match. The following script was used (can be used for other stations): from sapphire.transformations.clock import gps_to_datetime
from sapphire import Station
import tables
station_number = 501
station = Station(station_number)
cluster = station.cluster().lower()
timestamps = station.gps_locations['timestamp']
node_path = '/hisparc/cluster_%s/station_%d' % (cluster, station_number)
for ts in timestamps:
path = gps_to_datetime(ts).strftime('%Y/%-m/%Y_%-m_%-d.h5')
with tables.open_file(path, 'r') as data:
try:
cts = data.get_node(node_path, 'config').col('timestamp')
except:
print ts, 'No source found'
continue
if not ts in cts:
print ts, cts |
I've recently seen issues with incorrect timestamps in TSV sources, possibly because the server is now running in Mountain Time in Utah, the offsets are about 7-8 hours offset. |
When switching the way the timestamps are created in the csv files, from
calendar.timegm(date.utctimetuple())
to{{ date|date:'U' }}
the timestamps changed!It just so happens to have changed the timestamps by either 3600 or 7200 seconds (UTC +1 and +2, i.e. the timezone and DST in the Netherlands). I will check which one was the correct one..
P.S. I hate timezones and DST.
The text was updated successfully, but these errors were encountered: