taskGNU 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: 

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.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
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>
Project Administrator
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>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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 (Submitted the item)
  •  

    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 StatusPostponed Done
        Percent Complete0% 100%
        Assigned toNone makhlaghi
        Open/ClosedOpen Closed

    Back to the top


    Powered by Savane 3.9