diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/python/csv_magnitude_of_sum.py | 19 | ||||
| -rwxr-xr-x | scripts/python/csv_sum.py | 19 | ||||
| -rwxr-xr-x | scripts/python/csv_sum_of_magnitude.py (renamed from scripts/python/csv_magnitude_sum.py) | 0 |
3 files changed, 38 insertions, 0 deletions
diff --git a/scripts/python/csv_magnitude_of_sum.py b/scripts/python/csv_magnitude_of_sum.py new file mode 100755 index 0000000..7ec25a1 --- /dev/null +++ b/scripts/python/csv_magnitude_of_sum.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import argparse +import numpy as np + + +def main(): + parser = argparse.ArgumentParser(description="Compute the sum of magnitude"); + parser.add_argument("one"); + args = parser.parse_args(); + + a = np.loadtxt(args.one, delimiter=","); + + print(np.linalg.norm(np.sum(a,axis=0))); +#enddef + +if __name__ == "__main__": + main(); +#enddef diff --git a/scripts/python/csv_sum.py b/scripts/python/csv_sum.py new file mode 100755 index 0000000..bc16006 --- /dev/null +++ b/scripts/python/csv_sum.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import argparse +import numpy as np + + +def main(): + parser = argparse.ArgumentParser(description="Compute the sum of magnitude"); + parser.add_argument("one"); + args = parser.parse_args(); + + a = np.loadtxt(args.one, delimiter=","); + + print(np.sum(a,axis=0)); +#enddef + +if __name__ == "__main__": + main(); +#enddef diff --git a/scripts/python/csv_magnitude_sum.py b/scripts/python/csv_sum_of_magnitude.py index 773ce52..773ce52 100755 --- a/scripts/python/csv_magnitude_sum.py +++ b/scripts/python/csv_sum_of_magnitude.py |
