From: Ethan A M. <me...@uw...> - 2020-02-25 19:04:13
|
In response to a gnuplot feature request, I added a wrapper in gnuplot to find the width of the Voight profile by calling libcerf function voigt_hwhm(). However on further evaluation this has turned out to be problematic. The current libcerf source for this function deals badly with out-of-range input. It prints to stderr (problematic by itself) and then either - returns an incorrect value - calls exit(-1) A call to exit() from a library routine is almost never a good thing to do, since it prevents error-handling and possible recovery by the calling program. Limiting error reporting to a message on stderr also prevents detection and recovery by the calling program. I suggest that it would be preferable to return NaN whenever the input is out of range or the function does not converge. Alternatively libcerf could provide an error-check routine or status variable, but then you would run into issues of thread-safety and so on. I am hoping that the libcerf function can be improved in a subsequent version, but for now I will consider implementing equivalent code directly in gnuplot. Ethan |