GithubHelp home page GithubHelp logo

mithaystack / srt-py Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 14.0 3.78 MB

License: BSD 3-Clause "New" or "Revised" License

Python 95.29% CSS 4.29% JavaScript 0.09% Xonsh 0.34%
astronomy python radio sdr telescope

srt-py's People

Contributors

emchen125 avatar imyxh avatar jswoboda avatar ryanvolz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

srt-py's Issues

data recording improvements and "active"/"inactive" status

  1. When starting to record data, after choosing the format, an option to select the location of the data files would be helpful. Or at the very least, a statement of where the file will be placed.
  2. While data is being recorded, some clear indicator that the recording is taking place needs to be prominent. Perhaps something right under the Active/Inactive statement on the sidebar.
  3. Changing the Active/Inactive statement to something like Busy/Ready might be helpful too. I would naively consider recording data to be "active" even though the SRT can respond immediately to commands while recording. (The things I've noticed that count as "Active" are moving the telescope and running the calibration routine.) If it's customary in radio to use the Active/Inactive names, though, then we should stick with them--just need to make sure novice users understand what they mean and don't mean.

Offsets for motor control

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?

Keep plot limits after refresh

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.

AttributeError: 'H180Motor' object has no attribute 'serial'

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.

Conda build issue

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*'

Verbage improvements

There are some confusing things in the labels and tools tips that need to be changed.

  • On map state SRT with point at instead of track because it's not tracking
  • In the dialog pop up list the name of the object.
  • Sort the system page by newest issue first.

Plotting ideas

Ideas to improve presentation of plots

  • Put un-shifted hydrogen line on spectrum plots as a marker or a toggle that can turn on and off.
  • Add a plots tab with more images running and have the following
    • N-point scan plot
    • Waterfall plot of spectrum.
  • Change the way the plots update on the dashboard to be driven by updates in the data and not regular timed updates.

N-point scan's location in the dashboard interface

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 ?"

Plots tab

Need to add plots page with n-point scan plotting.

Conda building error

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

H180 class: calculated self.az_count, self.el_count values not passed to next command (tracking object) construction

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

Thread error

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'">

dashboard's monitor page looks weird when returning from system page

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.

I think I'm attaching a screenshot to show this...
srt-py dashboard glitch

GHz vs MHz

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.