KamzikConverter#
- class pyrost.KamzikConverter(protocol=<factory>, fs_vec=array([-5.5e-05, 0.0e+00, 0.0e+00]), ss_vec=array([ 0.0e+00, -5.5e-05, 0.0e+00]), idxs=None, log_attr=<factory>, log_data=<factory>)#
A converter class, that generates CXI datasets aceeptable by
pyrost.STDatafrom Kamzik log files.- Parameters
protocol (
LogProtocol) – Log file protocol.fs_vec (
ndarray) – Fast (horizontal) scan detector axis.ss_vec (
ndarray) – Slow (vertical) scan detector axis.idxs (
Optional[ndarray]) – Frame indices read from a log file.log_attr (
Optional[Dict[str,Any]]) – Dictionary of log attributes read from a log file.log_data (
Optional[Dict[str,Any]]) – Dictionary of log datasets read from a log file.
- contents()#
Return a list of the attributes stored in the container that are initialised.
- cxi_get(attrs)#
Convert Kamzik log files data into CXI attributes, that are accepted by
pyrost.STDatacontainer. To see full list of available CXI attributes, useKamzikConverter.cxi_keys().- Parameters
attrs (
Union[str,List[str]]) – List of CXI attributes to generate. The method will raise an error if any of the attributes is unavailable.- Raises
ValueError – If any of attributes in attrs in unavailable.
- Return type
- Returns
A dictionary of CXI attributes, that are accepted by
pyrost.STDatacontainer.
- cxi_keys()#
Return a list of available CXI attributes.
- find_log_attribute(attr, part_key=None)#
Find a value in the log attributes corresponding to an attribute name attr.
- find_log_dataset(attr)#
Find a dataset in the log data corresponding to an attribute name attr.
- find_log_part_key(attr)#
Find a name of the log dictionary corresponding to an attribute name attr.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- read_logs(log_path, idxs=None)#
Read a log file under the path log_path. Read out only the frame indices defined by
idxs. Ifidxsis None, read the whole log file.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.