Author Topic: SubframeSelector needs exponentiation operator  (Read 1105 times)

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 258
    • Faint Light Photography
SubframeSelector needs exponentiation operator
« on: 2019 January 07 07:34:15 »
In the latest version of PI, the new implementation of the SubframeWeighting process does not accept exponentiation as either ** or ^. As many of us use an external program (usually a spreadsheet) to construct a weight equation, and, in my case, one that uses '^', this is a significant issue. I have not tried using math.pow(a,b), but that would entail a lot of rewriting and testing of my spreadsheet-equation generator (and maybe of other folks too). Could '**' be implemented, maybe, please.
Until then, I'll have to use the old script.

(I use ^2 to get distances from the best value of a variable normalized to the range of the value.)

Thanks, Alex

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: SubframeSelector needs exponentiation operator
« Reply #1 on: 2019 January 07 07:52:48 »
Alex,

The SubframeSelector tool uses the integrated JavaScript engine to process weighting and approval expressions. This means that the expressions have to be valid JavaScript source code, so the ^ operator has a very different meaning (bitwise XOR) and ** does not exist.

That said, an automatic replacement feature would be quite easy to implement, so that ^ or ** could be replaced by Math.pow() function calls. We'll try to implement this as soon as possible in a future version. If you are a C++ developer, the SFS tool is an open-source module available at our official GitHub repository:

https://github.com/PixInsight/PCL/tree/master/src/modules/processes/contrib/cleger/SubframeSelector

If you implement this feature on your own, please feel free to contribute it.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 258
    • Faint Light Photography
Re: SubframeSelector needs exponentiation operator
« Reply #2 on: 2019 January 07 09:25:07 »
Juan, Thanks for the quick reply. It's been 20 yrs since I programmed, so I am unlikely to try such a modification. I thought I'd just use the old SubframeSelector script, but I see that it, and the new one, do not agree on the values of most measurements, or, often, even the relative ranking of the measurements. Presuming that "newer is better," I guess I'll bit the bullet and modify my excel equation.

Alex