AOtools / soapy

A Python Adaptive Optics Simulation
GNU General Public License v3.0
85 stars 32 forks source link

Installation troubles (windows) #105

Closed nidlu closed 5 years ago

nidlu commented 5 years ago

Dear Andrew, thanks for what seems like very interesting software. Sadly I'm having some trouble getting it to play ball. I'm running on a fresh Anaconda install, with the 2 extra packages installed, and soapy "installed" per the documentation. I'm using the newest tagged edition (soapy-0.12.0)

When I run the following code:

import os os.chdir("/users/cjgn4/desktop/soapy-0.12.0") import soapy sim = soapy.Sim("conf/sh_8x8_lgs.yaml") sim.aoinit()

I get the following errors:

runfile('C:/Users/cjgn4/.spyder-py3/temp.py', wdir='C:/Users/cjgn4/.spyder-py3') C:\Users\cjgn4\Anaconda3\lib\site-packages\soapy\confParse.py:289: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. self.configDict = yaml.load(file_) Pixel Scale: 16.00 pxls/m subScreenSize: 154 simulation pixels 1 of 1: Loaded configuration file successfully! Starting Sim: 2019-07-02-13-24-28 Pixel Scale: 16.00 pxls/m subScreenSize: 154 simulation pixels Creating mask... Turbulence summary @ 500 nm: | r0 = 0.16 m (0.64" seeing) | Vbar_5/3 = 11.78 m/s | tau0 = 4.26 ms Generating Phase Screens Generate Phase Screen 0 with r0: 0.24, size: 2048 Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/cjgn4/.spyder-py3/temp.py', wdir='C:/Users/cjgn4/.spyder-py3')

File "C:\Users\cjgn4\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile execfile(filename, namespace)

File "C:\Users\cjgn4\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/cjgn4/.spyder-py3/temp.py", line 14, in sim.aoinit()

File "C:\Users\cjgn4\Anaconda3\lib\site-packages\soapy\simulation.py", line 199, in aoinit self.atmos = atmosphere.atmos(self.config)

File "C:\Users\cjgn4\Anaconda3\lib\site-packages\soapy\atmosphere.py", line 163, in init self.config.L0[i], 0.01)

File "C:\Users\cjgn4\Anaconda3\lib\site-packages\soapy\atmosphere.py", line 569, in ft_phase_screen PSD_phi[(N/2),(N/2)] = 0

IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

The same sort of error crops up when running the test as described in documentation. Any idea what may be happening here? Kind regards, Carl Johan

matthewtownson commented 5 years ago

Hi Carl, this was an issue with v0.12 when numpy restricted indexing for arrays. This has since been fixed, if you use current latest version 0.13.1 you shouldn't have these issues. Let us know if this fixes the problems you are having, or if there is something else preventing soapy from running.

nidlu commented 5 years ago

Hi Matthew, it seems to work with 0.13.1, thank you :) the setup.py script doesnt seem to set the correct paths on windows, but i just use an os.chdir in my code so it's no trouble.

matthewtownson commented 5 years ago

OK, glad that worked.

It has been a while since I had a proper look on windows, I will add the path issue to the to-do list!