Commit ee2c6476 authored by Stefano Costa's avatar Stefano Costa 👷

Initial import

parents
import datetime
import os
import sqlite3
from os.path import join
from gi.repository import GExiv2, GLib
exif = GExiv2.Metadata()
def expowalk(dirname):
for directory, dirnames, filenames in os.walk(dirname):
for f in filenames:
try:
exif.open_path(join(directory, f))
except GLib.Error:
pass
else:
expotime_n, expotime_d = exif.get_exposure_time()
try:
expotime = expotime_n / expotime_d
except ZeroDivisionError:
pass
else:
try:
expodatetime = datetime.datetime.strptime(exif.get_tag_string('Exif.Image.DateTime'), '%Y:%m:%d %H:%M:%S')
except TypeError:
pass
else:
print('{};{}'.format(expotime, expodatetime))
if __name__ == '__main__':
expowalk('/home/steko/Immagini/')
library(ggplot2)
expotime = read.csv("expotime.csv", sep=";", colClasses=c("numeric", "POSIXct"), col.names=c("expotime", "datetime"))
expotime$hour <- as.numeric(sapply(expotime$datetime, strftime, format="%H"))
ggplot(expotime, aes(hour, 1/expotime)) + geom_point(alpha=0.1, position="jitter") + scale_y_log10() + theme_bw()
ggsave("expotime.png")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment