Closed ptim0626 closed 4 months ago
Just to let you know that I'm looking into it.
Effectively it is impossible to save in the same csv
or dat
file something that does not have the same dimensions as the map and only the HDF5 format offers the full capabilities to store everything in a single file.
The simplest solution would be to skip saving that information into those formats.
I am not a seasoned user of PyMca so if the above setup doesn't make sense, please give me some advice on how I should configure the fast fit. Thank you.
I recommend you to get used to the program using the graphical user interface prior to write your scripts.
To configure the fast fit, the simplest approach is to use PyMca itself to generate the fit configuration file and then load it into your scripts.
The code below illustrates how to read the fit configuration file
from PyMca5.PyMcaPhysics.xrf import FastXRFLinearFit
from PyMca5.PyMcaIO import ConfigDict
configuration = ConfigDict.ConfigDict()
configuration.read("your_fit_configuration_file.cfg")
fastFit = FastXRFLinearFit.FastXRFLinearFit()
fastFit.setFitConfiguration(configuration)
Thanks @vasole for the fix and suggestion! I inherited the scripts from others, and I will definitely explore the GUI myself to understand the various options.
When
OutputBuffer
is initialised, ifsaveFit
and/orsaveResiduals
is set toTrue
whencsv
and/ordat
is also enabled, it produces the following error when usingFastXRFLinearFit.fitMultipleSpectra
:I am using
5.9.0
, and when I switch to5.5.5
there is no error (with Python 3.10). I guess the changes in #710 introduced the issue, after commenting out the block it works in5.9.0
. Thesave2DArrayListAsASCII
method tries to save the derivative as an image, but it is a 1-dimensional array withnan
value.The following example (adapted from the tests) should illustrate the issue:
I am not a seasoned user of PyMca so if the above setup doesn't make sense, please give me some advice on how I should configure the fast fit. Thank you.