Julian-Hochhaus / LG4X-V2

A graphical user interface of Python lmfit package was developed for standard X-ray photoemission spectroscopy (XPS) curve fitting analysis. The interface streamlines the fitting procedures for validating results and their consistency.
https://julian-hochhaus.github.io/LG4X-V2/
Other
20 stars 9 forks source link

Error when trying to import a txt file #97

Closed andrefahl closed 2 months ago

andrefahl commented 8 months ago

When I try to import the txt file with data of my measurements I got this error: The input file is not in the correct format!. The following traceback may help to solve the issue:\n ***\nTraceback (most recent call last): File "e:\LG4X\LG4X-V2-master\Python\main.py", line 2029, in plot self.df = np.loadtxt(str(self.comboBoxfile.currentText()), delimiter='\t', skiprows=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\fahl\AppData\Roaming\Python\Python312\site-packages\numpy\lib\npyio.py", line 1373, in loadtxt arr = read(fname, dtype=dtype, comment=comment, delimiter=delimiter, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\fahl\AppData\Roaming\Python\Python312\site-packages\numpy\lib\npyio.py", line 1016, in _read arr = _load_from_filelike( ^^^^^^^^^^^^^^^^^^^^ ValueError: could not convert string '8.924015324999998484e+03 2.540000000000000000e+02 1.776712260248795774e-03' to float64 at row 0, column 1. How can I solve that problem?? Thanks

Julian-Hochhaus commented 8 months ago

could you please add an example input file you wish to import? I assume, that your input format does not meet the expected format. However, because I do not use txt files to import my data, I have not made many improvements there and did not care yet for the great compatibility of different formatting. Might be a good topic to tackle.

andrefahl commented 8 months ago

I managed to solve the problem by exporting the data again, but it would be interesting for the notation to be recognized, the data is from APS and I imagine that notation that has all the precision must be common. I used origin and modified the notation, so I was able to import.

andrefahl commented 8 months ago

Really thank for your attention =D

andrefahl commented 8 months ago

hxanes_0027.txt

here an example of data that I was trying to import, I hope that helps to improve the software

Julian-Hochhaus commented 7 months ago

Fix of the problem will be pushed next week :)

andrefahl commented 7 months ago

I'm glad to help improve such an important software

Julian-Hochhaus commented 7 months ago

I redesigned the import menu, now allowing e.g. for selecting which columns to import. However, there probably will still be some bugs, therefore, for now, it is not on the main branch but only on the import_menue branch available. If you want to try it out, please check out this experimental branch.

I hope, the options are more or less intuitive, there will probably be some changes in the future and of course I will work on documenting more stuff asap. 💯

Julian-Hochhaus commented 2 months ago

The import_menue branch was now merged to master.

Import of file formats differing from the simple format:

energy intensity
data energy data intensity
... ...

is now fully supported on themaster branch and in the next release. If not the simple format is used during import and import of data therefore fails, a dialog opens where the user is able to choose the correct format.