Summary: | Sometimes Crash When Performing Curve Fitting | ||
---|---|---|---|
Product: | [Applications] LabPlot2 | Reporter: | Colin Griffith <tynach2> |
Component: | general | Assignee: | Stefan Gerlach <stefan.gerlach> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | stefan.gerlach |
Priority: | NOR | Keywords: | drkonqi |
Version: | 2.4.0 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
cone_fundamentals
Fitted Curves in Labplot2 |
Description
Colin Griffith
2018-02-21 20:01:28 UTC
(In reply to Colin Griffith from comment #0) > Application: labplot2 (2.4.0) > > Qt Version: 5.9.3 > Frameworks Version: 5.43.0 > Operating System: Linux 4.13.0-32-generic x86_64 > Distribution: KDE neon User Edition 5.12 > > -- Information about the crash: > I was repeatedly performing curve fitting with multi-peak Gaussian curves. > The algorithm for determining best fit doesn't work very well, so I have to > manually adjust values to be sorta close and then it seems to work. > > Sometimes, however, it just crashes when I finish editing the curve > parameters and apply them. I sadly cannot remember now if it crashed when I > hit 'Apply', or if it crashed when I clicked the button to recalculate the > curves. The call stack you attached indicates that you changed the "auto precision" options in the properties widget for an axis. This part was reworked a bit recently and should be safe already. > > There are a number of oddities to the version of Labplot2 in the Neon > repositories, though. It reports itself as version 2.4, but has a feature > that the website claims will be new in 2.5 (setting lower/upper limits on > curve fitting parameters). We changed the version a bit late during the development of 2.5. Looks like Neon picked out the code of 2.5 in development but with the version still set to 2.4. The current code in the repository has the version set to 2.5 - we're preparing the next release right now. Does Neon provides a more recent version of LabPlot or do you have any chance to compile it from sources? The fitting functionality was greatly extended for 2.5 and any kind of feedback and additional testing would be great here. Thanks! (In reply to Alexander Semke from comment #1) > (In reply to Colin Griffith from comment #0) > > Application: labplot2 (2.4.0) > > > > Qt Version: 5.9.3 > > Frameworks Version: 5.43.0 > > Operating System: Linux 4.13.0-32-generic x86_64 > > Distribution: KDE neon User Edition 5.12 > > > > -- Information about the crash: > > I was repeatedly performing curve fitting with multi-peak Gaussian curves. > > The algorithm for determining best fit doesn't work very well, so I have to > > manually adjust values to be sorta close and then it seems to work. > > > > Sometimes, however, it just crashes when I finish editing the curve > > parameters and apply them. I sadly cannot remember now if it crashed when I > > hit 'Apply', or if it crashed when I clicked the button to recalculate the > > curves. > The call stack you attached indicates that you changed the "auto precision" > options in the properties widget for an axis. This part was reworked a bit > recently and should be safe already. > > > > > There are a number of oddities to the version of Labplot2 in the Neon > > repositories, though. It reports itself as version 2.4, but has a feature > > that the website claims will be new in 2.5 (setting lower/upper limits on > > curve fitting parameters). > We changed the version a bit late during the development of 2.5. Looks like > Neon picked out the code of 2.5 in development but with the version still > set to 2.4. The current code in the repository has the version set to 2.5 - > we're preparing the next release right now. Does Neon provides a more recent > version of LabPlot or do you have any chance to compile it from sources? The > fitting functionality was greatly extended for 2.5 and any kind of feedback > and additional testing would be great here. Thanks! As far as I'm aware, I'm on the latest version of Labplot that KDE Neon has packages for. I paused while typing this just to double check, and indeed there are no new updates. I don't think I have all the packages necessary to compile Labplot, but I can probably try installing them and doing so. The 'INSTALL' file seems to include all the info I'll need for that :) It's getting rather late, so I'll probably do this tomorrow morning. Glad to know the odd package version isn't MY fault :) Hopefully this is why CAS worksheets are broken too... But that'd be a completely different bug report. (In reply to Colin Griffith from comment #2) > I don't think I have all the packages necessary to compile Labplot, but I > can probably try installing them and doing so. The 'INSTALL' file seems to > include all the info I'll need for that :) Yes, once the dependencies are installed it should be pretty straight-forward to compile LabPlot. Don't forget to do 'make install' in the build folder. If you have any problems or questions, please reach out to us. (In reply to Alexander Semke from comment #3) > (In reply to Colin Griffith from comment #2) > > I don't think I have all the packages necessary to compile Labplot, but I > > can probably try installing them and doing so. The 'INSTALL' file seems to > > include all the info I'll need for that :) > Yes, once the dependencies are installed it should be pretty > straight-forward to compile LabPlot. Don't forget to do 'make install' in > the build folder. If you have any problems or questions, please reach out to > us. I have it compiled, but it isn't being picked up by DrKonqi when it crashes. Repeating a crash is rather difficult, so I just have to mess around with it until it happens again. I have it installed into a directory in my home folder, with $PATH and $XDG_DATA_DIRS modified to reflect the location. Specifically, I have this in my .profile: PATH="/home/tynach/Software/compiled/bin:$PATH" XDG_DATA_DIRS="/home/tynach/Software/compiled/share:$XDG_DATA_DIRS" Without modifying $XDG_DATA_DIRS, the program would mostly run but crash more frequently (and complain about files missing on startup; honestly, the warning that popped up is what led me to knowing that I needed to to begin with, and I was very appreciative of that). I suppose now I should compile it using /usr as the installation prefix, and uninstall the version of Labplot from the repositories... Or do you have a different recommendation? In case it's relevant, I suppose I should mention that the data I'm messing with is 4401 data points, with X values ranging from 390 to 830, and Y values ranging from 0 to 2. Most plots have 3 data sets plotted, and one fitting curve for each (so 3 total fitting curves, and 6 curves total). Usually I have 2 such data sets, and so 2 plots, making 12 curves total. The exact data can be downloaded from these pages: http://www.cvrl.org/ciepr8dp.htm http://www.cvrl.org/ciexyzpr.htm To get the exact data files I'm using, choose these options on the form: 1st page: 2-degree cone fundamentals in Energy (linear) units with a stepsize of 0.1nm, in CSV format. 2nd page: 2-degree XYZ color matching functions with a stepsize of 0.1nm, in CSV format. (In reply to Colin Griffith from comment #4) > I suppose now I should compile it using /usr as the installation prefix, and > uninstall the version of Labplot from the repositories... Or do you have a > different recommendation? Yes, it's better to uninstall the version provided by the distribution first and install the version compiled from the sources. With this we shouldn't mess up anymore with the different locations of files used by the application. Also, to get a readable debug output please compile in the debug-mode. For this, simple use our compile_debug script: 1. ./compile_debug/ 2. cd build_debug 2. sudo make install Ater this LabPlot should run without problems and the message at startup complaining about the missing configuration file should be gone. (In reply to Colin Griffith from comment #5) > In case it's relevant, I suppose I should mention that the data I'm messing > with is 4401 data points, with X values ranging from 390 to 830, and Y > values ranging from 0 to 2. Most plots have 3 data sets plotted, and one > fitting curve for each (so 3 total fitting curves, and 6 curves total). > Usually I have 2 such data sets, and so 2 plots, making 12 curves total. > > The exact data can be downloaded from these pages: > http://www.cvrl.org/ciepr8dp.htm > http://www.cvrl.org/ciexyzpr.htm > > > To get the exact data files I'm using, choose these options on the form: > > 1st page: 2-degree cone fundamentals in Energy (linear) units with a > stepsize of 0.1nm, in CSV format. > > 2nd page: 2-degree XYZ color matching functions with a stepsize of 0.1nm, in > CSV format. I just tried out the data from the first page. I have no problems to plot and to fit to those three Gauss curves. I attached the screenshot of the results. The curves with the filled areas are the fitted results. To get this data quickly fitted in LabPlot: 1. import the csv file into a spreadsheet, use preview tab to check the results of the import settings 2. do a right click in the spreadsheet and select "Plot data" from the context menu and plot three curves in one single plot 3. do a right click on the curve (either in the plot or in the project explorer) and select Analysis/Fit/Gauss from the context menu 4. we fail to guess good starting values at the moment, so just provide a reasonable mean value for \mu and recalcute again. Created attachment 110959 [details]
cone_fundamentals
(In reply to Alexander Semke from comment #6) > 1. ./compile_debug/ > 2. cd build_debug > 2. sudo make install It should be ./compile_debug here, of course. (In reply to Alexander Semke from comment #7) > (In reply to Colin Griffith from comment #5) > > In case it's relevant, I suppose I should mention that the data I'm messing > > with is 4401 data points, with X values ranging from 390 to 830, and Y > > values ranging from 0 to 2. Most plots have 3 data sets plotted, and one > > fitting curve for each (so 3 total fitting curves, and 6 curves total). > > Usually I have 2 such data sets, and so 2 plots, making 12 curves total. > > > > The exact data can be downloaded from these pages: > > http://www.cvrl.org/ciepr8dp.htm > > http://www.cvrl.org/ciexyzpr.htm > > > > > > To get the exact data files I'm using, choose these options on the form: > > > > 1st page: 2-degree cone fundamentals in Energy (linear) units with a > > stepsize of 0.1nm, in CSV format. > > > > 2nd page: 2-degree XYZ color matching functions with a stepsize of 0.1nm, in > > CSV format. > > I just tried out the data from the first page. I have no problems to plot > and to fit to those three Gauss curves. I attached the screenshot of the > results. The curves with the filled areas are the fitted results. > > To get this data quickly fitted in LabPlot: > 1. import the csv file into a spreadsheet, use preview tab to check the > results of the import settings > 2. do a right click in the spreadsheet and select "Plot data" from the > context menu and plot three curves in one single plot > 3. do a right click on the curve (either in the plot or in the project > explorer) and select Analysis/Fit/Gauss from the context menu > 4. we fail to guess good starting values at the moment, so just provide a > reasonable mean value for \mu and recalcute again. This is consistent with my testing. However, I've been using curves with 3 - 8 peaks, attempting to visually match the fitted curve precisely to the actual data so that without zooming in they appear to be 100% identical. It is while repeatedly calculating the curves and tweaking the resulting values that the crash occurs, and continues to occur. I'll attach a screenshot of what I managed to get as far as results go yesterday, but have not been able to get the 'L' curve to fit any better (theoretically I should be able to get it to fit as well as the 'M' curve, but the algorithms refuse to behave rationally in some cases). All three curves are fit with 5 peaks. Either way, my troubles with fitting the curves are not the topic of this bug, but rather the fact that the program crashes after simply changing some values over and over. I don't believe that should happen. Also, I had already built Labplot with debugging symbols, but I'm now in the process of rebuilding it for installation in '/usr'. Created attachment 110982 [details]
Fitted Curves in Labplot2
Dashed lines are the fitted curves.
The crash still occurs, and is not picked up by DrKonqi despite being a debug build that was installed to the /usr directory (after purging both the copy installed from the repositories, and the version I had built and installed into my home directory). Is there another way to obtain a backtrace? (In reply to Colin Griffith from comment #12) > The crash still occurs, and is not picked up by DrKonqi despite being a > debug build that was installed to the /usr directory (after purging both the > copy installed from the repositories, and the version I had built and > installed into my home directory). > > Is there another way to obtain a backtrace? yes, by executing the application in the debugger: 1. compile labplot with debug symbols 2. gdb path_to_labplot2 3. execute 'run' in gdb 4. execute 'bt' once the application crashed Alternatively, if you have the steps leading to a crash reproducible on your side, simply describe them and we can try to understand the problem. The crashes were probably triggered by error handling of GSL. Please try if the latest code still crashes. |