<jupyter_start><jupyter_text>Define parameters first<jupyter_code>#wd is the folder where is saved
wd = '/Users/lili/Research/Experiment/Canadian_LS/CoarseMapW1000_bone1/'
# spec_file is the standard ascii file
spec_file = 'Coarse_Map_W1000_bone_1.dat'
# spectrum_file saves all the fluorescence spectrum from each point
spectrum_file = 'Coarse_Map_W1000_bone_FourElementVortex_1.dat'
# output is the h5 file we want to creat. There will be error if the flie already exists.
output = 'my_test.h5' 
# data_shape is shape of 2D scan, [num of row, num of column]
data_shape = [57,69]  

# we also need to know ic_name, x position, y position from spec file
spec_to_hdf(wd, spec_file, spectrum_file, output, data_shape, 
            ic_name='MiniIonChamber', x_name='H', y_name='V')
# check the doc of given function
?spec_to_hdf<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08187134502923976, 'fraction_numerical': 0.025730994152046785, 'mean_word_length': 5.484848484848484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '191206', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 320, 'n_tokens_neox': 295, 'n_words': 92, 'path': 'examples/specfile_to_hdf.ipynb', 'repo_name': 'dmgav/PyXRF', 'size': '855'}