"""The ARPES reader and result."""
from ..task_result import TaskResult, KkrOutputReader
from .default import DefaultOutputParser
from ...common.decorators import cached_property
import os
[docs]
class ArpesResult(TaskResult):
"""ARPES result provides acces to the generated SPC output file
containing the results of Angle resolved photoelectron electroscopy,
using the :py:attr:`~spc` property."""
[docs]
@cached_property
def spc_filename(self):
"""Spectroscopy results file name"""
fname = self.input_parameters.CONTROL.DATASET() + "_ARPES_data.spc"
if self.directory:
fname = os.path.join(self.directory, fname)
return fname
[docs]
@cached_property
def spc(self):
"""Spectroscopy results."""
return self.output_values["spc"].parsed_file()
@property
def arpes(self):
""" Alias of ``meth:ArpesResult.spc`` """
return self.spc()
@property
def output_values(self):
if "spc" not in self.files:
self.files.add_file("spc", self.spc_filename, "spc")
return self.files
[docs]
class ArpesOutputReader(KkrOutputReader):
"""ARPES task has no special parser, it just has a special
result, that allow easy acces to spc output file"""
result_class = ArpesResult
parser_class = DefaultOutputParser