Currently, if some data field (for instance, some position axis) is absent in the .rasx file, the reader throws a key error and processing is interrupted.
To avoid this, the reader should handle missing data, and also missing data units. I also believe that current way of accessing data and units separately is not ideal. Instead, we can implement get methods in RASXFile class within IKZ module. These will collect both values and units, handle if one or both of them are missing, bind them together, and return a dict.
This allows for a cleaner integration of data within read_rigaku_rasx function, where nomad.units can be used on top of them to make .
[x] implement methods in RASXFile get_1d_scan (replaces the current get_RSM), get_source_info, get_scan_info which takes care of missing values, datatype, and units (or default units). The adjustment of units of the quantities happen here.
[x] harmonize with read_rigaku_rasx -- if the quantity is present, add it along with the units
[x] Revise count_time in read_rigaku_rasx
[x] move 2d data handling to get_1d_scan
[x] implement set_quantity function which processes the quantities based on available value and unit
Currently, if some data field (for instance, some position axis) is absent in the .rasx file, the reader throws a key error and processing is interrupted.
To avoid this, the reader should handle missing data, and also missing data units. I also believe that current way of accessing data and units separately is not ideal. Instead, we can implement get methods in
RASXFile
class within IKZ module. These will collect both values and units, handle if one or both of them are missing, bind them together, and return a dict.This allows for a cleaner integration of data within.
read_rigaku_rasx
function, wherenomad.units
can be used on top of them to makeget_1d_scan
(replaces the currentget_RSM
),get_source_info
,get_scan_info
which takes care of missing values, datatype, and units (or default units). The adjustment of units of the quantities happen here.read_rigaku_rasx
-- if the quantity is present, add it along with the unitscount_time
inread_rigaku_rasx
get_1d_scan
set_quantity
function which processes the quantities based on available value and unit