GNU Astronomy Utilities - Tasks: task #14146, Select pixels that are blank
You are not allowed to post comments on this tracker with your current authentication level.
task #14146: Select pixels that are blank
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Mon 05 Sep 2016 02:30:05 PM UTC | ||
Should Start On: | Sun 04 Sep 2016 03:00:00 PM UTC | Should be Finished on: | Sun 04 Sep 2016 03:00:00 PM UTC |
Category: | Arithmetic | Priority: | 5 - Normal |
Item Group: | Enhancement | Status: | Done |
Privacy: | Public | Percent Complete: | 100% |
Assigned to: | makhlaghi | Open/Closed: | Closed |
Effort: | 0.00 |
Tue 06 Sep 2016 12:05:43 PM UTC, comment #2: |
Mohammad Akhlaghi <makhlaghi>![]() ![]() |
Mon 05 Sep 2016 03:41:45 PM UTC, comment #1: A cartouche has been added to the book explaining the comparison with NaN values in Arithmetic's operator section of the book. |
Mohammad Akhlaghi <makhlaghi>![]() ![]() |
Mon 05 Sep 2016 02:30:05 PM UTC, original submission:
With the new equal operator in Arithmetic, we can choose certain pixels in the image, except blank pixels (NaN in float types and fixed constants for other types).
The problem with blank values is that in floating points, the IEEE NaN standard defines this value as failing any conditional operator, so NaN is not equal to its self and the only reliable way we can check for it is the `isnan' function. For integer types the blank value is a constant (defined by the type in Gnuastro's `lib/gnuastro/fits.h'. But we don't want the users to have to check that value manually.
One solution to these problems might be this: we add a unique type of operand (not a file name or number) called `blank' (the name can be changed). Then when the equal operator confronts this operand (either as the first popped operand or the second), it will use `isnan', not the equal operator. Internally (for the time being, see task #13869), in Arithmetic, everything is in double type, so the single `isnan' is enough. Later it can be expanded to accommodate all types. |
Mohammad Akhlaghi <makhlaghi>![]() ![]() |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2016-09-06 | makhlaghi | Status | Postponed | ![]() |
Done |
Percent Complete | 0% | ![]() |
100% | ||
Assigned to | None | ![]() |
makhlaghi | ||
Open/Closed | Open | ![]() |
Closed |
This task has been completed and is pushed to the main repo.
The `blank' operand that was suggested in the first comment was not the solution. Because it would violate the definition of a NaN: a NaN value must not be equal to anything, even itself.
Instead to complete this task, a much more cleaner and correct way was chosen: to define a `isblank' operator (based on C's `isnan' function). This operator's only job is to return the output of the `isnan' function on each pixel or number that it pops out.