(reduction module)= # **reduction module** The reduction module is used to convert the original Febus format into a reducted format with the following options and properties: - transpose the section from the original [time x space] ordering into a [space x time] ordering with faster access for usual processing - decimated section along time or space dimension - selected range for the time or space dimension - eliminate redundant data - optimization of chunk size(s) in HDF5 container - simplified metadata storage ## reduction functions These two functions perform the conversion: ```{eval-rst} .. autofunction:: reduction.reduction_transpose ``` ```{eval-rst} .. autofunction:: reduction.reduction_notranspose ``` ## reducted format The reducted format uses a HDF5 container to store data and metadata (or header). It is simplified and optimized as much as possible. It can be used either using a1das IO functions or directly using H5 IO functions or calls. ### HDF5 format detail The format uses one group and three datasets: - **/header** group - contains metadata stored as attributes. Using h5py, they are read as a dictionary - **/distance** dataset - 1D distance vector of size __nspace__ - **/time** dataset - 1D time vector of size __ntime__ - **/section** dataset - 2D section array of size [__nspace__ x __ntime__] or [__nspace__ x __ntime__] depending wether data has been transposed or not #### Header content - file_type = 'reducted_format' - version = reducted format version number plus all the metadata included in the A1Section header. The A1Section header is a class that mimics a python dictionary and that can be extended dynamically. Mandatory header values can be viewed by calling _A1Section.header()_ method: ``` A1Section Mandatory header fields --------------------------------- (see in _a1headers.py "_required_header_keys" dict) key | meaning --------------------------------------------------- gauge_length | gauge length (meter) sampling_res | original spatial resolution (cm), usually between 20 and 60 cm prf | laser Pulse Rate Frequency (Hz) data_type | data type = raw, strain, strain-rate, ... axis1 | dimension of data first axis: "time" or "space" axis2 | dimension of data second axis: "time" or "space" dt | time step (sec) for time axis ntime | number of time samples otime | origin time. Absolute time of a sample is : time + otime dx | spatial step (m) for distance axis nspace | number of space samples ospace | origin position along fiber. The absolute distance is given by dist + ospace dist | relative distance vector w/r to origin position time | relative time vector w/r to origin time A1Section optionnal header fields --------------------------------- (see in _a1headers.py "_other_header_keys" dict) derivation_time | time interval (msec) used for time derivation time_derivation_order | finite difference order for time derivation space_derivation_order | finite difference order for space derivation ```