mithaystack / srt-py Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Hi, I noticed that srt-py wasn't sending the right coordinates to the motor, and fixed them in this commit to my fork: imyxh@ed6d110
I'm curious about the +0.5° that you're doing, and the fact that you send [az,el] relative to the limits. This seems to be incorrect at least for our motor. Is this something that varies across models?
Need to have memory of plot limits for x and y when user zooms in. When the plot refreshes the zoom is lost and figure limits are just reset.
Its not finding default config dir (https://github.com/MITHaystack/srt-py/blob/master/bin/srt_runner.py#L44).
I have to do: srt_runner.py --config_dir=~/srtpy-config/
. To fix this, I created 6918472.
We have H180 and whether it is connected or not we are getting:
Traceback (most recent call last):
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/kurek/./miniconda3/envs/srtpy/bin/srt_runner.py", line 19, in run_srt_daemon
daemon = srt_d.SmallRadioTelescopeDaemon(configuration_dir, configuration_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/daemon.py", line 115, in __init__
self.rotor = Rotor(
^^^^^^
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/rotor_control/rotors.py", line 58, in __init__
self.motor = H180Motor(port, baudrate, az_limits, el_limits)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/rotor_control/motors.py", line 352, in __init__
Motor.__init__(self, port, az_limits, el_limits)
TypeError: Motor.__init__() missing 1 required positional argument: 'el_limits'
Exception ignored in: <function Motor.__del__ at 0x7f68a291dee0>
Traceback (most recent call last):
File "/home/kurek/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/rotor_control/motors.py", line 88, in __del__
if self.serial is not None and self.serial.is_open:
^^^^^^^^^^^
AttributeError: 'H180Motor' object has no attribute 'serial'
I modified https://github.com/MITHaystack/srt-py/blob/master/srt/daemon/rotor_control/motors.py#L352 to:
Motor.__init__(self, port, az_limits=(-0.7,359), el_limits=(8.4,80), baudrate=2400),
and the error is gone. Also (89df766):
Motor.__init__(self, port, az_limits=az_limits, el_limits=el_limits, baudrate=baudrate),
is working. I got :
Traceback (most recent call last):
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/alex/miniconda3/envs/srtpy/bin/srt_runner.py", line 19, in run_srt_daemon
daemon = srt_d.SmallRadioTelescopeDaemon(configuration_dir, configuration_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/daemon.py", line 115, in __init__
self.rotor = Rotor(
^^^^^^
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/rotor_control/rotors.py", line 58, in __init__
self.motor = H180Motor(port, baudrate, az_limits, el_limits)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/srt/daemon/rotor_control/motors.py", line 353, in __init__
self.serial = serial.Serial(
^^^^^^^^^^^^^^
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/serial/serialutil.py", line 244, in __init__
self.open()
File "/home/alex/miniconda3/envs/srtpy/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Doing (esp8266/source-code-examples#26 (comment)):
sudo usermod -a -G tty,dialout $USER
fixed it and now its working.
https://github.com/MITHaystack/srt-py/blob/master/srt/dashboard/layouts/graphs.py#L266 is deprecated since Python 3.12.
It can be repleced by fromtimestamp
:
from datetime import datetime, timezone
ts = 1571595618.0
x = datetime.utcfromtimestamp(ts)
print(x)
y = datetime.fromtimestamp(ts, tz=timezone.utc)
print(y)
2019-10-20 18:20:18
2019-10-20 18:20:18+00:00
On Mac OSX 12.1, conda-build srt-py results in the following error.
Traceback (most recent call last):
File "/Users/ansondaloisio/opt/anaconda3/bin/conda-build", line 11, in
sys.exit(main())
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 488, in main
execute(sys.argv[1:])
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 477, in execute
outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/api.py", line 186, in build
return build_tree(
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/build.py", line 3088, in build_tree
packages_from_this = build(metadata, stats,
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/build.py", line 2128, in build
create_build_envs(top_level_pkg, notest)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/build.py", line 1985, in create_build_envs
environ.get_install_actions(m.config.test_prefix,
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda_build/environ.py", line 799, in get_install_actions
actions = install_actions(prefix, index, specs, force=True)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/common/io.py", line 86, in decorated
return f(*args, **kwds)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/plan.py", line 473, in install_actions
txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 152, in solve_for_transaction
unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 195, in solve_for_diff
final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 313, in solve_final_state
ssc = self._add_specs(ssc)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 707, in add_specs
conflicts = ssc.r.get_conflicting_specs(tuple(MatchSpec()
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/resolve.py", line 1106, in get_conflicting_specs
C = r2.gen_clauses()
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/common/io.py", line 86, in decorated
return f(*args, **kwds)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/resolve.py", line 909, in gen_clauses
for ms in self.ms_depends(prec):
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/resolve.py", line 793, in ms_depends
deps = [MatchSpec(d) for d in prec.combined_depends]
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/models/records.py", line 340, in combined_depends
result = {ms.name: ms for ms in MatchSpec.merge(self.depends)}
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/models/match_spec.py", line 476, in merge
reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/models/match_spec.py", line 476, in
reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/models/match_spec.py", line 507, in _merge
final = this_component.merge(that_component)
File "/Users/ansondaloisio/opt/anaconda3/lib/python3.9/site-packages/conda/models/match_spec.py", line 758, in merge
raise ValueError("Incompatible component merge:\n - %r\n - %r"
ValueError: Incompatible component merge:
- 'mpi_mpich_*'
- 'mpi_mpich_tempest*'
Im getting a lot of
127.0.0.1 - - [23/Apr/2024 11:18:23] "POST / HTTP/1.1" 200 -
I was unable to disable it. Here is a discussion I created at flask GitHub page:
pallets/flask#5443
There are some confusing things in the labels and tools tips that need to be changed.
The scan centre is not updated during the scan:
https://github.com/MITHaystack/srt-py/blob/master/srt/daemon/daemon.py#L183
The sky is moving at 0.251 deg/min, so this can cause the Gaussian maximum to drift out of position.
Ideas to improve presentation of plots
Currently, the way to perform an N-point scan is to click the object of interest on the star chart and select "n-point scan" from a dialog box. If the user wants to save their scan data, they have to begin recording beforehand.
Speaking only for myself, N-point scan "feels" like a routine that should be located under the routine menu because the telescope performs a sequence of pre-programmed actions. If placed on this menu, the SRT could perform the scan with the current location of the SRT as its center point. This would also allow scans to be done of objects that aren't already marked on the star chart. I'd further suggest that when an N-point scan is started this way a reminder of some sort should show up that the user must start recording first if they want to keep the data.
If this change were made, N-Point scan could probably be removed from the pointing dialog that comes up when clicking objects on the star chart. If the "beam switch" choice (whatever that is!) gets removed too, the pointing dialog could be changed to a simple confirmation: "Point to ?"
Need to add plots page with n-point scan plotting.
conda build srt-py
does not work due to dependency issues:
conda.exceptions.PackagesNotFoundError: The following packages are not available from current channels:
- yamale
- soapysdr-module-rtlsdr
- soapysdr
- rtl-sdr
- gnuradio-zeromq
- gnuradio-osmosdr
- gnuradio-core
- digital_rf
- dash-bootstrap-components
I also could not build it using:
conda build srt-py --channel conda-forge --python 3.11.7
nor
conda build srt-py --channel conda-forge --python 3.10.13
Values of self.az_count
and self.el_count
calculated here:
https://github.com/MITHaystack/srt-py/blob/master/srt/daemon/rotor_control/motors.py#L446
are not passed to here:
https://github.com/MITHaystack/srt-py/blob/master/srt/daemon/rotor_control/motors.py#L396
https://github.com/MITHaystack/srt-py/blob/master/srt/daemon/rotor_control/motors.py#L410
for subtraction - to calculate the next (tracking) command. So the value of 0 is subtracted and the commands sent to the serial port are e.g (first two are Direct Point, third is for tracking):
move 1 396
move 3 54
move 1 396
etc., whereas they should be:
move 1 396
move 3 54
move 1 2
I've installed radioconda and srt-py on OpenSuSE Leap 15.2 and changed the radio to usrp as per the instructions. When starting srt-py I get the following error message. It appears to work correctly, as the web page appears on port 8080 and displays the output of the radio. Is this error critical to the operation of the software?
Steve
Exception in thread Thread-5:
Traceback (most recent call last):
File "/home/wrt/radioconda/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/home/wrt/radioconda/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/home/wrt/srt-py-master/srt/daemon/daemon.py", line 595, in update_radio_settings
call(value)
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 1116, in call
return self.__send(self.__name, args)
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 1458, in __request
response = self.__transport.request(
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 1160, in request
return self.single_request(host, handler, request_body, verbose)
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 1176, in single_request
return self.parse_response(resp)
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 1348, in parse_response
return u.close()
File "/home/wrt/radioconda/lib/python3.9/xmlrpc/client.py", line 662, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'AttributeError'>:'gnuradio.gr.gr_python.top_block_pb' object has no attribute 'blocks_tags_strobe_0'">
When first loading up the dashboard, OR when returning to the monitor page from the system page, the three graphs display for a few seconds in some sort of "default" state before any of the dashboard's formatting is applied to them (aspect ratio, scaling, titles, etc.). This is... annoying. And could be disorienting for some users, possibly even making them (briefly) think they did something wrong or the software crashed.
Various areas of the dashboard use both GHz and MHz (specifically, the sidebar vs spectrum graph labels). These should be unified to just a single unit for all areas. As a novice here I don't have any preference for which one.
The dialog box for adjusting the frequency and bandwidth should also be checked to make sure it matches whatever decision is made.
It is not possible to perform Beam Switch or N-Point Scan after Direct Point on the same object from the GUI - SRT remains inactive. The message is eg.:
Running Command 'Antenna Location b'
Command Not Identified 'Antenna Location b'
Plotting out azimuth,elevation and received power there seems to be an offset between them. Need to figure out where the delay is and get the threads realigned.
Issue_with_synchronization_between_the_coordinates_and_power_in_rad_file___feedback.pdf
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.