From ae4e0674f362a5ffcc11559c78ff6aeea7602eb1 Mon Sep 17 00:00:00 2001 From: hrocho Date: Mon, 9 Oct 2017 00:54:14 +0200 Subject: [PATCH] added few python functions --- catima.pyx | 19 +++++++++++++++++- catimac.pxd | 18 ++++++++++++++++- tests/test.py | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/catima.pyx b/catima.pyx index 32fde78..72a79c5 100644 --- a/catima.pyx +++ b/catima.pyx @@ -338,7 +338,7 @@ cdef catimac.Material get_cmaterial(Material material): res = material.cbase return res -def range(Projectile projectile, Material material, energy = None, Config config = default_config): +def projectile_range(Projectile projectile, Material material, energy = None, Config config = default_config): if(isinstance(energy,numpy.ndarray)): res = numpy.empty(energy.size) for i,e in enumerate(energy): @@ -403,3 +403,20 @@ def z_effective(Projectile p, Target t, Config c = default_config): def z_eff_Pierce_Blann(double z, double beta): return catimac.z_eff_Pierce_Blann(z,beta) + + +def get_data(Projectile projectile, Material material, Config config = default_config): + data = catimac.get_data(projectile.cbase, material.cbase, config.cbase) + return [data.range,data.range_straggling,data.angular_variance] + +max_datapoints = catimac.max_datapoints + +def energy_table(unsigned int i): + if(i