Fire Calculations


In [3]:
def fire_calc(speed, dpi):
  '''
  Calculates the fire period and frequency
  e.g.
  speed   = 0.5  # m/s
  dpi     = 600  # dpi
  '''
  inch2mm = 25.4 # mm/inch
  speed_mm_s = speed*1000 # mm/s
  pixel_pitch = (inch2mm/dpi) # mm

  fire_freq = speed_mm_s/pixel_pitch # Hz
  fire_period = 1/fire_freq

  print("Calculating Fire Frequency / Time")
  print("----------------------------------")
  print("Speed = {} m/s".format(speed))
  print("DPI   = {}".format(dpi))
  print("----------------------------------")
  print("Pixel Pitch    = {:>5.3} mm  =  {:>5.4} um".format(pixel_pitch, pixel_pitch*1000))
  print("Fire Period    = {:>5.2} s  = {:>5.3} ms = {} us".format(fire_period, fire_period*1000, fire_period*1000*1000))
  print("Fire Frequency = {:>5.2} Hz = {:>5.4} kHz = {} MHz".format(fire_freq, fire_freq/1000, fire_freq/(1000*1000)))

In [4]:
speed   = 0.5  # m/s
dpi     = 600  # dpi

fire_calc(speed, dpi)


Calculating Fire Frequency / Time
----------------------------------
Speed = 0.5 m/s
DPI   = 600
----------------------------------
Pixel Pitch    = 0.0423 mm  =  42.33 um
Fire Period    = 8.5e-05 s  = 0.0847 ms = 84.66666666666667 us
Fire Frequency = 1.2e+04 Hz = 11.81 kHz = 0.011811023622047244 MHz