From 314e70faa9920179670663e926780d8f676a0189 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 9 Mar 2020 23:22:34 +0100 Subject: [PATCH] Now got 2 lists with with all data relevant for one photo. --- CHANGELOG.md | 1 + exif_rad.py | 2 ++ functions.py | 6 ------ rad_tag.py | 16 +++++----------- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8c6511..06d4ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/exif_rad.py b/exif_rad.py index 3e4c4be..046ae64 100755 --- a/exif_rad.py +++ b/exif_rad.py @@ -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 diff --git a/functions.py b/functions.py index 25824be..ca347df 100644 --- a/functions.py +++ b/functions.py @@ -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 diff --git a/rad_tag.py b/rad_tag.py index 23aa67f..d2d7db7 100755 --- a/rad_tag.py +++ b/rad_tag.py @@ -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) +