From 67e86506c9d2321e23d7761cbb1f3e797185397c Mon Sep 17 00:00:00 2001 From: Wesley Kuhron Jones Date: Mon, 18 Nov 2024 07:37:45 +0000 Subject: [PATCH] working on a basic random generation and plotting script, but need to go to bed now --- requirements.txt | 2 +- scripts/PlotRandomNoise.py | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index efefb13..7e33fb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ contourpy==1.3.1 cycler==0.12.1 fonttools==4.55.0 -icosalattice==0.0.3 +icosalattice==0.0.4 kiwisolver==1.4.7 matplotlib==3.9.2 numpy==2.1.3 diff --git a/scripts/PlotRandomNoise.py b/scripts/PlotRandomNoise.py index eff300b..acdde24 100644 --- a/scripts/PlotRandomNoise.py +++ b/scripts/PlotRandomNoise.py @@ -1,3 +1,21 @@ +import random +import numpy as np import matplotlib.pyplot as plt -import icosalattice as ic +from icosalattice.UnitSpherePoint import UnitSpherePoint +import icosalattice.IcosahedronMath as icm + + + +if __name__ == "__main__": + n_points = 100 + usps = [UnitSpherePoint.random() for i in range(n_points)] + pcs = [] + for p in usps: + spc, l, d = icm.get_peel_coordinates_of_point(p) + pc = icm.get_point_code_from_peel_coordinates(spc, l, d) + pcs.append(pc) + els = [random.uniform(-100, 100) for i in range(n_points)] + d = {pc: el for pc, el in zip(pcs, els)} + print(d) + \ No newline at end of file