-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector_assess.py
More file actions
37 lines (29 loc) · 1 KB
/
Copy pathvector_assess.py
File metadata and controls
37 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 10:43:14 2024
@author: Shen
@name: Vector Analyze
@description:
Assesses the vector distribution already generated.
"""
import os, sys
import numpy as np
if __name__ == '__main__':
try:
output = sys.argv[1]
except:
output = input('Enter numpy file to ingest: ')
if output[-4:] != '.npy':
print('Appending .npy extension to file')
output += '.npy'
with open('output_vectors/'+output,'rb') as f:
vector = np.load(f)
vectors = np.load(f)
vectors_fixedoffset = np.load(f)
vectors_proportionaloffset = np.load(f)
for (v, vf, vp) in zip(vectors, vectors_fixedoffset, vectors_proportionaloffset):
v_test = vector + vf + vp
print('vector (nominal) + fixed offset + proportional offset: ', v_test)
print('dispersed vector: ', v)
print('Difference between the two: ', v_test - v)
assert np.allclose(v_test*2,v,atol=1e-6)