In [1]:
%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import os
from pyxrf.model.command_tools import fit_pixel_data_and_save


/Users/Li/miniconda2/envs/pyxrf_dev/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
  "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)

In [ ]:
# define working directory and file names

In [2]:
wd = '/Users/Li/Research/Experiment/Miller_APS_July2016/e152143_Miller/img.dat.old'

In [15]:
runid_list = [475, 474, 470]
filelist = ['bnp_fly0{}.h5'.format(n) for n in runid_list]

In [16]:
filelist


Out[16]:
['bnp_fly0475.h5', 'bnp_fly0474.h5', 'bnp_fly0470.h5']

In [17]:
# define parameter file, which also stays at the same wd

In [18]:
param_file = 'bnp_fly_cell1.json'

In [19]:
# fit data, need to define data_from='2IDE-APS'

In [20]:
for fname in filelist:
    fit_pixel_data_and_save(wd, fname, param_file_name=param_file, data_from='2IDE-APS')


file path is /Users/Li/Research/Experiment/Miller_APS_July2016/e152143_Miller/img.dat.old/bnp_fly0475.h5
Time used for pixel fitting for file bnp_fly0475.h5 is : 4.64956402779
file path is /Users/Li/Research/Experiment/Miller_APS_July2016/e152143_Miller/img.dat.old/bnp_fly0474.h5
Time used for pixel fitting for file bnp_fly0474.h5 is : 5.0111720562
file path is /Users/Li/Research/Experiment/Miller_APS_July2016/e152143_Miller/img.dat.old/bnp_fly0470.h5
Time used for pixel fitting for file bnp_fly0470.h5 is : 4.57977819443
/Users/Li/miniconda2/envs/pyxrf_dev/lib/python2.7/site-packages/numpy/lib/function_base.py:3834: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)

In [ ]: