Author Topic: Advice on combining two data sets for star spikes  (Read 3100 times)

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Advice on combining two data sets for star spikes
« on: 2018 May 01 10:49:24 »
I have two sets of data from two different camera/scope combinations on the same object.  One set of data is from an RC for the express purpose of capturing the star spikes the scope produces, and does not have much data and is noisy.  The other data set is from a refractor that does not produce star spikes, but has a lot of integration time and is not noisy.

What I would like to do is combine the RC data with spikes to the refractor data and basically just add the star spikes into the good refractor data. 

What I have tried is simply pixel math to add the master images together, and also ImageIntegration.  In both cases what happens is that the new image has good star spikes, but has far more noise due to the noisy RC data. 

How can I combine these two master images to get good star spikes but retain the good SNR and low noise of the refractor set?
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Advice on combining two data sets for star spikes
« Reply #1 on: 2018 May 01 14:06:25 »
You could try a weighted combination that favours the bright areas of the master with spikes and the dim areas of the master with good SNR.  I have written PixelMath expressions like this for combining HT and Mask stretched data.  You'd need to match the masters carefully, say with LinearFit and use a stretched copy of the spike image as the brightness measure.

If I get a chance I'll play around with this tonight (it's early morning here in Australia.)  I have an idea for how this could be useful for a different purpose and I have been meaning to try it...

Cheers,
Rick.

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: Advice on combining two data sets for star spikes
« Reply #2 on: 2018 May 01 14:09:26 »
You could try a weighted combination that favours the bright areas of the master with spikes and the dim areas of the master with good SNR.  I have written PixelMath expressions like this for combining HT and Mask stretched data.  You'd need to match the masters carefully, say with LinearFit and use a stretched copy of the spike image as the brightness measure.

If I get a chance I'll play around with this tonight (it's early morning here in Australia.)  I have an idea for how this could be useful for a different purpose and I have been meaning to try it...

Cheers,
Rick.

I bow to your pixelmath prowess!  I'm not sure how I'd do what you are suggesting so if you come up with a formula I'll be glad to use it.  Thanks.
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Advice on combining two data sets for star spikes
« Reply #3 on: 2018 May 02 01:58:01 »
Hi Joel,

Let's say you have two linear master images, Frac and RC.  Use LinearFit with one as the reference and apply to the other to make them roughly compatible.  Take a copy of one, let's say Frac and apply a STF stretch to it then stretch a bit more until the peak of the curve is around the midpoint of the histogram - call it Frac_stretch.  Now use the PixelMath expression: "Frac_stretch*RC+~Frac_stretch*Frac".  Hopefully this will do something like what you're hoping to achieve.  It should give you the bright parts of the RC image (spikes and areas bright enough to have good SNR) and the dim parts of the Frac image (best SNR in dim areas.)

As always, some tweaking may be needed and it may not work at all.  I don't offer a warranty on free advice  :D

Cheers,
Rick.
« Last Edit: 2018 May 02 14:02:33 by RickS »

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: Advice on combining two data sets for star spikes
« Reply #4 on: 2018 May 03 06:03:07 »
Thanks for the suggestion Rick.  It didn't quite work as written, but it worked reasonably well if I applied an STF stretch to both images.  The resulting image pulled in about 80% of the star spikes and resulted in a less noisy image.  With NoiseEvaluation the original image showed 46.52% and the new image showed 28.8% so that's an improvement.   At least I think it is...
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Advice on combining two data sets for star spikes
« Reply #5 on: 2018 May 03 13:51:02 »
Hi Joel,

Another thing to try is a noise-weighted integration of the two linear images with no rejection.  Add the images to the Files section twice so you don't get the less than three files error.  That will probably give you less of the spikes but optimal SNR.  You could also try adding the spiky images to the Files list more times than the non-spiky image to trade off some SNR for more spike.

A third option is to craft a mask for combining the images.  You might be able to do that with a stretched image, RangeSelection, some CloneStamp clean up afterwards and perhaps a little Convolution blur.

Cheers,
Rick.

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Advice on combining two data sets for star spikes
« Reply #6 on: 2018 May 03 15:00:10 »
Joel


You can use a structure mask to pickup the spikes if that is all you want to transfer. I'm going to post twice to show an example using a linear image and the same image processed.


Mike

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Advice on combining two data sets for star spikes
« Reply #7 on: 2018 May 03 15:01:07 »
Here is the processed, non linear image with the structure mask.


Mike

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Advice on combining two data sets for star spikes
« Reply #8 on: 2018 May 03 16:00:00 »
Hi Mike,

I've never really explored the use of Structure Maps.  Good idea!

Cheers,
Rick.

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Advice on combining two data sets for star spikes
« Reply #9 on: 2018 May 03 16:49:34 »
Thanks Rick. I saw a tutorial many years ago by Alejandro where he used it for something. I can't remember what now but ever since then it's been a go to for me for some interesting masking problems. It's quick and simple using the StarAlignment tool.


Mike

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: Advice on combining two data sets for star spikes
« Reply #10 on: 2018 May 03 17:38:38 »
Another thing to try is a noise-weighted integration of the two linear images with no rejection.  Add the images to the Files section twice so you don't get the less than three files error.  That will probably give you less of the spikes but optimal SNR.  You could also try adding the spiky images to the Files list more times than the non-spiky image to trade off some SNR for more spike.
This is what I've been doing so far, but I always felt I lost a lot of the low noise data. 

You can use a structure mask to pickup the spikes if that is all you want to transfer. I'm going to post twice to show an example using a linear image and the same image processed.

YES!  I think this might be what I was looking for.  What I'm doing is taking LUM with the RC and RGB with the refractor.  I also take a small amount of RGB with the RC just to get the star spikes.  A structure mask should work very nicely.  Thanks Mike!
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Advice on combining two data sets for star spikes
« Reply #11 on: 2018 May 03 20:58:00 »
Joel

Hope it works for you!


Mike

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: Advice on combining two data sets for star spikes
« Reply #12 on: 2018 May 04 05:51:31 »
Joel

Hope it works for you!


Mike

With the structure mask in place over the image without spikes, how would you then combine the images?
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Advice on combining two data sets for star spikes
« Reply #13 on: 2018 May 04 07:24:10 »
Joel

The simplest method is with PixelMath. Apply the mask to the image you want the spikes added to, we'll call that 'image_nospikes'. The image with the spikes, 'image_spikes' is added to the Pixelmath Expression and then Pixelmath is executed on 'image_nospikes'. The result is the spikes from image_spikes is added through the mask to image_nospikes.

I would suggest looking at the official pixelmath info here https://pixinsight.com/forum/index.php?topic=6332 and the many tutorials out there on pixelmath if you haven't used it much. It will change your processing.


Mike

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: Advice on combining two data sets for star spikes
« Reply #14 on: 2018 May 04 07:37:08 »
I tried PixelMath before posting the question.  Below is a screenshot of all three star profiles (left to right = RC with spikes, refractor with spikes added, and the structure mask).  As you can see the added star spikes aren't very pleasing or smooth.  The results were even worse with stretched images.  I think the problem is the structure map doesn't do a good job of picking up the full star spikes.  Also, I needed to make sure and do a linear fit before doing anything else.
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M