Sunday, July 19, 2020

Python Program to Calculate Exposure Value from Aperture and Shutter Speed [Free Code]

ev = [[-4,-3,-2,-1,0,1,2,3,4,5,6],[-3,-2,-1,0,1,2,3,4,5,6,7],[-2,-1,0,1,2,3,4,5,6,7,8],[-1,0,1,2,3,4,5,6,7,8,9],[0,1,2,3,4,5,6,7,8,9,10]
,[1,2,3,4,5,6,7,8,9,10,11],[2,3,4,5,6,7,8,9,10,11,12],[3,4,5,6,7,8,9,10,11,12,13],[4,5,6,7,8,9,10,11,12,13,14],[5,6,7,8,9,10,11,12,13,14,15]
,[6,7,8,9,10,11,12,13,14,15,16],[7,8,9,10,11,12,13,14,15,16,17],[8,9,10,11,12,13,14,15,16,17,18],[9,10,11,12,13,14,15,16,17,18,19]
,[10,11,12,13,14,15,16,17,18,19,20],[11,12,13,14,15,16,17,18,19,20,21]]
#for r in ev:
# for c in r:
# print(c,end = " ")
# print()

print("""
Enter Shutter Speed as number specified in the table
15.0 0
8 1
4 2
2 3
1 4
1/2 5
1/4 6
1/8 7
1/15 8
1/30 9
1/60 10
1/125 11
1/250 12
1/500 13
1/1000 14
1/2000 15
""")
s = int(input(": "))


print("""
Enter Aperture as number specified in the table
f1.0 0
f1.4 1
f2 2
f2.8 3
f4 4
f5.6 5
f8 6
f11 7
f16 8
f22 9
f32 10

""")
a = int(input(": "))
uev = ev[s][a]
print("Your Exposure Value is ", uev)
if uev < 0 :
print(" Your Image is likely to be Underexposed")
elif uev > 4 :
print(" Your Image is likely to be Overexposed")
else:
print(" You might just get a good shot")