lneuhaus / pyrpl

pyrpl turns your RedPitaya into a powerful DSP device, especially suitable as a lockbox in quantum optics experiments.
http://lneuhaus.github.io/pyrpl/
MIT License
140 stars 108 forks source link

Zero Division Error in PyRPL GUI initial setup #520

Closed GeorgeGuannan closed 1 month ago

GeorgeGuannan commented 1 month ago

Hi, I am trying to setup the PyRPL GUI, followed by the instruction here: https://pyrpl.readthedocs.io/en/latest/gui.html#start-gui-label Specifically, in Section 2.2 Starting the GUI . Unfortunately, a Zero Division Error occurs when I am executing the PyRPL.exe file or runing the python script, following are the messages I get. Thank you for your help!

C:\anaconda\envs\pyrpl_env_charm\python.exe "C:\Users\ED\PycharmProjects\pythonProject\test.py" DEBUG:pyrpl.async_utils:Could not enable IPython gui support: 'NoneType' object has no attribute 'magic'. DEBUG:pyrpl.attributes:SelectProperty unit of module None has no options! DEBUG:pyrpl.attributes:SelectProperty unit of module None has no options! DEBUG:pyrpl.attributes:SelectProperty unit of module None has no options! DEBUG:pyrpl.attributes:SelectProperty unit of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! DEBUG:pyrpl.attributes:SelectProperty default_sweep_output of module None has no options! INFO:pyrpl:Please select or create a configuration file in the file selector window! DEBUG:pyrpl.memory:Loading config file C:/Users/ED/pyrpl_user_dir/config\example_filename.yml INFO:pyrpl:All your PyRPL settings will be saved to the config file C:/Users/ED/pyrpl_user_dir/config\example_filename.yml If you would like to restart PyRPL with these settings, type "pyrpl.exe example_filename" in a windows terminal or from pyrpl import Pyrpl p = Pyrpl('example_filename') in a python terminal. INFO:pyrpl.redpitaya:Successfully connected to Redpitaya with hostname 169.254.16.142.

The Zero Division Error: Traceback (most recent call last): File "C:\Users\ED\PycharmProjects\pythonProject\test.py", line 11, in <module> p = pyrpl.Pyrpl(hostname=HOSTNAME) File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\pyrpl.py", line 327, in __init__ module._load_setup_attributes() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\software_modules\network_analyzer.py", line 175, in _load_setup_attributes super(NetworkAnalyzer, self)._load_setup_attributes() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\modules.py", line 514, in _load_setup_attributes self.setup_attributes = dic File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\modules.py", line 501, in setup_attributes self.setup(**kwds) File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\modules.py", line 172, in setup self._setup() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\software_modules\network_analyzer.py", line 615, in _setup super(NetworkAnalyzer, self)._setup() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\acquisition_module.py", line 411, in _setup self.stop() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\acquisition_module.py", line 385, in stop self._free_up_resources() File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\software_modules\network_analyzer.py", line 620, in _free_up_resources self.iq.amplitude = 0 ## Original source file File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\software_modules\network_analyzer.py", line 191, in iq self.iq.bandwidth = [self.__class__.rbw.default, self.__class__.rbw.default] File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\attributes.py", line 240, in __set__ value = self.validate_and_normalize(obj, value) File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\attributes.py", line 725, in validate_and_normalize key=lambda x: abs(x - val)) for val in value] File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\attributes.py", line 725, in <listcomp> key=lambda x: abs(x - val)) for val in value] File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\attributes.py", line 798, in valid_frequencies valid_bits = range(0, self._MAXSHIFT(obj)-2) # this gives reasonable results (test_filter) File "C:\anaconda\envs\pyrpl_env_charm\lib\site-packages\pyrpl\attributes.py", line 790, in _MAXSHIFT return clog2(125000000.0/float(self._MINBW(obj))) ZeroDivisionError: float division by zero

Following is some background information that might be useful.

1. Preparation of Red Pitaya SD card:

I prepared the SD card using the OS image version 2.00-30. However, I noticed that the PyRPL documentation refers to using OS image version 0.92.

2. Installation and Anaconda Environment Setup

I installed the .exe file and built the conda environment using the following .yml file I made for packages, which specifies their corresponding versions. name: pyrpl_env_spd dependencies:

Additionally, I established an SSH connection to the Red Pitaya device.

3. The config file "example_filename"

`pyrpl: background_color: '' dockpositions: "\0\0\0\xFF\0\0\0\0\xFD\0\0\0\x01\0\0\0\x02\0\0\a\x80\0\0\x03\xC8\ \xFC\x01\0\0\0\x01\xFC\0\0\0\0\0\0\a\x80\0\0\0]\0\xFF\xFF\xFF\xFA\0\0\0\x03\x01\ \0\0\0\r\xFB\0\0\0.\0a\0s\0g\0s\0 \0(\0e\0x\0a\0m\0p\0l\0e\0\0f\0i\0l\0e\0n\0\ a\0m\0e\0)\0\0\0\0\0\xFF\xFF\xFF\xFF\0\0\0\x16\0\xFF\xFF\xFF\xFB\0\0\0,\0i\0q\0\ s\0 \0(\0e\0x\0a\0m\0p\0l\0e\0\0f\0i\0l\0e\0n\0a\0m\0e\0)\0\0\0\0\0\xFF\xFF\xFF\ \xFF\0\0\0\x16\0\xFF\xFF\xFF\xFB\0\0\0.\0p\0i\0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0c\0o\0n\0f\0i\0g\0 \0(\0e\0x\0a\0m\0p\0\ l\0e\0\0f\0i\0l\0e\0n\0a\0m\0e\0)\0\0\0\0\0\xFF\xFF\xFF\xFF\0\0\0\x16\0\xFF\xFF\ \xFF\xFB\0\0\04\0l\0o\0c\0k\0b\0o\0x\0 \0(\0e\0x\0a\0m\0p\0l\0e\0\0f\0i\0l\0\ e\0n\0a\0m\0e\0)\0\0\0\0\0\xFF\xFF\xFF\xFF\0\0\0\x16\0\xFF\xFF\xFF\xFB\0\0\0.\0\ p\0w\0m\0s\0 \0(\0e\0x\0a\0m\0p\0l\0e\0\0f\0i\0l\0e\0n\0a\0m\0e\0)\0\0\0\0\0\xFF\ \xFF\xFF\xFF\0\0\0\x16\0\xFF\xFF\xFF\xFB\0\0\0,\0h\0k\0s\0 \0(\0e\0x\0a\0m\0p\0\ l\0e\0\0f\0i\0l\0e\0n\0a\0m\0e\0)\0\0\0\0\0\xFF\xFF\xFF\xFF\0\0\0\x16\0\xFF\xFF\ \xFF\0\0\a\x80\0\0\0\0\0\0\0\x04\0\0\0\x04\0\0\0\b\0\0\0\b\xFC\0\0\0\0" gui: true loglevel: info modules:

I really appreciate any help!

GeorgeGuannan commented 1 month ago

This issue is fixed, thanks to this post: #505. The original OS in my SD card is RP 2.00-30, which is very new. I downgraded it to 1.04-18, and it seems working.