Skip to content

Add Dask tools for VDS creation and simple image binning#14

Merged
benjaminhwilliams merged 46 commits intomainfrom
dask-tools
Mar 31, 2021
Merged

Add Dask tools for VDS creation and simple image binning#14
benjaminhwilliams merged 46 commits intomainfrom
dask-tools

Conversation

@benjaminhwilliams
Copy link
Contributor

@benjaminhwilliams benjaminhwilliams commented Mar 10, 2021

Add a tool to do each of the following:

  • Create a VDS file from LATRD Tristan time slice metadata, ideally faster and in a more easily maintained form than the tool currently in use on the beamline.
  • Bin all events into a single image for powder analysis.
  • Where there are trigger signals present in the metadata, corresponding to a laser pulse, create a composite powder image for each of several user-specified intervals after the pulse.

Closes #6.

Copy link
Contributor

@noemifrisina noemifrisina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, nexus file generation for the image file added in branch add-nexgen-to-dask.

benjaminhwilliams and others added 16 commits March 16, 2021 12:58
Co-authored-by: Markus Gerstel <markus.gerstel@diamond.ac.uk>
# Conflicts:
#	src/tristan/make_single_image.py
#	src/tristan/make_vds.py
A precursor to a Dask alternative to VDS, reusing much of the VDS code.
Tidy up the VDS code to rationalise the operation of some functions.
Return VDS-specific code to the VDS module, since it seems to be of
little use in constructing the Dask alternative.
There is a regression in dask.array.bincount that prevents slicing, see
dask/dask#7361.  This has been fixed on dask:main and the fix will
likely be included in a release soon.
Includes tools for single- and multi-image binning, without regard to
trigger signal slicing.  Scripts for trigger signal slicing (for
pump-probe data) to follow.
We don't use the event_energy data set for anything (yet).
- If missing an input NeXus file, prompt the user.
- If the output file already exists, open in "w" or "x" mode as per user
  instruction.
These seem to have got missed in a mangled merge resolution.
Exploit the trivial broadcasting of divmod over NumPy and Dask arrays to
simplify the function definition and doc.
This comes at the cost of some code clarity because it's been done in a
bit of a hurry!
- Move command-line tools to a dedicated command_line submodule.
- Use argparse subparsers for the various different image binning
  commands.
Use flatnonzero in place of argwhere.
This gets done for all the images command-line programs, so code reuse
makes sense.
@benjaminhwilliams benjaminhwilliams merged commit d546b45 into main Mar 31, 2021
@benjaminhwilliams benjaminhwilliams deleted the dask-tools branch March 31, 2021 13:17
@benjaminhwilliams benjaminhwilliams mentioned this pull request Mar 31, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor image binning code

2 participants