bugGNU Astronomy Utilities - Bugs: bug #60923, Standard deviation returning NaN


You are not allowed to post comments on this tracker with your current authentication level.

bug #60923: Standard deviation returning NaN

Submitted by:  Natáli Anzanello <ndanzanello>
Submitted on:  Fri 16 Jul 2021 01:44:53 AM UTC  
Category:  Libraries Severity:  3 - Normal
Item Group:  Output not reasonable Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 16 Jul 2021 01:06:25 PM UTC, comment #1: 

Thanks a lot Natáli, it has been merged in Commit 35c14b7db28. Just some points:

1. In the 'gal_statistics_mean_std' function, the value should have been written into 'o[1]' (the mean is written in 'o[0]'). I fixed this in your commit.

2. When describing the problem in comments give a specific description of what caused problem. When you simply say "floating point errors", it is very vague. But if you say the points are all equal except for floating point errors, it becomes much more clear.

3. In comments or the commit message, when you are using code snippets within English writing, put them within a single quote, for example in point one above.

I have fixed all of these in the merged commit, but its good to have them in mind for the future ;-).

Thanks again for finding and fixing this problem.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Fri 16 Jul 2021 01:44:53 AM UTC, original submission:  

The standard deviation calculation (within gal_statistics_std and gal_statistics_mean_std) is returning a NaN value in some situations.

This is due to calculations involving floating numbers giving the square of the average value greater than the average of the squares of the values, thus making a square root of a negative number.

Natáli Anzanello <ndanzanello>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by ndanzanello (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-07-16 makhlaghi StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.7