1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: AreaDetector NDFileHDF5 dynamic frame-placement within an opened H5-file |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Sintschuk, Michael" <michael.sintschuk at bam.de> |
Date: | Wed, 8 Dec 2021 18:59:42 +0000 |
Hi Michael,
What you would like to do with flat and data images is exactly what we are currently doing at the tomography beamlines at the APS. We are using the Python package called tomoscan:
Documentation: https://tomoscan.readthedocs.io/en/latest/
The tomoScan.template file defines the locations of where the data should be stored in the HDF5 file: https://github.com/tomography/tomoscan/blob/master/tomoScanApp/Db/tomoScan.template
################################
# Location for data in HDF5 file
################################
record(stringout, "$(P)$(R)HDF5ProjectionLocation")
{
field(VAL, "/exchange/data")
}
record(stringout, "$(P)$(R)HDF5DarkLocation")
{
field(VAL, "/exchange/data_dark")
}
record(stringout, "$(P)$(R)HDF5FlatLocation")
{
field(VAL, "/exchange/data_white")
}
record(stringout, "$(P)$(R)HDF5Location")
{
}
Here is an example of an HDF Layout file for the detector we use on one beamline: https://github.com/CARS-UChicago/GSECARS-EPICS/blob/master/iocBoot/ioc13bmd_pg1/tomoLayout.xml
It contains the following. The first line means that the NDArray attribute HDF5FrameLocation defines the location of the data in the
HDF5 via the global detector_data_destination which is understood by NDFileHDF5.
<global name="detector_data_destination" ndattribute="HDF5FrameLocation" />
<group name="exchange">
<dataset name="frame_type" source="ndattribute" ndattribute="FrameType" when="OnFileClose" />
<dataset name="data" source="detector">
<!-- SaveDest = 0 : /exchange/data -->
<attribute name="description" source="constant" value="ImageData" type="string" />
<attribute name="axes" source="constant" value="theta:y:x" type="string" />
<attribute name="units" source="constant" value="counts" type="string" />
</dataset>
<dataset name="data_dark" source="detector">
<!-- SaveDest = 1 : /exchange/data_dark -->
<attribute name="description" source="constant" value="DarkData" type="string" />
<attribute name="axes" source="constant" value="theta:y:x" type="string" />
<attribute name="units" source="constant" value="counts" type="string" />
</dataset>
<dataset name="data_white" source="detector">
<!-- SaveDest = 2 : /exchange/data_white -->
<attribute name="description" source="constant" value="WhiteData" type="string" />
<attribute name="axes" source="constant" value="theta:y:x" type="string" />
<attribute name="units" source="constant" value="counts" type="string" />
</dataset>
tomoDetectorAttributes.xml is the detector attribute XML file for this detector.
It contains this line:
<Attribute name="HDF5FrameLocation" type="EPICS_PV" source="$(TS)HDF5Location" dbrtype="DBR_STRING"
description="Where
to store frame in HDF5 file"/>
The Python code sets the location of the data in the HDF file:
This sets the data to be stored in /exchange/data_white for the flat fields:
self.epics_pvs['HDF5Location'].put(self.epics_pvs['HDF5FlatLocation'].value)
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Sintschuk, Michael via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, December 8, 2021 10:54 AM To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: AreaDetector NDFileHDF5 dynamic frame-placement within an opened H5-file Hello EPICS-community,
as the title of this thread says, I’m wondering if it is possible to dynamically select where an incoming frame is placed within the HDF5-Files structure. For example, while capturing frames in Stream-mode with the default HDF5-Files structure layout, all incoming frames are placed to: entry -> instrument -> detector -> data
Now I want to load an individual hdf5-layout.xml with the additional location “flat”: entry -> instrument -> detector -> flat
Is there a way that I can switch (via an EPICS-PV) the location where the next frame is stored, either “entry -> instrument -> detector -> data” or “entry -> instrument -> detector -> flat”, while the h5-files is still opened? Example scan with a total of 1000 frames, all should go into one h5-file:
In the AreaDetector user-guide there is the following section: I switched on the Position mode and put Index N to 0 (or 1) and put Name N to “flat” but I get a Write error status. I think I don’t understand the handling of the dataset dimensions within the h5-file and don’t know if my frame-placement sequence is actually realizable. Can someone help?
Thanks! Michael
Michael Sintschuk
P: +49 30 8104-4065 (BAM, Steglitz) michael.sintschuk at helmholtz-berlin.de
|