Add support to TIF for RAISE flat-field

This commit is contained in:
Benjamin Loison 2024-04-26 01:49:13 +02:00
parent ab72da470e
commit f5c235c3cd
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -16,16 +16,13 @@ names = []
dates = []
for fileName in sorted(os.listdir()):
#print(fileName)
if fileName.endswith('.JPG'):
image = Image.open(fileName)
imageExif = image.getexif()
dateTimeKey = list(TAGS.keys())[list(TAGS.values()).index('DateTime')]
dateTime = imageExif[dateTimeKey]
#print(dateTime)
names += [fileName.replace('DSC0', '').replace('.JPG', '')]
dates += [dateTime]
#break
image = Image.open(fileName)
imageExif = image.getexif()
#print(imageExif)
dateTimeKey = list(TAGS.keys())[list(TAGS.values()).index('DateTime')]
dateTime = imageExif[dateTimeKey]
names += [fileName.replace('DSC0', '').replace('.JPG', '')]
dates += [dateTime[:(-1 if fileName.endswith('.tif') else 0)]]
# Convert date strings to datetime
dates = [datetime.strptime(d, "%Y:%m:%d %H:%M:%S") for d in dates]