MagNET / analysis /code /shared /spreadsheet.py
ekwan16's picture
Add files using upload-large-folder tool
64c992d verified
Raw
History Blame Contribute Delete
388 Bytes
"""Helpers for parsing the experimental spreadsheets' conventions."""
def site_atom_indices(atom_numbers):
"""0-based atom indices for a site from a spreadsheet's 1-based comma-separated atom_numbers
(e.g. "17,19" or "21"), the convention used by both the delta-22 and applications experimental
spreadsheets."""
return [int(x) - 1 for x in str(atom_numbers).split(",")]