In [1]:
from pyxrf.api import *

Define parameters first


In [3]:
#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

In [5]:
spec_to_hdf(wd, spec_file, spectrum_file, output, data_shape, 
            ic_name='MiniIonChamber', x_name='H', y_name='V')

In [8]:
# check the doc of given function
?spec_to_hdf

In [ ]: