https://jupyter.sdcc.bnl.gov/jupyterhub/nsls
Open a new Termainal in Jupyter, and type or paste:
export MY_ENV=test-databroker
mkdir -p ~/venv
python -m venv ~/venv/$MY_ENV
source ~/venv/$MY_ENV/bin/activate
pip install wheel # It's important to do this separately and first.
pip install ipykernel
pip install --pre databroker # pre-released version of databroker 1.0.0
pip install matplotlib # optional...anything you want
~/venv/$MY_ENV/bin/python -m ipykernel install --user --name $MY_ENV --display-name "DataBroker Test"Go to File > Hub Control Panel and restart your server. This may not be necessary, but it's one way to ensure that the new kernel appears in your list of options.
Open a notebook and do this:
%matplotlib inline
import matplotlib.pyplot as plt
from intake import open_catalog
# There will soon be a slicker way to open the "default" catalog.
catalog = open_catalog('intake://broker', page_size=10)
list(catalog) # Shows all your options---for now, just 'csx'.
csx = cat['csx']()
entry = csx['9b24c09f-ef87-4b43-af1c-e89c7e29751e']
run = entry()
run
for name, doc in run.canonical(fill='yes'):
if name == 'event' and 'fccd_image' in doc['data']:
break
plt.imshow(doc['data']['fccd_image'][0, ...])