Author Topic: Ha RGB combine script error, need help  (Read 4958 times)

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 258
    • Faint Light Photography
Ha RGB combine script error, need help
« on: 2016 November 08 12:50:10 »
Hi all,
I have PI Programing Question--actually it is about a script I found on the PI Forum that attempts to implement the algorithm by Vicent Peris: "A New Approach to Combination of Broadband and Narrowband Data." The script is ""CombineNBandWithBBand v0.1" by David Raphael (2010). (David, are you there?) Download link is on this page:  http://pixinsight.com/forum/index.php?topic=2127.0

Anyway, I tried it and it generated an error in this section of code (below). Does anyone see the problem? (I do not know PI classes and such, or where to read about them.) No idea what creatFlatRGBWS() is supposed to do or why, but the last line below is where it seems to hang.

      var flatRGBWS = createFlatRGBWS();
      flatRGBWS.executeOn( ImageWindow.windowById("HaRGB").mainView );
      var haGB_PM = createPmSkel();
      with( haGB_PM )
      {
         expression  = "NBandImage * " + dialog.haBoost_Edit.text;
         expression1 = "BBandImage[1]";
         expression2 = "BBandImage[2]";
         newImageId = "HaGB";
         newImageColorSpace = RGB;
      }
      haGB_PM.executeOn( broadBandImage[0].mainView );
      flatRGBWS.executeOn( ImageWindow.windowById("HaGB").mainView );

Interestingly, the last image the script produces before bombing is a combined Ha-R image, which I rescued and was able to integrated into an HaRGB image of considerable pizzazz and with good preservation of stars. It sure would be nice to get the entire script's code completed and up to date and functioning!
    
     Thanks, Alex
    

Offline akulapanam

  • Member
  • *
  • Posts: 60
Re: Ha RGB combine script error, need help
« Reply #1 on: 2017 January 22 23:27:33 »
I thought the NBRGB combo script did this but I just looked and it does not...  Would be fantastic to have though

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Ha RGB combine script error, need help
« Reply #2 on: 2017 January 23 11:19:42 »
NBRGB is very similar to the technique (maybe the same, actually) presented by Harry on Harry's Astro Shed which i believe he attributes to Vicent. this method may or may not be exactly the same as what's presented in that forum post, but the gist of NBRGB is to create the synthetic continuum maps as harry's video shows, based on the filter bandwidths. the script is generalized to handle any narrowband filter + any broadband channel.

rob

Offline akulapanam

  • Member
  • *
  • Posts: 60
Re: Ha RGB combine script error, need help
« Reply #3 on: 2017 January 23 20:34:43 »
NBRGB is very similar to the technique (maybe the same, actually) presented by Harry on Harry's Astro Shed which i believe he attributes to Vicent. this method may or may not be exactly the same as what's presented in that forum post, but the gist of NBRGB is to create the synthetic continuum maps as harry's video shows, based on the filter bandwidths. the script is generalized to handle any narrowband filter + any broadband channel.

rob

That's what I thought but I read through the entire thread on its development.  http://pixinsight.com/forum/index.php?topic=3446.90

On page 7 it becomes clear that the math is definitely NOT the continuum method unfortunately.

I also went through the code which is what my earlier post was based on.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Ha RGB combine script error, need help
« Reply #4 on: 2017 January 23 21:15:03 »
rick and i were discussing this before, and this is what i sent him previously via email. as far as i can tell the math in the script is the same as the process icons on Harry's site:

Code: [Select]
maybe… there is a flow on Harry’s astro shed here:

http://www.harrysastroshed.com/pixinsight/pixinsight%20video%20html/pixinsighthomeinter.html

which is attributed to vicent; it seems to be the core of what’s written on that one page - computing a virtual continuum map from the Ha and R masters. there’s a weighting factor involved which is related to the bandwidths of the two filters. i have used that method to combine R and Ha on a few images.

on harry’s site there are two process icons, one to make the “emission” image and one to add in the emission image to the ha image. the pixelmath contents are:

emission = ((Ha * 100) - (R * 12)) / (100 - 12)
blend = $T+(ha-Med(ha))*4

where the bandwidths are hardcoded to 100 and 12nm, and the Ha scale factor at 4.

the NBRGB script contains the same code to compute the emission image:

P.expression = "(("+data.sourceNBrView.id+"*"+data.sourceRGBBandwidth+")-("+data.sourceRGBView.id+"*"+data.sourceNBrBandwidth+"))/("+data.sourceRGBBandwidth+"-"+data.sourceNBrBandwidth+”)”;

then later, the code under this comment:

         // R=R+(Ha-med(Ha))*HaMultiplier

eventually does this;

 P.expression = data.sourceRGBView.id+"[0]+("+NBr_NAME+"-med("+NBr_NAME+"))*"+data.sourceNBrMultiplication;

which is the same thing as the 2nd pixelmath expression in the xpsm.

what did i miss?? it seems to be the same stuff (at least the same as what's on Harry's site) at its core.

rob

Offline akulapanam

  • Member
  • *
  • Posts: 60
Re: Ha RGB combine script error, need help
« Reply #5 on: 2017 January 24 00:16:13 »
I think that is Harry's for sure, but the continuum method as posted on main PixInsight page involves dividing the broadband by narrowband and then doing some iterative applications of the map to the narrowband layer. See http://pixinsight.com/tutorials/narrowband/ that is Vicent's current method

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Ha RGB combine script error, need help
« Reply #6 on: 2017 January 24 08:35:49 »
yes, this is why i said "this method may or may not be exactly the same as what's presented in that forum post" - all i know is that several times i had used the method presented on harry's site, and this script automates that method. seems to work well enough. so the problem is in the semantics of what is meant by "vicent's method".

rob