Open till-schertenleib opened 6 days ago
diffpy.utils is a useful package to handle different dataformats. It has a loadData() function which might be useful.
can you send me an example file so I can look into it?
is the metadata in your file marked with a '#'?
It looks like that:
[Diffraction_object] name = Absorption corrected input_data: SU101_40-1_BiMOF_500umSpezGlass_accum_0 wavelength = 0.71 scat_quantity = x-ray mud = 2.1792017503005123 anode_type = Mo wavelength = 0.71 output_directory = C:\Users\tills\PDF\bea\bimof\data\lab\su101_500umSpezGlass_corrected.xy xtype = tth method = polynomial_interpolation username = till email = till.schertenleib@gmail.com z_scan_file = C:\Users\tills\PDF\bea\bimof\data\lab\SU101_40-1_BiMOF_500um_spec_glass_exported.xy package_info = {'diffpy.labpdfproc': '0.2.0', 'diffpy.utils': '3.5.0'} input_directory = C:\Users\tills\PDF\bea\bimof\data\lab\SU101_40-1_BiMOF_500umSpezGlass_accum_0.xy creation_time = 2024-11-08 09:50:33.820075
2.000099897384640002e+00 5.779828003216881598e+02 2.020537221804259875e+00 5.662578146175662823e+02 2.040974546223880193e+00 5.571583334011457964e+02
The start data has #### in front of it
if I mark all meta infromation with # it will work?
I've just used np.loadtxt(filename, unpack=True, comments='#'). So if every line of metadata starts with '#', including the axis names, it should work.
Oh okay I haven't realized that. Perfect then I'll just do that. thanks!
Do you have a lot of files? Will it be annoying to modify all of them?
It's not to annoying. It's for files that we get from lab instruments. Sometimes also from other beamlines. I could probably write a script that deals with that if I have a lot of files at some point.
However, if there is a simple way to modify your GUI, that would be super convenient. I will send you two example files via email.
I think the gui can only load xrd files that have no header lines. Many files exported from lab instruments or from anywhere else contain some metadata in the header, which is often quite useful to keep.
Thanks for this very useful tool!
Till