Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    pshafer-als
    @pshafer-als

    @danielballan Thanks! I did not know about this option. A small hurdle is that my module is not installed...and not really structured to be a proper package. I suppose pip install -e . could be used temporarily though.

    In the interim, Dylan has pointed me to a FITS handler that is ready to be installed. I will give that a try next.

    Thomas A Caswell
    @tacaswell
    it is a bit meta-programmy, but you can do
    import types
    import sys
    my_module = types.ModuleType('my_module')
    my_module.FitsHandler = FitsHandler
    sys.modules['my_module'] = my_module
    
    from my_module import FitsHandler as _FitsHandler
    you just have to do that before you interrogate databroker / intake
    pshafer-als
    @pshafer-als

    @tacaswell Cool, thank you

    Eventually I will need to do this the right way, but always nice to know some workarounds to help bridge that gap

    Thomas A Caswell
    @tacaswell
    yeah, that is the sort of thing that if I saw in a code-review I would be like "....no", but for development it may be useful
    pshafer-als
    @pshafer-als

    UPDATE: Databroker is now using the FITS handler that Dylan shared with me

    Hooray!

    I ended up needing to rewrite the stored data (ummm, 'datum's?) with "frame_per_point" passed as a keyword argument when creating the resource. Otherwise extract_shape() would raise RuntimeError(f"Could not figure out shape of {key}") for key="ccd", even though the shape is explicitly set in the event descriptor.

    This is the relevant section where the documents are being generated from existing data...

    ...
    descriptor_keys['ccd']['shape'][0] = sample_fits['Images'].data.shape[0]
    descriptor_keys['ccd']['shape'][1] = sample_fits['Images'].data.shape[1]
    
    primary_stream_bundle = run_bundle.compose_descriptor(
        data_keys=descriptor_keys,
        name=primary_stream_bundle_name)
    yield 'descriptor', primary_stream_bundle.descriptor_doc
    ...

    It looks like extract_shape() might not be expecting the simple case of descriptor['data_keys'][key]['shape'] already defined correctly; so it raises an exception instead of simply returning return descriptor['data_keys'][key]['shape']?

    This is probably just my ignorance of databroker in general (and extract_shape() in particular), but I'm curious whether you see this as an issue in the logic of extract_shape()?

    Dan Allan
    @danielballan
    Oh yikes. If the shape is correct we should be getting out of your way.
    pshafer-als
    @pshafer-als

    I finally managed to get debug information on the recursion condition. It appears that the recursion loop is caused by intake forcing a reload of information every time it checks the property/attribute of an Entry/Catalog.

    It turns out that the inifite recursion I was experiencing (see my post from Jan. 11) was related to an outdated (and beta) version of databroker / its dependencies. Upgrading to databroker 1.2.0 fixed this problem. Thanks, Dylan!

    It seems strange that conda pulled databroker 1.0.0b9 on 2021-01-05, when issuing the following commands.

    conda create --name fits-env python=3.8 pandas astropy requests event-model suitcase-mongo -c lightsource2-tag
    conda activate fits-env
    conda install conda-build
    conda install -c nsls2forge databroker
    conda install scikit-image

    Just to clarify, databroker now works as expected. I'm posting this simply for informational purposes.

    Kartik Cating-Subramanian
    @ksubrama_gitlab
    hi! Is this the right channel for yaq questions? If there is a better channel I want to go there before I poke Blaise.
    Thomas A Caswell
    @tacaswell
    You will need to raise @untzag or @ksunden_gitlab
    Kartik Cating-Subramanian
    @ksubrama_gitlab
    Thank you for @- ing them for me :). I'm trying to run through the yaq "let's just run fake hardware tutorial" and am running into issues that I suspect step from spaces in user names and passwordless users..
    I'm trying to locally develop a driver that I wrote inside C:\Users\my_wanky_user_name\repo\my_yaq_repo and I am trying to enable it inside yaq - so if any of the yaq developers are here, it would be awesome if you could help out/let me bounce ideas off of you.
    Kyle Sunden
    @ksunden_gitlab

    HI @ksubrama_gitlab

    Yes, spaces in paths was a problem that we found and fixed on master of yaqd-control (needed to be quoted in a subprocess call):
    https://gitlab.com/yaq/yaqd-control/-/blob/master/CHANGELOG.md

    I thought we had done a release since then, but apparently not (I think we have one other thing that we were planning on putting in the release, that just kept getting bumped down the priority list)

    Anyway, I pinged you on our matrix channel if you want to talk more.

    Kartik Cating-Subramanian
    @ksubrama_gitlab
    Uhoh - I'm not using a gitter client with notifications and just check this channel manually in the morning - so I probably missed your ping?
    @ksunden_gitlab Can you pull me into this other channel.. I'm still trying to figure out how to sensibly enable a daemon that I am actively developing without having to pip install it. I tried using yaqd edit-config with some port that was between 20k and 30k and but it didn't seem to work :(
    Kyle Sunden
    @ksunden:matrix.org
    [m]
    (Hey, gitter rooms can now be accessed via element, the "first party" matrix client, which does have notifications... I just connected in)

    anywho https://matrix.to/#/#yaq:matrix.org?via=matrix.org

    you came to this chatroom in the past, with username selfification

    Kartik Cating-Subramanian
    @ksubrama_gitlab
    Yep I did - but 2020 being 2020, I can barely remember how to do things people explained to me last week :) 2021 is following in that tradition it seeems.
    Kyle Sunden
    @ksunden_gitlab
    perhaps to add to the confusion, I think when you last were in here, the client was called "Riot" and they have rebranded to "element" (same people behind it, just a new name)
    Kartik Cating-Subramanian
    @ksubrama_gitlab
    Anyway - so how does one actively develop a yaqd-daemon. I managed to slowly follow through yaqd-control and it seems like yaqd has a couple of places it will read configs from (it'll pick up toml files from the parent directory of... wherever it can find a daemon that's pip installed or from AppData/Local/something?/yaq/config.toml?
    But I can't seem to figure out how, besides just hoping a yaq module is already installed in your python path, yaqd-control actually picks up the code for a yaq driver. I want to be able to iterate on developing a driver without having to pip install it every time.
    Kyle Sunden
    @ksunden:matrix.org
    [m]

    To get the entry points they do need to be installed. yaqd-control is more for production machines than dev (though it can be useful in some dev circumstances)

    for dev work I tend to just run the entry point directly in a terminal e.g. $ yaqd-horiba-micro-hr -v (-v to get verbose outputs)

    that prints logs to stderr so I can see what is going on.

    you can install in editable mode to be able to make changes without having to re pip install every time

    to install in editable mode with flit (which is what we mostly use) is flit install --pth-file (or on systems like linux/mac that have symlinks flit install -s)
    the default config file location (which uses appdirs to get) is in that AppData folder. yaqd edit-config horiba-micro-hr will open up notepad (or actually whatever is in $EDITOR) with that file directly
    Till Stensitzki
    @Tillsten
    little bit offtopic, but does anybody here has some suggestion for daily logging of e.g. laser settings and status?
    I mean i could write a gui for that myself, but I guess there should already some kind of solution
    Blaise Thompson
    @untzag:matrix.org
    [m]
    I have not used this, but it's on my personal list as something to try if I need a logging gui https://github.com/busimus/cutelog/
    Consider just logging to a file though
    Till Stensitzki
    @Tillsten
    I also found it, but I think some plotting options for numerical values would be nice to have
    Also if I don't have to I dont want to spend any time on GUI for data input
    Maybe just a spreadsheet
    Blaise Thompson
    @untzag:matrix.org
    [m]
    👍
    Pierre Schnizer
    @PierreSchnizer

    Dear all,

    how should I cite bluesky in an publication please?
    Thanks
    Pierre

    Kyle Sunden
    @ksunden:matrix.org
    [m]

    I don’t think we have set up a DOI for the project itself (via e.g. Zenodo). Here is a paper that people cite: https://www.tandfonline.com/doi/full/10.1080/08940886.2019.1608121 (DOI: https://doi.org/10.1080/08940886.2019.1608121)

    credit to mrakitin on the slack for answering a similar question a week ago

    Pierre Schnizer
    @PierreSchnizer
    Thanks for your answer!
    Pierre
    Quantum-cross
    @Quantum-cross
    hey! this is an interesting project, I was wondering if you know of any large scale experiments implementing BlueSky as a major part of their control/acquisition/analysis chain?
    besides the National Synchrotron of course
    Thomas A Caswell
    @tacaswell
    Yes, all of the US lightsources are using it on at least one beamline, SA is using it, DLS is looking into adopting it, and Pohang is using it
    and BESSY
    Pierre Schnizer
    @PierreSchnizer
    And Fritz Haber Institute (Max Planck Society) is looking into it
    yehnan
    @yehnan

    Hi, Bluesky mates. The following code:
    ThetaS = EpicsMotor('31a:DCM:ThetaS', name='ThetaS')
    print('ThetaS position', ThetaS.position)

    will cause exception DisconnectedError:
    Traceback (most recent call last):
    File "ztest_ac.py", line 69, in <module>
    print('ThetaS position', ThetaS.position)
    File "/home/chiang.lc/anaconda3/envs/py37bluesky/lib/python3.7/site-packages/ophyd/utils/epics_pvs.py", line 200, in wrapper
    raise DisconnectedError('{} is not connected'.format(self.name))
    ophyd.utils.errors.DisconnectedError: ThetaS is not connected

    In the same environment, I can use pyepics module ( motor = epics.Motor('31a:DCM:ThetaS') ) to move the motor and to read its position without any problem.

    Would you please provide hints for debugging and finding causes?

    Thomas A Caswell
    @tacaswell
    What does ThetaS.connected give you? Does it work if you do TheatS.read()?
    yehnan
    @yehnan

    ThetaS = EpicsMotor('31a:DCM:ThetaS', name='ThetaS')
    print('ThetaS.connected', ThetaS.connected)

    The above will print "ThetaS.connected False".

    ThetaS = EpicsMotor('31a:DCM:ThetaS', name='ThetaS')
    print('ThetaS.read()', ThetaS.read())
    The above code will also raise exception DisconnectedError:
    ophyd.utils.errors.DisconnectedError: ThetaS is not connected
    yehnan
    @yehnan
    By the way, I tried Bluesky some years ago and picked it up recently. I'm trying to use Bluesky to replace in-house-made scan procedures.
    yehnan
    @yehnan

    suitcase.csv.export will raise exception ValueError: I/O operation on closed file.
    The 'export' does successfully create and write to a csv file though.

    Full code and error message: https://pastebin.com/tCsTZPqj

    yehnan
    @yehnan
    In class Serializer of suitcase.csv, both methods stop() and exit() call close(). Is it the source of the error "I/O operation on closed file"?
    wakonig
    @wakonig
    Hi, I wanted to go through your tutorials, in particular the first one ("Hello Bluesky.ipynb") but I'm always getting a timeout error: TimeoutError: Failed to connect to all signals: ph.det (mini:ph:det), ph.exp (mini:ph:exp). Any ideas what I could try? Thanks!