neutronimaging / ToFImaging

Tool package for neutron time of flight analysis
GNU General Public License v3.0
7 stars 2 forks source link

parsing more than one spectrum in a directory #16

Open manuel-morgano opened 5 years ago

manuel-morgano commented 5 years ago

Dear developer(s),

it is often the case that in one directory we have more than one ToF radiography (for example to split a long exposure time). These files are normally named with a _00x at the end of their given name (e.g. test_000_0nnnn.fits and test_001_0nnnn,fits). It would be great if with your program one would be able to correct each of them with its own spectrum file. Thanks a lot and keep up with the great work

M

anderskaestner commented 5 years ago

This could be solved with the python formatting of strings eg. Example

fname = "test_{1:04d}_{0:05d}.fits" # Template

for spec in np.arange(Nspec) :
    for idx in np.arange(Nbins) :
         print(fname.format(idx,spec)