"- This notebook is based on a **work in progress project**, called `famewoks` and may be affected by bugs\n",
"- `famewoks` is publicly available at [https://gitlab.esrf.fr/F-CRG/fames/famewoks](https://gitlab.esrf.fr/F-CRG/fames/famewoks)\n",
"- Subscribe to the `fame-data-analysis@esrf.fr` mailing list to be kept updated about bug fixes and new features\n",
"- Report bugs and features requests in the [famewoks issues tracker](https://gitlab.esrf.fr/F-CRG/fames/famewoks/-/issues) or by directly sendin an email to [mauro.rovezzi@esrf.fr](mailto:mauro.rovezzi@esrf.fr)\n",
"- Subscribe to the [`fame-data-analysis@esrf.fr` mailing\n",
" list](https://sympa.esrf.fr/sympa/info/fame-data-analysis) to be kept updated\n",
" about bug fixes and new features\n",
"- Report bugs and features requests in the [famewoks issues tracker](https://gitlab.esrf.fr/F-CRG/fames/famewoks/-/issues) or by directly sending an email to [mauro.rovezzi@esrf.fr](mailto:mauro.rovezzi@esrf.fr)\n",
"- To run this notebook at BM16:\n",
" - (production/stable) go to [http://jade:8000](http://jade:8000) and run the notebook with the `sloth (v2312)` kernel\n",
" - (development) go to [http://bm16ctrl:8000](http://bm16ctrl:8000) and run the notebook with the `sloth` kernel\n"
...
...
%% Cell type:markdown id: tags:
# Data reduction and evaluation workflow
- This notebook is based on a **work in progress project**, called `famewoks` and may be affected by bugs
-`famewoks` is publicly available at [https://gitlab.esrf.fr/F-CRG/fames/famewoks](https://gitlab.esrf.fr/F-CRG/fames/famewoks)
- Subscribe to the `fame-data-analysis@esrf.fr` mailing list to be kept updated about bug fixes and new features
- Report bugs and features requests in the [famewoks issues tracker](https://gitlab.esrf.fr/F-CRG/fames/famewoks/-/issues) or by directly sendin an email to [mauro.rovezzi@esrf.fr](mailto:mauro.rovezzi@esrf.fr)
- Subscribe to the [`fame-data-analysis@esrf.fr` mailing
list](https://sympa.esrf.fr/sympa/info/fame-data-analysis) to be kept updated
about bug fixes and new features
- Report bugs and features requests in the [famewoks issues tracker](https://gitlab.esrf.fr/F-CRG/fames/famewoks/-/issues) or by directly sending an email to [mauro.rovezzi@esrf.fr](mailto:mauro.rovezzi@esrf.fr)
- To run this notebook at BM16:
- (production/stable) go to [http://jade:8000](http://jade:8000) and run the notebook with the `sloth (v2312)` kernel
- (development) go to [http://bm16ctrl:8000](http://bm16ctrl:8000) and run the notebook with the `sloth` kernel
%% Cell type:markdown id: tags:
First set main imports and global settings for the experiment (session)
%% Cell type:code id: tags:
``` python
%load_extautoreload
%autoreload2
# Uncomment the following two lines if the plots do not show in the notebook
Select a dataset and load the scan data into the session (e.g. load from disk to memory).
**Parameters for `load_data()`**
-`skip_scans`: the scans that are not going to be loaded (e.g. bad scans), it can be a list of numbers `[1,2,3]` or a string `"1:4, 7"`
-`use_fluo_corr`: if True, it uses the dead-time corrected fluorescence channel (**NOTE** this correction usually fails at low count rates, check with/without correction so see which is the lower noise configuration)
-`iskip`: the index of the initial data points to skip (by default we skip the first point)
-`merge`: to automatically merge the scans in a dataset (True)
-`calc_eshift`: fit the energy shift using the first scan of the dataset as reference (*NOTE* this slows down the loading)
%% Cell type:code id: tags:
``` python
sel_dataset=0
dataset=datasets[sel_dataset]
load_data(
session,
dataset,
use_fluo_corr=False,
iskip=1,
calc_eshift=True,
merge=True,
skip_scans=[],
)
```
%% Cell type:markdown id: tags:
## Data plotter
Plot the data loaded in the dataset
**Parameters for `plot_data()`**
-`data` can be:
-`"fluos"`: to show all fluorescence channels
-`"fluo"`: sum of active fluorescence channels (use `set_bad_fluo_channels()` for excluding bad ones)
-`"trans"`: sample transmission (*muT1*)
-`"ref"`: reference "foil" transmission (*muT2*)
-`ynorm`: *None* or `area` (shows y data normalized by their area)
-`show_slide`: if True shows one scan at time with a slider
-`show_i0`: *True* shows I0 signal (*NOTE* for `data = "ref"` it is I1 signal)
-`show_e0`: *True* shows E0 (as found by the `pre_edge()` function of Larch)
-`show_merge`: *True* shows the merged signal (sum of the channels for the current scan)
- if `"rebin"` it shows the rebinned version of the merge (*NOTE* the single scans are never rebinned, as they are meant to be merged (and then rebinned))
%% Cell type:code id: tags:
``` python
fig=plot_data(
dataset,
data="ref",
ynorm="area",
show_slide=True,
show_i0=False,
show_e0=False,
show_merge=False,
)
```
%% Cell type:markdown id: tags:
The plot function permits digging into the whole data for a single dataset. The following functions permits acting on the data (you may go back in the workflow and plot the data again)
%% Cell type:markdown id: tags:
## Energy alignment
First set a reference group for the energy alignment
once everything is loaded into the session, it is possible to perform grouped actions faster (no need to relaod the data in memory). For example, to plot I0 with fluorescence sum