APS-4ID-POLAR / ipython-polar

4-ID-Polar ipython configuration for bluesky (and other)
1 stars 3 forks source link

Create XMCD plot for dichro #90

Closed gfabbris closed 3 years ago

gfabbris commented 3 years ago

This is the first go at creating a custom XMCD plot. See #42.

Usage

Start plot:

model, view = start_plot_dichro(monitor='Ion Ch 4', detector='Ion Ch 5', fluo=True)

The goal is for monitor and detector kwargs to be useless. The dichro plotter will only run when a the hints metadata has a "scan_type": "dichro" entry. Then it will also read the monitor and detectors hints.

fluo determines if a fluorescence scan will be plot (fluo = True, then XAS = I/I0) or transmission (fluo = False, then XAS = ln(I0/I)). It can set during startup (as above), or anytime after with:

model.fluo = False
# or
model.fluo = True

By default, the plotter will generate a new tab for every new 'x' positioner. If you want to force new tabs for all positioners:

model.new_plot()

or only for one particular positioner ('magnet_6T_tabx' in this example):

model.new_plot('magnet_6T_tabx' )

if the window is closed, you can reopen it with:

view.show()
lgtm-com[bot] commented 3 years ago

This pull request introduces 1 alert when merging bff1c5a9ecc0b47276327e6117f028607b18b854 into 7462bfd3a5c516b1b3f933d5bc1e5518a767f74d - view on LGTM.com

new alerts: