Yaml file reading a collection of txt files
Hi, everyone. I read here NavARP (v.1.2.0) can already open a collection of .txt files from a .yaml file. So, I am testing it. First time, I tried to load an example.yaml file I got the following error:
the way in which I solved this problem was changing the line
1561: if "Dimension 3 size": to 1561: if "Dimension 3 size" in line:
So, this change fixed up that error. After doing this and trying again to load the .example.yaml file. I got the following error
I am working on solving this. When I fix up, I will update this issue.
Comment 1: This last error has been also found for a collection of .pxt and .krx files.
Comment 2: This error comes from the method fermilevel.align_to_same_eb . It expects as argument energies a two-dimensional np.array. Where the first index has to be related to the energy scan (hv=10,11,12..) and the second one is the full initial energy of the measurement. If we measure at hv=10 eV, the second index will be a set of energies in a range for example [3,5.5] eV. So we need to prepare the argument to this method (energy_init) a two-dimensional np.array. For doing it is necessary to make a modification of the metod init_ebins in navfile.py.
Comment 3: I have got eliminate the errors. For it, I have made a modification of the method init_ebins in navfile. The modification is the following:
self.energies_init = np.copy(self.energies) Comment the upper line and write: self.energies_init=np.array([[None for j in range(len(self.energies))] for i in range (len(self.scans))]) for i in range(len(self.scans)): for j in range(len(self.energies)): self.energies_init[i][j] = self.data[i][0][j] #any index is ok for angular index
Anyway, I am sure that this change, (although correct the error), produces others. So, in order to have a consistent form. I will suggest to introduce to the method "init_ebins" an optional boolean argument called "Yaml". If "Yaml == True", then it does my modification (or other more elegant). If "Yaml == False", then it does the previous one case.
Bye!