Skip to content

Instantly share code, notes, and snippets.

@optedoblivion
Created September 21, 2018 01:14
Show Gist options
  • Save optedoblivion/c80b86b5252285d7d580a88d5f391cc7 to your computer and use it in GitHub Desktop.
Save optedoblivion/c80b86b5252285d7d580a88d5f391cc7 to your computer and use it in GitHub Desktop.
"""
Save as calculate_compound_fps.py
run it in the terminal
$ python calculate_compound_fps.py
$ python calculate_compound_fps.py 340 64 28 420
"""
#!/usr/bin/env python
import sys
BOW_DEFAULT_ADVERTISED_FPS = 320
IBO_DEFAULT_DRAW_WEIGHT_LBS = 70
IBO_DEFAULT_DRAW_LENGTH_INCHES = 30
IBO_DEFAULT_ARROW_GRAIN = 350
AVERAGE_DEFAULT_DRAW_WEIGHT_LBS = 60
AVERAGE_DEFAULT_DRAW_LENGTH_INCHES = 28
AVERAGE_DEFAULT_ARROW_GRAIN = 425
def main(advertised_fps, draw_weight_lbs, draw_length_inches, arrow_grain):
fps_lost = 0
# Lose 10 FPS for every inch of draw length lost
fps_lost += (IBO_DEFAULT_DRAW_LENGTH_INCHES - draw_length_inches) * 10
# Lose 15-20 FPS for every 10lbs. weight dropped
# Since you lose 15-20 FPS, I used 18 which is right in the middle
fps_lost += ((IBO_DEFAULT_DRAW_WEIGHT_LBS - draw_weight_lbs) / 10) * 18
# Every extra 5 grain is 1.5 FPS lost
fps_lost += ((arrow_grain - IBO_DEFAULT_ARROW_GRAIN) / 5) * 1.5
# String accessories (d loop, peep hole ~15 grain)
fps_lost += 5
# IBO is conducted with a machine that has a perfect release.
# Human error is about 2-3 FPS lost; say 2.5
fps_lost += 2.5
return (advertised_fps - fps_lost)
if __name__ == "__main__":
if len(sys.argv) < 2:
print ("Advertised FPS: %d" % BOW_DEFAULT_ADVERTISED_FPS)
actual_fps = main(BOW_DEFAULT_ADVERTISED_FPS, AVERAGE_DEFAULT_DRAW_WEIGHT_LBS, AVERAGE_DEFAULT_DRAW_LENGTH_INCHES, AVERAGE_DEFAULT_ARROW_GRAIN)
print ("Beginner FPS: %d" % actual_fps)
else:
print ("Advertised FPS: %d" % int(sys.argv[1]))
actual_fps = main(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4]))
print ("Beginner FPS: %d" % actual_fps)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment