gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62009] Mode becomes nan for large, pure noise images


From: Mohammad Akhlaghi
Subject: [bug #62009] Mode becomes nan for large, pure noise images
Date: Tue, 8 Feb 2022 05:26:38 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?62009>

                 Summary: Mode becomes nan for large, pure noise images
                 Project: GNU Astronomy Utilities
            Submitted by: makhlaghi
            Submitted on: Tue 08 Feb 2022 10:26:36 AM UTC
                Category: Statistics
                Severity: 3 - Normal
              Item Group: Output not reasonable
                  Status: Postponed
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

When a sufficiently large image with raw noise is given to Statistics to find
its mode of its pixel distribution, it fails (returning a NaN). This bug can
be reproduced with this command (running it multiple times will use a
different random number generator; and therefore a different noised value for
every pixel):


astarithmetic 2048 4096 2 makenew 10 mknoise-sigma --output=noise-large.fits

aststatistics noise-large.fits --mode


With Gnuastro 0.16.143-1427d (see [1] below), I tried the command above many
times, and in all cases, the output of Statistics was NaN!

However, when I made a smaller noised image with the commands below, it worked
perfectly:


astarithmetic 1000 2000 2 makenew 10 mknoise-sigma --output=noise-small.fits

aststatistics noise-small.fits --mode


Again, repeating this multiple times will mostly work: I did get a NaN for
this size when the random number generator was 'ranlxs1', with a seed of 
'1645053800' or '1644372467'. But generally it worked (for example with seeds
of '1644613667', '1645245226' or '1644502467'). For how to set seeds, see the
Generating random numbers
<https://www.gnu.org/software/gnuastro/manual/html_node/Generating-random-numbers.html>
section of the book.

We need to see what is happening with the mode-finding algorithm that it can't
find the mode in these ideal cases (where the mode is approximately in the
center, but with many points)! 

[1] While writing this report, I found and fixed bug #62008, so please
reproduce this bug with a more recent version of Gnuastro.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62009>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]