Skip to content

Energy scans for NanoMAX #101

Description

@leosdo

Energy scans have recently been implemented in NanoMAX, which has changed the relevant entries in the HDF5 (.h5) file structure.
An update to the nanomax.py loader is required so that it correctly reads the energy values for these new scan types.

Current behavior (for rocking curves)

@h5_safe_load
def load_energy(self) -> float:
    """
    Load and return the energy used during the experiment.

    Args:
        scan (int): The scan number of the file to load the energy from.

    Returns:
        float: The energy value in keV.
    """
    return self.h5file["entry/snapshots/post_scan/energy"][0]

Required behavior (for energy scans):

@h5_safe_load
def load_energy(self) -> float:
    """
    Load and return the energy used during the experiment.

    Args:
        scan (int): The scan number of the file to load the energy from.

    Returns:
        float: The energy value in eV.
    """
    return self.h5file["entry/panda1/Energy.Value/"][:]

Note that No unit conversion is needed, as the energies are stored directly in eV (ex: energyflyscan 9600 9720 60 0.5)

Thanks for your help :)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions