LBEM-CH / focus

High Throughput Electron Microscopy Image Processing Software
http://www.focus-em.org
GNU General Public License v2.0
35 stars 14 forks source link

2d crystal image mode: floating-point exceptions #224

Closed albertlibra closed 6 years ago

albertlibra commented 6 years ago

Hi- Any ideas where these warnings come from?Everything else(IQ plot,FFT,lattice,CCmap,masked image) look OK, this warning only prevent the program to produce a map in the final step.

Get Lattice: Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG Unbend I and II: Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG Generate map: Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO FFTBIG: FFT failure, index limits

sthennin commented 6 years ago

Hi, Yes, those "divide by zero" error messages are annoying. They are there since ever. Most of them, I believe, are caused by very old functions (from 1970 or so) in kernel/mrc/lib, such as kernel/mrc/lib/miscsubs.for . These are Fortran 66 sometimes, lots of "GoTo"s and two-letter variables. That is very hard to decode. I recently upgraded my Mac to a newer compiler, which found several bugs in those programs. I wonder how those programs were able to run before, but they did.

The "FFTBIG: FFT failure, index limits", though, looks more serious to me. I have not seen that before. We employ FFTW in kernel/mrc/lib/fftlib.cpp , and I have seen different definitions of boundaries in FFT space with different FFTW implementations. Maybe, there is a bug there, or in the wrapper function kernel/mrc/lib/ifftsub.for ? That ifftsub.for prepares pointers for the C++ function fftlib.cpp, which is then calling FFTW with that. Somewhere along those paths must be several errors....

These programs are over 40 years old, and very difficult to maintain.

rdrighetto commented 6 years ago

These kind of errors can also arise from a wrong choice of parameters used to generate the map in the final step (e.g. max HK index, min. and max. resolution, max. IQ value, etc) or if the lattice is wrong.

If you open the FFT of this image with the Focus Viewer and display the lattice (pressing the "L" key), is it correct?

-- Ricardo Diogo Righetto

2018-05-31 11:32 GMT+02:00 sthennin notifications@github.com:

Hi, Yes, those "divide by zero" error messages are annoying. They are there since ever. Most of them, I believe, are caused by very old functions (from 1970 or so) in kernel/mrc/lib, such as kernel/mrc/lib/miscsubs.for . These are Fortran 66 sometimes, lots of "GoTo"s and two-letter variables. That is very hard to decode. I recently upgraded my Mac to a newer compiler, which found several bugs in those programs. I wonder how those programs were able to run before, but they did.

The "FFTBIG: FFT failure, index limits", though, looks more serious to me. I have not seen that before. We employ FFTW in kernel/mrc/lib/fftlib.cpp , and I have seen different definitions of boundaries in FFT space with different FFTW implementations. Maybe, there is a bug there, or in the wrapper function kernel/mrc/lib/ifftsub.for ? That ifftsub.for prepares pointers for the C++ function fftlib.cpp, which is then calling FFTW with that. Somewhere along those paths must be several errors....

These programs are over 40 years old, and very difficult to maintain.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/C-CINA/focus/issues/224#issuecomment-393473082, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVvfyZaki6MSKbK36T7-fcOxEhIBUlpks5t37ikgaJpZM4UUPNW .

albertlibra commented 6 years ago

Thanks for reply. That's a wrong choice of RESMAX, I changed from 3A to 4A and the map was able to be generated. The "DIVIDE_BY_ZERO" error still remains but "FFTBIG: FFT failure, index limits" disappear.