You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We implemented LiveTiffExporter in 91-userscans.py, but it has problem related to 'db'.
It's unclear why db is None in the broker.py name space.
error trace-back:
In [7]: RE(xrfmap(xstart=49.0, xnumstep=3, xstepsize=0.1, ystart=51.0, ynumstep=3, ystepsize=0.1, rois=[sclr.channels.chan5.name]))
---------------------------------------------------------------------------ImportErrorTraceback (mostrecentcalllast)
<ipython-input-7-92b9228ecf29>in<module>()
---->1RE(xrfmap(xstart=49.0, xnumstep=3, xstepsize=0.1, ystart=51.0, ynumstep=3, ystepsize=0.1, rois=[sclr.channels.chan5.name]))
/opt/conda_envs/collection-17Q2.0/lib/python3.6/site-packages/bluesky/run_engine.pyin__call__(self, plan, subs, raise_if_interrupted, **metadata_kw)
597# it (unless it is a canceled error)598ifexcisnotNone:
-->599raiseexc600601ifraise_if_interruptedandself._interrupted:
/opt/conda_envs/collection-17Q2.0/lib/python3.6/site-packages/bluesky/run_engine.pyin_run(self)
1021self.log.error("Run aborted")
1022self.log.error("%r", err)
->1023raiseerr1024finally:
1025# Some done_callbacks may still be alive in other threads./opt/conda_envs/collection-17Q2.0/lib/python3.6/site-packages/bluesky/run_engine.pyin_run(self)
919resp=self._response_stack.pop()
920try:
-->921msg=self._plan_stack[-1].send(resp)
922# We have exhausted the top generator923exceptStopIteration:
/home/xf08bm/.ipython/profile_collection/startup/91-userscans.pyinxrfmap(xstart, xnumstep, xstepsize, ystart, ynumstep, ystepsize, rois)
39#setup LiveOutput40xrfmapOutputTiffTemplate=xrfmapTiffOutputDir+"xrfmap_scan{start[scan_id]}"+roi+".tiff"--->41xrfmapTiffexporter=LiveTiffExporter(roi, xrfmapOutputTiffTemplate)
42callbackToken=RE.subscribe('all', post_run(xrfmapTiffexporter))#check to see if this is the right way to have RE here...43callbackTokenList.append(callbackToken)
/opt/conda_envs/collection-17Q2.0/lib/python3.6/site-packages/bluesky/callbacks/broker.pyin__init__(self, field, template, dryrun, overwrite, db)
208209ifdbisNone:
-->210fromdatabrokerimportDataBrokerasdb211212self.db=dbImportError: cannotimportname'DataBroker'
91-userscnas code:
frombluesky.callbacks.brokerimportLiveTiffExportertestevents=list(db.get_events(db[-1]))
xrfmapTiffOutputDir='/home/xf08bm/DATA2017/Comissioning/20170616/'#hard-coded for testing now; need to be set to automatically use SAF, today's date, etc.defxrfmap(*, xstart, xnumstep, xstepsize,
ystart, ynumstep, ystepsize,
rois= []
#shutter = True, align = False,#acqtime, numrois=1, i0map_show=True, itmap_show=False, record_cryo = False,#setenergy=None, u_detune=None, echange_waittime=10
):
''' input: xstart, xnumstep, xstepsize (float) ystart, ynumstep, ystepsize (float) '''#define detector used for xrf mapping functionsxrfdet= [sclr] #currently only the scalar; to-do: save full spectraxstop=xstart+xnumstep*xstepsizeystop=ystart+ynumstep*ystepsize#setup live callbacks:livetableitem= [xy_stage.x, xy_stage.y]
livecallbacks= []
callbackTokenList= []
forroiinrois:
livecallbacks.append(LiveGrid((ynumstep+1, xnumstep+1), roi, xlabel='x (mm)', ylabel='y (mm)', extent=[xstart, xstop, ystart, ystop]))
livetableitem.append(roi)
#setup LiveOutputxrfmapOutputTiffTemplate=xrfmapTiffOutputDir+"xrfmap_scan{start[scan_id]}"+roi+".tiff"xrfmapTiffexporter=LiveTiffExporter(roi, xrfmapOutputTiffTemplate)
callbackToken=RE.subscribe('all', post_run(xrfmapTiffexporter))#check to see if this is the right way to have RE here...callbackTokenList.append(callbackToken)
livecallbacks.append(LiveTable(livetableitem))
xrfmap_scanplan=outer_product_scan(xrfdet, xy_stage.y, ystart, ystop, ynumstep+1, xy_stage.x, xstart, xstop, xnumstep+1, False)
xrfmap_scanplan=bp.subs_wrapper(xrfmap_scanplan, livecallbacks)
scaninfo=yieldfromxrfmap_scanplanforcallbackTokenincallbackTokenList:
RE.unsubscribe(callbackToken)
returnxrfmap_scanplan
The text was updated successfully, but these errors were encountered:
We implemented LiveTiffExporter in 91-userscans.py, but it has problem related to 'db'.
It's unclear why db is None in the broker.py name space.
error trace-back:
91-userscnas code:
The text was updated successfully, but these errors were encountered: