Now got 2 lists with with all data relevant for one photo.

This commit is contained in:
Marcus Scholz 2020-03-09 23:22:34 +01:00
parent a2ae379883
commit 314e70faa9
4 changed files with 8 additions and 17 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added optional dry-run modifier
- Made timezone-aware for timesources without timezone
- Added optional parameter to override timezone to local timezone, defaults to localtime
- Swith to oop style programming. Made code easier to read.
## [0.2] - 2020-02-05
### Added

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is now obsolete and is going to disappear.
"""Iterates over a bunch of .jpg or .cr2 files and matches
DateTimeOriginal from Exif tag to DateTime in a csv log
of a GeigerMuellerCounter and writes its value to the UserComment

View File

@ -23,9 +23,3 @@ class Radiation:
# Convert CP/M to µS/h using si_factor
radiation = round(float(radiation) * si_factor, 2)
return radiation
class Position:
def __init__(self, timestamp, latitude, longitude):
self.timestamp = timestamp
self.latitude = latitude
self.longitude = longitude

View File

@ -102,7 +102,7 @@ for srcphoto in args.photos:
for _, csvrawtime, csvrawcpm, _ in csvreader:
radiation = Radiation(csvrawtime, csvrawcpm, local_timezone, args.sifactor)
radiation_list.append(radiation)
print(radiation_list)
#print(radiation_list)
# close CSV file
f.close()
@ -116,13 +116,7 @@ for srcphoto in args.photos:
for track in gpxreader.tracks:
for segment in track.segments:
for point in segment.points:
# datetimes match with 1 minute precision
delta = timedelta(seconds=60)
if abs(point.time - pictime) < delta:
valuelist = []
row = [point.time - pictime, point.latitude, point.longitude]
valuelist.append(row)
print(valuelist)
min(valuelist[0][0])
#print(pictime, 'vs.', point.time, 'Delta:', pictime - point.time)
# print('Point at ({0},{1}) -> {2}'.format(point.latitude, point.longitude, point.time))
position = [point.time, point.latitude, point.longitude]
position_list.append(position)
#print(position_list)