atomscale.results.xps.XPSResult#
- class atomscale.results.xps.XPSResult(data_id: UUID | str, xps_id: UUID | str, binding_energies: list[float], intensities: list[float], predicted_composition: dict[str, float], detected_peaks: list[dict], elements_manually_set: bool, collected_datetime: str | None = None)[source]
Bases:
MSONableXPS result
- Parameters:
data_id (UUID | str) – Data ID for the entry in the data catalogue.
xps_id (UUID | str) – Unique ID for this specific XPS result.
binding_energies (list[float]) – List of binding energy values in eV.
intensities (list[float]) – List of intensity values.
predicted_composition (dict[str, float]) – Mapping between element symbols and predicted fractional composition values.
detected_peaks (list[dict]) – List of detected peaks, each a dict describing one peak’s binding energy, element, and orbital type (plus derived quantities such as peak area).
elements_manually_set (bool) – Whether the elements represented in the predicted composition were manually specified by the user.
collected_datetime (str | None) – Datetime when the data was collected.
- __init__(data_id: UUID | str, xps_id: UUID | str, binding_energies: list[float], intensities: list[float], predicted_composition: dict[str, float], detected_peaks: list[dict], elements_manually_set: bool, collected_datetime: str | None = None)[source]
XPS result
- Parameters:
data_id (UUID | str) – Data ID for the entry in the data catalogue.
xps_id (UUID | str) – Unique ID for this specific XPS result.
binding_energies (list[float]) – List of binding energy values in eV.
intensities (list[float]) – List of intensity values.
predicted_composition (dict[str, float]) – Mapping between element symbols and predicted fractional composition values.
detected_peaks (list[dict]) – List of detected peaks, each a dict describing one peak’s binding energy, element, and orbital type (plus derived quantities such as peak area).
elements_manually_set (bool) – Whether the elements represented in the predicted composition were manually specified by the user.
collected_datetime (str | None) – Datetime when the data was collected.
Methods
__init__(data_id, xps_id, binding_energies, ...)XPS result
as_dict()A JSON serializable dict representation of an object.
from_dict(d)Reconstruct an MSONable object from a dict.
get_plot()Get plot of X-ray Photoelectron Spectrum
load(file_path)Load an instance from a JSON file written by
save().save(json_path[, mkdir, json_kwargs, ...])Serialize the instance to JSON on disk, pickling fields if needed.
to_json()Returns a json string representation of the MSONable object.
unsafe_hash()Return a hash of the current object.
validate_monty_v1(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x.
validate_monty_v2(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x.
Attributes
REDIRECT- get_plot() Figure[source]
Get plot of X-ray Photoelectron Spectrum
- Returns:
Matplotlib Figure object containing plot data
- Return type:
(Figure)
- as_dict() dict
A JSON serializable dict representation of an object.
- Return type:
dict
- classmethod from_dict(d: dict) MSONable
Reconstruct an MSONable object from a dict.
- Parameters:
d (
dict) – Dict representation.- Return type:
MSONable- Returns:
MSONable class.
- classmethod load(file_path: PathLike | str) MSONable
Load an instance from a JSON file written by
save().- Parameters:
file_path (
PathLike|str) – The JSON file to load from.- Return type:
MSONable- Returns:
An instance of the class being reloaded.
- save(json_path: PathLike | str, mkdir: bool = True, json_kwargs: dict | None = None, pickle_kwargs: dict | None = None, strict: bool = True) None
Serialize the instance to JSON on disk, pickling fields if needed.
For a fully MSONable class, only
{save_dir}/class.jsonis written. For a partially MSONable class, non-serializable attributes are pickled individually into the same directory, keeping the JSON portion readable.- Parameters:
json_path (
PathLike|str) – The file to which to save the JSON object. A pickled companion file with the same stem but a different extension may also be written if the class is not entirely MSONable.mkdir (
bool) – If True, create the target directory (including parents).json_kwargs (
dict|None) – Keyword arguments forwarded to the JSON serializer.pickle_kwargs (
dict|None) – Keyword arguments forwarded topickle.dump.strict (
bool) – If True, refuse to overwrite existing files.
- Return type:
None
- to_json() str
Returns a json string representation of the MSONable object.
- Return type:
str
- unsafe_hash() Any
Return a hash of the current object.
This uses a generic but low performance method of converting the object to a dictionary, flattening any nested keys, and then performing a hash on the resulting object.
- Return type:
Any
- classmethod validate_monty_v1(_MSONable__input_value)
Pydantic validator with correct signature for pydantic v1.x.
- classmethod validate_monty_v2(_MSONable__input_value, _)
Pydantic validator with correct signature for pydantic v2.x.