Author Topic: Dealing with NaNs in fits files  (Read 2320 times)

Offline dancolesworthy

  • Newcomer
  • Posts: 12
Dealing with NaNs in fits files
« on: 2016 January 27 14:23:34 »
I recently downloaded some Hubble data sets for the interacting galaxy pair known as Arp 274.  Each data set has been projected onto an oversized canvas, and the non-data areas were filled with NaN values including the gap between the two sensors of the WFC3 camera.  By default, it looks as if PI's fits file explorer assigns the value 0.0 to all NaN pixels.  However, the actual data ranges in value from -0.26 ... 137.6 which is mapped to the range 0 ... 1.  This results in an offset value of 0.0019 for all the pixels that previously held the value NaN. 

What I would like to do is to register and then combine the 2 different data sets so that the gap between sensors is filled with values from the second data set.  Perhaps something as simple as max(A,,B) in PixelMath.  However, the fact that all the invalid data areas of the canvas have non-zero values makes this difficult.  I have tried different settings in the fits file explorer to try and overcome this, but so far no success.

Any and all suggestions welcome.  Thanks in advance.
Dan Colesworthy

Offline JoelShepherd

  • Newcomer
  • Posts: 5
Re: Dealing with NaNs in fits files
« Reply #1 on: 2017 February 28 18:23:31 »
Hi - Did you work out a solution for this? I've started working on some WFC3 data (for NGC 3368) and have been looking for a better solution than clone-stamping to address the seam between the sensors. It is so regular that it seems like some PixelMath magic could address it ... but haven't quite worked out what that is.

Thanks for any insights -- Joel.