From 039b4c8c67d658d7f8001171f8127d261653dcad Mon Sep 17 00:00:00 2001 From: Vedant Rautela Date: Tue, 9 Aug 2022 10:18:10 +0200 Subject: [PATCH] add conda environemnt yml file; change camera fov to reflect accurate stats (60 degree FOV) --- environment.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ optimizer.py | 8 +++---- 2 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..bd106b5 --- /dev/null +++ b/environment.yml @@ -0,0 +1,58 @@ +name: cern_camera_placement +channels: + - defaults +dependencies: + - blas=1.0=mkl + - bottleneck=1.3.5=py38h080aedc_0 + - brotli=1.0.9=ha925a31_2 + - ca-certificates=2022.4.26=haa95532_0 + - certifi=2022.6.15=py38haa95532_0 + - cycler=0.11.0=pyhd3eb1b0_0 + - fonttools=4.25.0=pyhd3eb1b0_0 + - freetype=2.10.4=hd328e21_0 + - icc_rt=2019.0.0=h0cc432a_1 + - icu=58.2=ha925a31_3 + - intel-openmp=2021.4.0=haa95532_3556 + - jpeg=9e=h2bbff1b_0 + - kiwisolver=1.4.2=py38hd77b12b_0 + - libpng=1.6.37=h2a8f88b_0 + - libtiff=4.2.0=he0120a3_1 + - libwebp=1.2.2=h2bbff1b_0 + - lz4-c=1.9.3=h2bbff1b_1 + - matplotlib=3.5.1=py38haa95532_1 + - matplotlib-base=3.5.1=py38hd77b12b_1 + - mkl=2021.4.0=haa95532_640 + - mkl-service=2.4.0=py38h2bbff1b_0 + - mkl_fft=1.3.1=py38h277e83a_0 + - mkl_random=1.2.2=py38hf11a4ad_0 + - munkres=1.1.4=py_0 + - numexpr=2.8.3=py38hb80d3ca_0 + - numpy=1.22.3=py38h7a0a035_0 + - numpy-base=1.22.3=py38hca35cd5_0 + - openssl=1.1.1q=h2bbff1b_0 + - packaging=21.3=pyhd3eb1b0_0 + - pandas=1.4.3=py38hd77b12b_0 + - pillow=9.0.1=py38hdc2b20a_0 + - pip=21.2.2=py38haa95532_0 + - pyparsing=3.0.4=pyhd3eb1b0_0 + - pyqt=5.9.2=py38hd77b12b_6 + - python=3.8.13=h6244533_0 + - python-dateutil=2.8.2=pyhd3eb1b0_0 + - pytz=2022.1=py38haa95532_0 + - qt=5.9.7=vc14h73c81de_0 + - scipy=1.7.3=py38h0a974cb_0 + - seaborn=0.11.2=pyhd3eb1b0_0 + - setuptools=61.2.0=py38haa95532_0 + - sip=4.19.13=py38hd77b12b_0 + - six=1.16.0=pyhd3eb1b0_1 + - sqlite=3.38.3=h2bbff1b_0 + - tk=8.6.12=h2bbff1b_0 + - tornado=6.1=py38h2bbff1b_0 + - vc=14.2=h21ff451_1 + - vs2015_runtime=14.27.29016=h5e58377_2 + - wheel=0.37.1=pyhd3eb1b0_0 + - wincertstore=0.2=py38haa95532_2 + - xz=5.2.5=h8cc25b3_1 + - zlib=1.2.12=h8cc25b3_2 + - zstd=1.5.2=h19a0ad4_0 +prefix: C:\Users\vraut\Anaconda3\envs\cern_camera_placement diff --git a/optimizer.py b/optimizer.py index f35a36f..83ea7bd 100644 --- a/optimizer.py +++ b/optimizer.py @@ -4,8 +4,8 @@ from scipy.optimize import Bounds, minimize, NonlinearConstraint from typing import List -from guesses import gen_guess_box -from obstacles import CylinderObstacle, Obstacle +from optimization.guesses import gen_guess_box +from optimization.obstacles import CylinderObstacle, Obstacle # TODO: change these to reflect the most accurate specs # FOV lower bound (objects must be at least this far to be seen) @@ -13,7 +13,7 @@ # FOV upper bound a.k.a height of the cone (objects further than this are out of range) fov_upper_bound = 5 # FOV degree (a.k.a angle between cone axis and slant) -fov_degree = 50 +fov_degree = 60 # FOV base radius (a.k.a radius of the base of the cone) fov_base_radius = fov_upper_bound * np.tan(np.deg2rad(fov_degree)) @@ -350,7 +350,7 @@ def main(): x0 = gen_guess_box(V_x, V_y, V_z) # specify the obstacles present in the space - obstacles = [CylinderObstacle(np.array([1.5,6,1.5]), np.array([2.5,6,1.5]), 0.25)] + obstacles = [CylinderObstacle(np.array([1.5,6,1.5]), np.array([2.5,6,1.5]), 1)] res = minimize(average_reciprocal_gdop, x0, args=(obstacles,), bounds=bounds, options={"eps":0.1, "disp":True}) print(res)