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

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Mon 05 Sep 2016 02:30:05 PM UTC  
 
Should Start On: Sun 04 Sep 2016 03:00:00 PM UTCShould be Finished on: Sun 04 Sep 2016 03:00:00 PM UTC
Category: ArithmeticPriority: 5 - Normal
Item Group: EnhancementStatus: Done
Privacy: PublicPercent Complete: 100%
Assigned to: Mohammad Akhlaghi <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 AdministratorIn charge of this item.
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 AdministratorIn charge of this item.
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 AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by makhlaghi (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Sep 2016 12:05:43 PM UTCmakhlaghiStatusPostponed=>Done
      Percent Complete0%=>100%
      Assigned toNone=>makhlaghi
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1