Author Topic: HaRGBCombination Script  (Read 99159 times)

Offline Silvercup

  • PixInsight Addict
  • ***
  • Posts: 187
Re: HaRGBCombination Script
« Reply #30 on: 2012 April 25 12:35:26 »
Hi all:

Feel free to modify the script.

I'm currently out of business for personal problems, sorry.

Silvercup.

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: HaRGBCombination Script
« Reply #31 on: 2012 April 26 12:57:57 »
Hi Silvercup

I hope things get better for you soon , we miss you here is pixy land

Harry
Harry Page

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #32 on: 2012 April 27 04:29:40 »
Sorry to hear Silvercup, I hope for the best

Pending a few answers on the library from the script Gurus, here it is as I have modified it so far. Give it a try.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: HaRGBCombination Script
« Reply #33 on: 2012 April 27 13:37:55 »
Silvercup - thanks so much for creating this script and hope things get better soon for you!

Ioannis - likewise, thankyou for picking up this script and continuing on the very useful work of Silvercup!

I've been playing with the script on a few different images and have some feedback if you don't mind?

* The window is large and doesn't fit comfortably on my 1440x900 display.  It seems that a lot of the script's window is taken up by the preview at the top.  But the preview seems redundant since there's a separate preview window in the main PI workspace that exactly mimics what you're seeing in the script's preview window.

* I really like the new "toggle Ha image" button.  This, with the "show RGB" and "show HaRGB" buttons allows blinking the 3 images to see before/afters etc.  Great idea.

* One comment, though, is that it's not immediately clear that "show HaRGB" is actually the button that does all the work.  For me, usually it's clicking "OK" that sets the script off doing the work, and "show HaRGB" could be misinterpretted as just showing a preview.  Perhaps there should be a  "generate HaRGB" button just above those, the have 3 toggle RGB/Ha/HaRGB buttons?

* I'm not sure of the workings behind the colour calibration part, but I just had the script hang when using it.  I had specified a background preview from my Ha image and white balance preview from the RGB image.  If I copied the bg preview from the Ha image to the RGB image and called it up from there, the script did finish and work fine.  Probably my fault, just letting you know.

* When choosing the views/images to use for Ha source, RGB source, and the colour calibration previews, the list is also filled with automatically generated views from the script itself.  I can't envisage that they'd ever actually be used for those selections, and they clutter up the drop down box adding confusion to the selection.  Perhaps views that the script itself generates could be removed/hidden from the drop down?

If you've read this far, thanks so much :)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #34 on: 2012 April 27 15:47:34 »
* The window is large and doesn't fit comfortably on my 1440x900 display.  It seems that a lot of the script's window is taken up by the preview at the top.  But the preview seems redundant since there's a separate preview window in the main PI workspace that exactly mimics what you're seeing in the script's preview window.

Well, it is not exactly redundant. You see it is not just a preview, it is the CONTROL of the real Preview window (and as the matter of fact I made it to be the control of the HaEmission window also, without copying a preview of Ha though). The problem arises from the fact the with PJSR scripting you have limited access to the functions of the PCL library. As Juan has explained in the past you do not have access to the real Preview windows as used from the normal PI's processes.
From what I know so far (*),  the Dialog used as the main control for the script has the exclusive control of the screen (it is "modal", meaning that you do not have access to the other windows until you close it). So, how you zoom in/out or navigate in the Preview (or HaEmission) window ? You have a small window at the top and you scroll or move the mouse into it - and this allows you to control the other window(s). Try it.

The size of the Dialog IS indeed a problem, and arises from the fact that the tool just packs some controls together (preview, buttons, slide bars etc) without actually arranging them in the available screen space. The programmer does not have a clue what the real size will be in each screen. (Juan, Sizer is a great idea but it needs to take the available screen in consideration and/or produce automatically scroll bars, or arrange the controls more intuitively, like TCL/TK's equivalent tool.) 

What I was thinking as solution was to re-arrange the different controls (eg put all the preview buttons together, consolidate some of the others in one line etc) so to give more vertical space.

Moreover to see if I can avoid having the main Dialog as exclusive window : in this case you do not need the Control Preview screen on the top, you will have access to the real Preview/HaEmission window to scroll etc

Quote
* One comment, though, is that it's not immediately clear that "show HaRGB" is actually the button that does all the work.  For me, usually it's clicking "OK" that sets the script off doing the work, and "show HaRGB" could be misinterpretted as just showing a preview.  Perhaps there should be a  "generate HaRGB" button just above those, the have 3 toggle RGB/Ha/HaRGB buttons?


Yes, it is not clear. Actually ShowRGB just copies RGB to the Preview window, Show HaRGB does all the work and copies HaRGB to the Preview window and OK finalize the result and closes the temporary windows. I would had preferred if the sliders actually perform the job on the fly, but the calculations seem to take time, so I think Silvercup made it like this because of this limitation. Let me think how the procedure can be improved though (and of course any ideas are welcomed)


Quote
* I'm not sure of the workings behind the colour calibration part, but I just had the script hang when using it.  I had specified a background preview from my Ha image and white balance preview from the RGB image.  If I copied the bg preview from the Ha image to the RGB image and called it up from there, the script did finish and work fine.  Probably my fault, just letting you know.

Well, I have to check the code and make it more fault tolerant. As far as I understood the logic behind, it is assumed that the BG / White balance previews should be on the original RGB image.

Quote
* When choosing the views/images to use for Ha source, RGB source, and the colour calibration previews, the list is also filled with automatically generated views from the script itself.  I can't envisage that they'd ever actually be used for those selections, and they clutter up the drop down box adding confusion to the selection.  Perhaps views that the script itself generates could be removed/hidden from the drop down?

Yes, I know, it is one of my suggestions also, a few months before. I do not have a quick way to fix this (*) without re-eventing the wheel, but for sure pending improvement.

Also you have to consider that if you close the Dialog abnormally (eg from the X at the right corner or from a crash) you will have all the temporary Views used from it hanging around.


(*) The problem is that I know quit a lot of programming and I have extensive experience of creating new or understanding and changing other people's code, but I do not know the PCL/PJSR scripting library well enough. That's why I said "pending answers from the Gurus" , I need some answers from people understanding PCL/PJSR better, check this topic
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: HaRGBCombination Script
« Reply #35 on: 2012 April 28 02:49:09 »
Hi

I got it to run once , with very strange overley wide GUI and now I can not get it to run at all

Harry
Harry Page

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #36 on: 2012 April 28 12:17:14 »
Harry, the script (at this stage at least) assumes that you already have a current view open (actually the RGB view). This error appears if you run it without any view
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: HaRGBCombination Script
« Reply #37 on: 2012 April 28 21:22:37 »
Ioannis, not sure if you're up for more ideas at this stage?  I'm wondering if this script is extensible to other narrowband filters other than just Ha.  Perhaps a feature could be to pick a filter image, similar to how Ha is picked with the current script, but you can assign that to a channel or channel mix instead of having it hard-coded to R.  And you could add NB images so it's up to you for OIII, SII, NII etc.  Would that be possible?  I'm sure the logic behind "Vicent's Method" is applicable to all NB/RGB blends?

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #38 on: 2012 April 28 22:34:17 »
Actually I was playing with this idea myshelf. I have tried to apply the method to G and B with OIII using pixelmath last summer. It seems to be something there, but my fits were not good enough to decide. Mind that with Ha and R you have a solid fact to start with : R contains all of Ha. This applies to R and SII, but the other combinations are more tricky - I just do not know the maths behind, if they exist.

From my point of view any idea worths testing, but at this stage I'll defently focus on making Silvercup's work more robust. After this we can expand it.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: HaRGBCombination Script
« Reply #39 on: 2012 April 29 05:52:42 »
Wouldn't the math be same?  What I'm talking about is the user chooses the mix or percentage of what filter they want in what channel.  So it's just a multiplier (of a value 1 or less say) of the filter times whatever channel they choose.

eg for an RGB image with Ha and OIII only, you might choose 1xHa in the R channel, and say 0.8xOIII in G, and 0.2xOIII in B (or whatever the mix is that splits OIII into G and B).
Or for a Hubble Palette image, 1xSII into R, 1xHa into G, and 1xOIII into B.  You get the Hubble Palette nebulosity and RGB stars.  Unless I'm missing something?

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #40 on: 2012 April 29 06:32:45 »
Wouldn't the math be same? 

Not sure about this. As far as I know, the method uses PixelMath to separate  Continuum from Emission data and then combine Emission with R (or at least this is my understanding so far). But eg OIII is part of both G and B. It is not just combining with percentages specific filter to specific channel. Maybe it can be done if the required percentage can be combined with filter's bandwith somehow, eg OIII is -let say- 8.5nm/2 for Baader and for G, assuming that half the bandwith is from G and the other from B. But all these are really beyond my knowledge, I'm just guessing here.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #41 on: 2012 April 30 06:45:09 »
Still I have some very irritating points to correct, but I think this version is more robust.
The screen has been re-arranged, please give it a try (especially people with screens with limited height) and tell me your opinion.


Known bugs still pending :

1) If you close it from [X] or with the ESC key it will leave all the internal, temporary, views hanging around (I need help, I do not know how to fix)

2) For some strange reason "Show Ha" button refuses to perform correct STF  and I can not find so far why >:( (Working on it, help is welcomed)

3) The first time that you click on any of the listboxes (to select your Views), they will not show the internal, temporary views. But as soon as you have processed one image (aka you have triggered the console window once) the listboxes go nuts and show all available views (temporary included) (library bug ? need help).
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: HaRGBCombination Script
« Reply #42 on: 2012 May 01 04:24:31 »
Well done.  Had a very quick run through, and it is a much better fit on the screen. Thankyou.

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: HaRGBCombination Script
« Reply #43 on: 2012 May 01 12:01:51 »
Hi

Layout is much better , and the silly 40 foot wide script is gone  :D

Get the Ha STF working and you will be on a winner

Thanks for your efforts

Harry
Harry Page

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: HaRGBCombination Script
« Reply #44 on: 2012 May 02 05:13:19 »
Yes, thanks for your work, this is an important script !
I hope it will be included in a future release.