Created
March 13, 2014 04:29
-
-
Save codemartial/9521904 to your computer and use it in GitHub Desktop.
A filter to normalise ISO values to the nearest lower standard ISO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
limits = [0, 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200] | |
if __name__ == "__main__": | |
for line in sys.stdin: | |
iso = float(line) | |
print max([x for x in limits if x <= iso]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment