Author Topic: Odd Pixelmath behavior, result frame is too light, pixel values too high  (Read 4177 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Hello,

I finally got around to trying to use PI to tune my dark frames when they don't quite match my light frames. I won't distract you with how I intended to do that because I first wanted to do a simple dark subtraction. This is where I ran into trouble. I loaded two FITS files, one a light, the other a dark frame. Because of the recent changes to the FITS module I was able to load them just fine, thanks again Juan for that! I then saved the images with a different name so I wouldn't have to keep entering the 65535 max value on load. Great. I have uploaded the two images here:

http://www.tungstentech.com/files/math.zip (less than 2 MB)

Simply drop the two images into PI and open PIxelMath. Now subtract dark from light: Light_pi - Dark_pi and create a new image for the result.

The result can be seen in this screen shot:

http://gallery.tungstentech.com/main.php?g2_itemId=176

Example pixel 3,3:

Light: 0.3869
Dark: 0.2786
Result: 0.4872

Clearly that's not a subtraction, at least not in the way I was taught many many years ago :-)

Am I not understanding how pixelmath works? Certainly a possibility :-) How should I do this instead?

Thanks,

  Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Hi Sander

To perform a "pure" dark substraction, you must disable the "Rescale" checkbox. If this option is enabled, the image is scaled to fit the whole dynamic range avalaible. Of course, this is not what we want, specially if we want to apply a flat field later.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Thanks Carlos, that did it. I left things at default. I'm not sure why you'd want to rescale the result when you're doing math, that is not very intuitive default behavior IMO :-)

  Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity