MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / output_data

Function output_data

pyxrf/model/fileio.py:1164–1292  ·  view source on GitHub ↗

Read data from h5 file and transfer them into txt. Parameters ---------- dataset_dict : dict(ndarray) Dictionary of XRF maps contained in the selected dataset. Each XRF map is saved in the individual file. File name consists of the detector channel name (e.g. 'detsu

(
    dataset_dict=None,
    output_dir=None,
    file_format="tiff",
    scaler_name=None,
    use_average=False,
    dataset_name=None,
    quant_norm=False,
    quant_ref_eline="",
    param_quant_analysis=None,
    positions_dict=None,
    interpolate_to_uniform_grid=False,
    scaler_name_list=None,
)

Source from the content-addressed store, hash-verified

1162
1163
1164def output_data(
1165 dataset_dict=None,
1166 output_dir=None,
1167 file_format="tiff",
1168 scaler_name=None,
1169 use_average=False,
1170 dataset_name=None,
1171 quant_norm=False,
1172 quant_ref_eline="",
1173 param_quant_analysis=None,
1174 positions_dict=None,
1175 interpolate_to_uniform_grid=False,
1176 scaler_name_list=None,
1177):
1178 """
1179 Read data from h5 file and transfer them into txt.
1180
1181 Parameters
1182 ----------
1183 dataset_dict : dict(ndarray)
1184 Dictionary of XRF maps contained in the selected dataset. Each XRF map is saved in
1185 the individual file. File name consists of the detector channel name (e.g. 'detsum', 'det1' etc.)
1186 and map name (dictionary key). Optional list of scaler names 'scaler_name_list' may be passed
1187 to the function. If map name is contained in the scaler name list, then the detector channel
1188 name is not attached to the file name.
1189 output_dir : str
1190 which folder to save those txt file
1191 file_format : str, optional
1192 tiff or txt
1193 scaler_name : str, optional
1194 if given, normalization will be performed.
1195 use_average : Bool, optional
1196 when normalization, multiply by the mean value of scaler,
1197 i.e., norm_data = data/scaler * np.mean(scaler)
1198 dataset_name : str
1199 the name of the selected datset (in Element Map tab)
1200 should end with the suffix '_fit' (for sum of all channels), '_det1_fit" etc.
1201 quant_norm : bool
1202 True - quantitative normalization is enabled, False - disabled
1203 quant_ref_eline: str
1204 Reference emission line for quantitative calibration, e.g. 'Cu_K'. Apply quantitative
1205 normalization only to the lines with existing calibration data if ``quant_ref_eline=""``
1206 (emtpy string, default).
1207
1208 param_quant_analysis : ParamQuantitativeAnalysis
1209 reference to class, which contains parameters for quantitative normalization
1210 interpolate_to_uniform_grid : bool
1211 interpolate the result to uniform grid before saving to tiff and txt files
1212 The grid dimensions match the dimensions of positional data for X and Y axes.
1213 The range of axes is chosen to fit the values of X and Y.
1214 scaler_name_list : list(str)
1215 The list of names of scalers that may exist in the dataset 'dataset_dict'
1216 """
1217
1218 if not dataset_name:
1219 raise RuntimeError("Dataset is not selected. Data can not be saved.")
1220
1221 if dataset_dict is None:

Callers 2

fit_pixel_data_and_saveFunction · 0.85
output_2DimageMethod · 0.85

Calls 3

grid_interpolateFunction · 0.85
output_data_to_tiffFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected