import matplotlib as mpl from IPython.terminal.prompts import Prompts, Token class SRXPrompt(Prompts): def in_prompt_tokens(self, cli=None): return [ (Token.Prompt, "BlueSky@SRX ["), (Token.PromptNum, str(self.shell.execution_count)), (Token.Prompt, "]: "), ] ip = get_ipython() nslsii.configure_base(ip.user_ns, "srx") nslsii.configure_olog(ip.user_ns) ip.prompts = SRXPrompt(ip) # Optional: set any metadata that rarely changes. RE.md["beamline_id"] = "SRX" # Custom Matplotlib configs: mpl.rcParams["axes.grid"] = True # grid always on # Comment it out to enable BEC table: bec.disable_table() # Disable BestEffortCallback to plot ring current bec.disable_plots() # Temporary fix before it's fixed in ophyd
import nslsii nslsii.configure_base(get_ipython().user_ns, 'srx') nslsii.configure_olog(get_ipython().user_ns) #Optional: set any metadata that rarely changes. RE.md['beamline_id'] = 'SRX' # Custom Matplotlib configs: import matplotlib as mpl mpl.rcParams['axes.grid'] = True #grid always on # Uncomment the following lines to turn on verbose messages for # debugging. # import logging # ophyd.logger.setLevel(logging.DEBUG) # logging.basicConfig(level=logging.DEBUG) from ophyd import PseudoSingle, PseudoPositioner, Signal from IPython.terminal.prompts import Prompts, Token class SRXPrompt(Prompts): def in_prompt_tokens(self, cli=None): return [(Token.Prompt, 'BlueSky@SRX ['), (Token.PromptNum, str(self.shell.execution_count)), (Token.Prompt, ']: ')] ip = get_ipython()
from bluesky.callbacks.olog import logbook_cb_factory from functools import partial from pyOlog import SimpleOlogClient import queue import threading from warnings import warn import nslsii # Set up the logbook. This configures bluesky's summaries of # data acquisition (scan type, ID, etc.). LOGBOOKS = ['Data Acquisition'] # list of logbook names to publish to simple_olog_client = SimpleOlogClient() generic_logbook_func = simple_olog_client.log configured_logbook_func = partial(generic_logbook_func, logbooks=LOGBOOKS) # This is for ophyd.commands.get_logbook, which simply looks for # a variable called 'logbook' in the global IPython namespace. logbook = simple_olog_client cb = logbook_cb_factory(configured_logbook_func) nslsii.configure_olog(get_ipython().user_ns, callback=cb)
from csx1.startup import * from IPython import get_ipython import nslsii nslsii.configure_olog(get_ipython().user_ns)
{{- start.plan_name }} ['{{ start.uid[:6] }}'] (scan num: {{ start.scan_id }}) Scan Plan --------- {{ start.plan_type }} {%- for k, v in start.plan_args | dictsort %} {{ k }}: {{ v }} {%- endfor %} {% if 'signature' in start -%} Call: {{ start.signature }} {% endif %} Metadata -------- {% for k, v in start.items() -%} {%- if k not in ['plan_type', 'plan_args'] -%}{{ k }} : {{ v }} {% endif -%} {%- endfor -%}""" desc_dispatch = {'edge_ascan': """ {{- start.name }} [{{ start.plan_name }} '{{ start.uid[:6] }}'] (scan num: {{ start.scan_id }})"""} cb = logbook_cb_factory(configured_logbook_func, desc_template=desc_template, desc_dispatch=desc_dispatch) nslsii.configure_olog(get_ipython().user_ns, callback=cb) # WARNING: gs. is no longer supported by bluesky # if needed, you may uncomment these lines and define your own gs at your own # risk #class gs: #DETS=[]
db = Broker_New(mds, CompositeRegistry(_fs_config)) from hxntools.handlers import register as _hxn_register_handlers _hxn_register_handlers(db_new) #_hxn_register_handlers(_db_cluster) _hxn_register_handlers(db_old) del _hxn_register_handlers # do the rest of the standard configuration from IPython import get_ipython from nslsii import configure_base, configure_olog # configure_base(get_ipython().user_ns, db_new, bec=False) configure_base(get_ipython().user_ns, db, bec=False) configure_olog(get_ipython().user_ns) from bluesky.callbacks.best_effort import BestEffortCallback bec = BestEffortCallback() # un import * ns = get_ipython().user_ns for m in [bp, bps, bpp]: for n in dir(m): if (not n.startswith('_') and n in ns and getattr(ns[n], '__module__', '') == m.__name__): del ns[n] del ns from bluesky.magics import BlueskyMagics