Can masked stretch be done in ST?

General discussion about StarTools.
opestovsky
Posts: 14
Joined: Fri Oct 22, 2021 6:19 pm

Re: Can masked stretch be done in ST?

Post by opestovsky »

admin wrote: Tue Oct 26, 2021 4:28 am
I don't believe that this is strictly true.
My camera, ASI533MC Pro for example, is sensitive to Ha signal in its green/blue pixels.
Image
So even if L-Extreme filter was used, the O3 signal in the green/blue pixels would still contain a chunk of Ha.
From the graph above,
the response of green/blue pixels to O3 at 500nm is 0.92/0.51
the response of green/blue pixels to Ha at 656nm is 0.16/0.05.
So, green/blue pixels will contain (0.16+0.05)/(0.16+0.05+0.92+0.51) = 12.8% of Ha signal.
And since Ha is usually much stronger than O3... well, hence the fake HOO.
That's not how that works though?

The response of the blue + green channels @ 500nm is (0.5 + 0.9 = 1.4), with Ha at that line being ~0.04.
This yields (0.04 / 1.4) * 100% = 2.9% Ha "contamination" in the aggregate O-III signal. That is virtually negligible.

The response in the blue + green channel @656 is (0.16+0.05 = 0.21), with Ha at that line being ~0.8.
This yields (0.21 / 0.8) * 100% = 26.25% O-III "contamination" in the red channel. That is much more significant.

Given that we know what the (almost) pure O-III looks like, we can subtract 26.25% times the O-III signal from the Ha signal at every pixel and arrive at the original Ha signal. That's what the Wipe + Color module combo does, as color is determined by relative differences after subtraction of a constant (by Wipe).

For luminance, the contamination too is not a problem (unless you are trying to isolate purely the Ha of course, like is the case with the moon example cited above, in which case a measure of the O-III needs to be subtracted for this particular camera). For luminance, you would add all signal you have collected together anyway to achieve the best SNR.
I am sorry, but you have that backwards.

"Ha "contamination" in the aggregate O-III signal" is
"The response in the blue + green channel @656"

not
"The response of the blue + green channels @ 500nm."

Also, I don't quite understand the point about " the Wipe + Color module combo." How do they know what camera I have to calculate the pure O3 signal from the nearly pure Ha (assuming that my response immediately above is correct?)

P.S. Sorry about calling the O-III spectral line O3. I know O3 is ozone, it's just easier to type.
Just to prove that I am not an actual dummy but an ozone expert, here's one of my most cited publications about ozone chemistry.
https://onlinelibrary.wiley.com/doi/abs ... .200502686
Mike in Rancho
Posts: 1141
Joined: Sun Jun 20, 2021 10:05 pm
Location: Alta Loma, CA

Re: Can masked stretch be done in ST?

Post by Mike in Rancho »

Well, I'll let Ivo do the heavy lifting here... :D

But I will say, even if I am not a NASA scientist doing science-y things (though I often look stuff up), I do expect my AP images to be considered photography - beautiful because of its nature, not because I photoshopped/deep-faked it. Some touch-up, particularly if processing artifact repair or if there's an actual legitimate logic to the manipulation, can certainly be expected of course. But, if I show the images to family and friends, they expect them to be photographs, albeit ones taking a lot of painstaking work, and that I have captured the glory of the universe. And not that I am a skilled graphic artist. And if asked I could certainly come up with a very brief explanation of cyan or magenta stars, etc.

Which are in fact real, depending upon the false color HOO or SHO image being made, and how it is balanced. By and large (I'm pretty sure) the star halos also get burned into the image at acquisition. They can be addressed somewhat, in various ways, but they are what they are and they have mostly blocked out what is behind them, so it's not like you can shrink a halo and recover the missing detail. I think?

The Bayer bleed is there but I'm not sure it is that great a problem. jdupton on CN has a pretty neat spreadsheet for download that has all those graphs as well as a number of filter options to apply to the sensor QE, including the L-eNhance. Though not the L-eX. Even on the worse side of contamination, for that sensor, being the Ha, if you were to plug those percentages into an RGB pixel, it would still be very very red. So when doing your HOO balancing you have to pull back the Ha by a good amount before an Ha pixel would start becoming purple and then go blue, I guess, due to contamination.

Though since HOO is a teeter-totter of sorts anyway, I'm not quite sure how that works. (I'll find some mono filter data and test it out though :D )

This does lead me to a couple questions of my own, however. :think:

First, I presume the 2xG in bicolor compositing is utilized only for the synth L, not the color strength? jdupton's sensor QE and photon % stats already factor in 2xG I believe, so if using those numbers you'd probably have to halve the G% when it comes to chrominance and just how contaminated it would be.

Second, do the numbers in the Color bias sliders, whether reduce or increase, mean anything?

Thanks.
User avatar
admin
Site Admin
Posts: 3367
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Can masked stretch be done in ST?

Post by admin »

opestovsky wrote: Tue Oct 26, 2021 5:39 am I am sorry, but you have that backwards.

"Ha "contamination" in the aggregate O-III signal" is
"The response in the blue + green channel @656"

not
"The response of the blue + green channels @ 500nm."
I don't follow...

The response of the blue + green channels @ 500nm (this is the O-III line) is (0.5 + 0.9 = 1.4), with Ha at that line being ~0.04. <--- that's the Ha contaminating the O-III signal (e.g. O-III "signal" that shouldn't be there at the 500nm line).
This yields (0.04 / 1.4) * 100% = 2.9% Ha "contamination" in the aggregate O-III signal. That is virtually negligible.

The response in the blue + green channel @656 is (0.16+0.05 = 0.21) <--- that's the O-III contaminating the Ha signal (e.g. "Ha" signal contamination, with proper Ha at that line being ~0.8.
This yields (0.21 / 0.8) * 100% = 26.25% O-III "contamination" in the red channel. That is much more significant.
Also, I don't quite understand the point about " the Wipe + Color module combo." How do they know what camera I have to calculate the pure O3 signal from the nearly pure Ha (assuming that my response immediately above is correct?)
For the purpose of coloring, it is not strictly necessary for the modules to know the spectral response and still get usable results.

In a HOO composite, given an example 25% bleed of G+B into Ha, you get this transformation;

R = R + 0.25*((G+B)/2)
G = (G+B)/2
B = (G+B)/2

One of Wipe's jobs is to subtract any constants, such as aforementioned moon glow. If a constant is present in the G+B signal, Wipe will also subtract the correct 25% constant from the R signal.

Then, in the Color module (which operates in the chrominance domain only), color recovery is based on channel ratio retention (post-Wipe). With the constants out of the way, it is now a simple matter of changing the linear multiplier for the channel ratios to "color balance" the coloring (e.g. picking the desired balance between Ha/red poking through and O-III/cyan poking through). All that the O-III bleed into the Ha in terms of coloring does, is pull the O-III coloring towards "white" (e.g. causing desaturation), but - and this is crucial! - does not causing any changes in hue. If even needed, this effect can be partially countered by increasing the saturation (of course this also boosts Ha saturation a little).

The desaturating effect can be easily observed;

Say there is no O-III at all in an area, and we have max 8-bit Ha;

R = 255 + 0
G = 0
B = 0

This gives a pure red; no contamination is taking place.

Now say there is no Ha at all in an area, and we have max 8-bit O-III;

R = 0 + 63.75
G = 255
B = 255

This gives not a pure cyan (0, 255, 255), but a light cyan (63.75, 255, 255); it has been pulled up closer to white (255, 255, 255).

Does that help?
Ivo Jager
StarTools creator and astronomy enthusiast
opestovsky
Posts: 14
Joined: Fri Oct 22, 2021 6:19 pm

Re: Can masked stretch be done in ST?

Post by opestovsky »

admin wrote: Tue Oct 26, 2021 6:40 am
opestovsky wrote: Tue Oct 26, 2021 5:39 am I am sorry, but you have that backwards.

"Ha "contamination" in the aggregate O-III signal" is
"The response in the blue + green channel @656"

not
"The response of the blue + green channels @ 500nm."
I don't follow...

The response of the blue + green channels @ 500nm (this is the O-III line) is (0.5 + 0.9 = 1.4), with Ha at that line being ~0.04. <--- that's the Ha contaminating the O-III signal (e.g. O-III "signal" that shouldn't be there at the 500nm line).
This yields (0.04 / 1.4) * 100% = 2.9% Ha "contamination" in the aggregate O-III signal. That is virtually negligible.

The response in the blue + green channel @656 is (0.16+0.05 = 0.21) <--- that's the O-III contaminating the Ha signal (e.g. "Ha" signal contamination, with proper Ha at that line being ~0.8.
This yields (0.21 / 0.8) * 100% = 26.25% O-III "contamination" in the red channel. That is much more significant.
Thank you for a detailed reply. I will have to read the second part carefully.

As for the first part, with all due respect, I don't think you got that one correctly (I will use your own numbers for reading of the graph, as they are slightly different from my own reading):

The Ha contamination of the O3 signal in the green/blue pixels is the green/blue response at 656 nm, where the Ha spectral line appears.
Suppose that the intensities of the O3 and Ha spectral lines are I1 and I2, respectively.
The green/blue pixels will read (0.9+0.5)xI1 from the O3 line @ 500 nm,
and (0.16+0.05)xI2 from the Ha line @ 656 nm.
The overall proportion of the Ha line @ 656 nm in the green/blue pixels will therefore be
(0.16+0.05)xI2 / ((0.16+0.05)xI2 + (0.9+0.5)xI1).

The Pacman nebula has roughly I1=I2/2, on average.
Therefore the Ha contamination of the O3 signal in the green/blue pixels is
(0.16+0.05)xI2 / ((0.16+0.05)xI2 + (0.9+0.5)xI2/2) = 0.23, or 23%.

Conversely,
the O3 contamination of the Ha signal in the red pixels is the red response at 500 nm, where the O3 spectral line appears.
Suppose that the intensities of the O3 and Ha spectral lines are I1 and I2, respectively.
The red pixels will read 0.8xI2 from the Ha line @ 656 nm,
and 0.04xI1 from the O3 line @ 500 nm.
The overall proportion of the O3 line @ 500 nm in the red pixels will therefore be
0.04xI1 / (0.04xI1 + 0.8xI2)

The Pacman nebula has roughly I1=I2/2, on average.
Therefore the O3 contamination of the Ha signal in the red pixels is
0.04xI2/2 / (0.04xI2/2 + 0.8xI2) = 0.024, or 2.4%.

So, the Ha signal is nearly pure, but the O3 signal is significantly contaminated.
opestovsky
Posts: 14
Joined: Fri Oct 22, 2021 6:19 pm

Re: Can masked stretch be done in ST?

Post by opestovsky »

Mike in Rancho wrote: Tue Oct 26, 2021 6:25 am Well, I'll let Ivo do the heavy lifting here... :D

But I will say, even if I am not a NASA scientist doing science-y things (though I often look stuff up), I do expect my AP images to be considered photography - beautiful because of its nature, not because I photoshopped/deep-faked it. Some touch-up, particularly if processing artifact repair or if there's an actual legitimate logic to the manipulation, can certainly be expected of course. But, if I show the images to family and friends, they expect them to be photographs, albeit ones taking a lot of painstaking work, and that I have captured the glory of the universe. And not that I am a skilled graphic artist. And if asked I could certainly come up with a very brief explanation of cyan or magenta stars, etc.
Hey, Mike.
I just want a simple thing really, at least on paper.

Make my image:
https://www.cloudynights.com/topic/7920 ... ry11405886

look like their images:
https://www.cloudynights.com/topic/7920 ... ry11402921
https://www.cloudynights.com/topic/7920 ... ry11404386
https://www.cloudynights.com/topic/7920 ... ry11404436

without breaking the bank:
https://astronomy-imaging-camera.com/pr ... i294mm-pro
Kit#2 - ASI294MM Pro +EFW8*1.25(31mm)+31mm LRGB+31mm Ha SII OIII+OAG, $2,199.00

And this guy did it:
https://www.cloudynights.com/topic/7920 ... ry11441699

BTW,
The Secret is Reveled!!! :occasion-happyhalloween:
This is a quote from the author of the last image:
Ah yes, sorry... I didn't say that I used the Starnet module in Pixinsight to remove the stars.
So after colour calibration and a light stretch, I run starnet, which gives me a starless image, and it also creates a "star mask" (which is an image with just the stars in it).
So sections 3 - 5 (maybe some of 6 too) were done with starless images. Then add the stars back near the end of processing using PixelMath.
User avatar
admin
Site Admin
Posts: 3367
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Can masked stretch be done in ST?

Post by admin »

opestovsky wrote: Tue Oct 26, 2021 7:39 am As for the first part, with all due respect, I don't think you got that one correctly
Urgh. You're right of course. Apologies! Long day/night...

The subtraction is of course not O-III from Ha, but the other way around. The Ha gets recorded incorrectly, but it's the O-III (residing in the green+blue channels) that suffers from the Ha cross-talk.

I even already wrote about the increased/aberrant green channel response, with regards to color balancing OSC datasets in the Color module docs! :doh:

Sigh. I need a break.
Ivo Jager
StarTools creator and astronomy enthusiast
Mike in Rancho
Posts: 1141
Joined: Sun Jun 20, 2021 10:05 pm
Location: Alta Loma, CA

Re: Can masked stretch be done in ST?

Post by Mike in Rancho »

Alrighty, you guys went over my head. :lol:

But I'll keep reading and try to figure things out. Not quite on board with Wipe handling some of the Bayer bleed... ? The way I was seeing it, the contamination will come in as if it was structure, not skyglow or gradient. So a pure Ha object, falling through the 656-ish line of the Optolong, will end up making electrons in the red CFA pixels, but will also have a faint shadow of said object in the correponding blue and green pixels. Then with demosaicking and interpolation, the contamination gets baked into the pixel's RGB levels. Almost as if was in truth an object of mostly Ha but some OIII.

Of course, for an actual object of some Ha and some OIII, we would have to criss-cross the contaminations on both spectral passes of the duoband in order to see what we would end up with. :?

Anyway, OP -- should we just call you Doc O now? -- what about the appearance of the 3 sample images were you shooting for? That said I would consider it a hard haul. Two of the samples were high resolution mono cams doing true SHO. I didn't look at their optics to check the focal length and pixel scale. And who knows how it was manipulated. Same for the middle image, though interestingly that was taken with an OSC (albeit 20MP) but true NB Ha and OIII, rather than a duoband. That would allow for ignoring contamination. Also, no pesky Hb line of an L-eNhance.

But of the three, I would think you could well come close to the look of the middle image, even as-is and with the limitations of the 533. I do not see that star removal is the key to a good image here. He has desaturated and/or just ran them to white (various ways of doing that in ST, were one so inclined), shrunk/eliminated the bulk of the star field (ditto), and overall the image is either very lightly stretched, or a pretty heavy gamma reduction was applied at the end. ST can do those too. I think the Pacman has about 1/2 a head left in that version.
Stefan B
Posts: 422
Joined: Sat Oct 31, 2020 8:59 pm

Re: Can masked stretch be done in ST?

Post by Stefan B »

opestovsky wrote: Tue Oct 26, 2021 3:12 am My solution is unfortunately extremely slow and laborious.
I would like to know if there are easier ways to get rid of the cyan colors and/or halos than painstakingly mask every pixel by hand.
Maybe a bit late and Ivo won't like this option ;) , but you can use FilmDev instead of Autodev. This will bloat the stars and make them white. Autodev is better at dynamic range stuff but you can get back part of it by applying the HDR module.

Regards
Stefan
Mike in Rancho
Posts: 1141
Joined: Sun Jun 20, 2021 10:05 pm
Location: Alta Loma, CA

Re: Can masked stretch be done in ST?

Post by Mike in Rancho »

Stefan B wrote: Wed Oct 27, 2021 9:44 am
Maybe a bit late and Ivo won't like this option ;) , but you can use FilmDev instead of Autodev. This will bloat the stars and make them white. Autodev is better at dynamic range stuff but you can get back part of it by applying the HDR module.

Regards
Stefan
I think there might be better ways to reduce or eliminate any offensively cyan stars, while still retaining proper AutoDev...

Fringe killer in Filter, highlight repair in Color, Taming and other options in Shrink, desaturation in Color, or just don't color them at all (use mask fuzz as needed in all of these), and if stars get too dull or too gray, using the same star mask, one can also go into layer and do an "add" blend - very low percentage is all that's needed or else you will blow them out, but this will bring things more towards white.
Stefan B
Posts: 422
Joined: Sat Oct 31, 2020 8:59 pm

Re: Can masked stretch be done in ST?

Post by Stefan B »

Mike in Rancho wrote: Wed Oct 27, 2021 4:53 pm I think there might be better ways to reduce or eliminate any offensively cyan stars, while still retaining proper AutoDev...

Fringe killer in Filter, highlight repair in Color, Taming and other options ...
Yeah, but it's much more fiddling ;) Especially creating good and tight star masks if automask isn't doing a decent job. I hate doing this manually...

Regards
Stefan
Post Reply