Coverage for /Users/pstratton/Dev/hcode/python-ballistics/src/ballistics/extras.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- This module contains useful or interesting functions that are related to ballistics but don't fit well anywhere else. """
# CONSTANTS 'HighPoweredRifle': 1.75, 'AverageLengthShotgun': 1.50, 'LongBarrelShotgun': 1.25, 'PistolAndRevolver': 1.50 }
# HELPER FUNCTIONS """Provides the Propellant Gas Velocity multiplier for a given firearm_code
Parameters ---------- firearm_code : {'HPR', 'ALS', 'LBS', 'PAR'} * HPR = High Powered Rifle * ALS = Average Length Shotgun * LBS = Long Barrel Shotgun * PAR = Pistol And Revolver
Returns ------- float Propellant Gas Velocity multiplier for a given firearm type
Notes ----- Refer to http://www.saami.org/PubResources/GunRecoilFormulae.pdf
The PROPELLANT_GAS_VELOCITY_CONSTANTS were sourced from the SAAMI GunRecoilFormulae document and were originally derived from "extensive experiments by the British, published in "British Text Book of Small Arms" published in 1929 and confirmed by later work in [the United States]". """ 'HPR': PROPELLANT_GAS_VELOCITY_CONSTANTS['HighPoweredRifle'], 'ALS': PROPELLANT_GAS_VELOCITY_CONSTANTS['AverageLengthShotgun'], 'LBS': PROPELLANT_GAS_VELOCITY_CONSTANTS['LongBarrelShotgun'], 'PAR': PROPELLANT_GAS_VELOCITY_CONSTANTS['PistolAndRevolver'] }
"""calculates the energy for a given load and firearm type
Parameters ---------- charge_weight_in_grains : float Weight in grains of the powder charge. firearm_code : str Argument to use for the :func:`~ballistics.extras.propellant_gas_velocity_multiplier` function. muzzle_velocity_in_fps : int Muzzle velocity for this load (field measurement or from loading manual reference table).
Returns ------- float Propellant gas energy generated for a given load/firearm combination """
# Primary Functions charge_weight_in_grains, muzzle_velocity_in_fps, decimal_places=0): """Provides the approximate free recoil energy for a given load and firearm type combination
Parameters ---------- firearm_code : str Argument to use for the :func:`~ballistics.extras.propellant_gas_velocity_multiplier` function. firearm_weight_in_lbs : float Weight in lbs of the firearm plus any accessories. ejecta_weight_in_grains : float Weight in grains of the projectile plus wad (if fired from a shotgun). muzzle_velocity_in_fps : int Muzzle velocity for this load (field measurement or from loading manual reference table). charge_weight_in_grains : float Weight in grains of the powder charge. decimal_places : int, optional How many decimal places to return, (default value is 0 which returns the floor of the result).
Returns ------- int or float By default ``decimal_places`` is 0 which will return the nearest integer value. If a value greater than 0 is passed in, the function will return a float value rounded to ``decimal_places``.
Notes ----- Refer to http://www.saami.org/PubResources/GunRecoilFormulae.pdf
The accuracy of the value returned from this function is directly related to the accuracy of the charge weight and projectile velocity. """
charge_weight_in_grains, decimal_places=0): """Provides the approximate recoil velocity for a given load and firearm type combination
Parameters ---------- firearm_code : str Argument to use for the :func:`~ballistics.extras.propellant_gas_velocity_multiplier` function. firearm_weight_in_lbs : float Weight in lbs of the firearm plus any accessories. ejecta_weight_in_grains : float Weight in grains of the projectile plus wad (if fired from a shotgun). muzzle_velocity_in_fps : int Muzzle velocity for this load (field measurement or from loading manual reference table). charge_weight_in_grains : float Weight in grains of the powder charge. decimal_places : int, optional How many decimal places to return, (default value is 0 which returns the floor of the result).
Returns ------- int or float By default ``decimal_places`` is 0 which will return the nearest integer value. If a value greater than 0 is passed in, the function will return a float value rounded to ``decimal_places``.
Notes ----- The accuracy of the value returned from this function is directly related to the accuracy of the charge weight and projectile velocity. """ |