by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    yangdl-github
    @yangdl-github
    Thanks, Pete. @prjemian I will try.
    Robert Tang-Kong
    @tangkong
    Perhaps a solved problem, but what is the best way to plot the derivative of the collected data, preferably directly overlaid on the collected data shown by the besteffort callback?
    Thomas A Caswell
    @tacaswell
    BEC is a monolith that we don't suggest looking inside of, but @danielballan is working on a better replacement
    yangdl-github
    @yangdl-github
    I have shown image from EPICS PV data. @prjemian Pete's lesson6 is very helpful.
    Thanks all of you.
    Jeremy Stashluk
    @stashlukj
    The loop for the asyncio.DatagramProtocol that runs my device seems to stop when I call the RE. Is there a good way to make sure they both run?
    Thomas A Caswell
    @tacaswell
    What version of bluesky are you using?
    Jeremy Stashluk
    @stashlukj
    1.6.2
    Thomas A Caswell
    @tacaswell
    hmm, ok so it isn't the easy fix (in 1.6 we pushed the event loop to a background thread)
    are you call the RE from inside another event loop?
    Jeremy Stashluk
    @stashlukj
    I use one event loop to create the datagram endpoints. I use run_until_complete() to create the endpoints. The protocol instantiates the devices during this time. Once the devices are created, I pass the loop to the RunEngine, but the datagram_received() for my protocol never fires.
    Thomas A Caswell
    @tacaswell
    ok, so the issue is that despite being built on top of the event loop, the public interface on the RE is tuned to be used from a command line
    so when you do RE(...) we do a lot of work to make sure that it blocks until interrupted or it finishes (which is not helpful to you here because it is now blocking the task it was triggered in and I suspect you have deadlocks...)
    what we need to do here is factor out validation / book-keeping etc work that is done in the top of __call__ https://github.com/bluesky/bluesky/blob/3e298fde0abfba8ad99aea535ff4ee37c79d755a/bluesky/run_engine.py#L688 and then write an async version of _resume-task https://github.com/bluesky/bluesky/blob/3e298fde0abfba8ad99aea535ff4ee37c79d755a/bluesky/run_engine.py#L856
    at least in thoery
    Jeremy Stashluk
    @stashlukj
    Yes. I tried waiting on a Status() object during kickoff() to be set_finished() by the first message.
    Thomas A Caswell
    @tacaswell
    you could also do something like https://github.com/bluesky/bluesky-queueserver and push the RE to a background thread (make sure you don't use the default "run while idle" function which uses Qt and will cause problems) and it's own event loop
    can you make an issue on bluesky/bluesky describing this and with a hopefully runnable version of what you are trying to do?
    Jeremy Stashluk
    @stashlukj
    I will take a look. Thanks! Yes. I'll try to make a minimal example for this.
    Thomas A Caswell
    @tacaswell
    the RE started very monolithic and we have been slowly pulling it apart
    the next part of that is to further de-couple the plan running logic (to among other things allow there to be a "please run this plan and tell me when it is done" Msg) which I think will also help with trying to use the RE from within another asyncio event loop
    I'm curious what you are trying to do with bluesky
    Jeremy Stashluk
    @stashlukj
    I make ground-penetrating radars. Our "radar board" gives us a radar waveform of 1024 samples x 100 Hz in addition to a survey-wheel encoder, accelerometer, battery. We integrate this stuff with GPS, etc to find stuff underground.
    Thomas A Caswell
    @tacaswell
    that is pretty cool :)
    Jeremy Stashluk
    @stashlukj
    Thanks. I'd like to try and see if I can typhos/bluesky some of our calibration test fixtures.
    Jeremy Stashluk
    @stashlukj
    LivePlot doesn't open a window until I call plt.show() after executing the RE. Am I missing something? I am on WSL.
    Thomas A Caswell
    @tacaswell
    Does it work if you do plt.ion() before calling RE?
    Jeremy Stashluk
    @stashlukj
    That was it. Thanks, @tacaswell
    Jeremy Stashluk
    @stashlukj
    When I do a count on my ophyd.Signal, and give it to LiveTable, I get "failed to format row". It looks fine in the Broker.named().table() however. Am I missing an attribute for my Signal?
    Thomas A Caswell
    @tacaswell
    Does it give you any more information?
    one thing that may be going wrong is the the type reported by sig.descirbe() does not match the actual typing coming back from sig.read()
    Jeremy Stashluk
    @stashlukj
    In describe, the source has SIM: prepended. Is that my problem?
    Thomas A Caswell
    @tacaswell
    no, "source" is not used by anything, that is there for being able to trace back to what piece of hardware the measurement came from (we have 10k+ signals on a typical beamline)
    Jeremy Stashluk
    @stashlukj
    describe(): {'R4:PAVE_POROSITY:128_accel_x': {'source': 'SIM:R4:PAVE_POROSITY:128_accel_x', 'dtype': 'integer', 'shape': []}} read(): {'R4:PAVE_POROSITY:128_accel_x': {'value': 0, 'timestamp': 1591988169.7610016}}
    Thomas A Caswell
    @tacaswell
    if it is moving does it always give you an integer?
    or does it give you a float in operation?
    signals do introspection on them selves to sort out what the type is (making that easier to manage is a long standing issue, but I digress), so the simplest thing may be to where ever you set that signal always do sig.set(float(0))
    Jeremy Stashluk
    @stashlukj
    I use x = Component(Signal, value=0) and it is an integer in operation.
    Thomas A Caswell
    @tacaswell
    Can I see the exact error message it gives you?
    Thomas A Caswell
    @tacaswell
    the down side of making things be nice applications (never die!) is that we end up hiding a lot of debugging details...
    Set the BLUESKY_DEBUG_CALLBACKS env to anything truthy
    which will make LiveTable raise (instead of eating the exception) which will get us alot more useful information ;)
    my guess is that something is setting a float value to the signal
    Jeremy Stashluk
    @stashlukj
    Updated the gist. Looks like the LiveTable can't find my signal?
    I tried giving it floats, and it came back with "number" but no improvement.
    Thomas A Caswell
    @tacaswell
    it's the colons
    because internally LiveTable formats a format string, when we go to feed it Python see {R4:blah:d} and decides the key it want use is 'R4'
    Jeremy Stashluk
    @stashlukj
    Thanks. Got it. I tried using . before, and that didn't work either.
    Underscores work.
    This package is amazing! Exactly what I've been looking for.