Cannot apply approvalExpression and weightExpression when SubframeSelector process called from PJSR

Palmito

Member
Jan 16, 2019
15
2
Hi All,

I am trying to run scripted SubframeSelector process from javascript and have encountered difficulties I haven't been able to solve.

  1. When I executeGlobal() my SS process (using generated source at first), I have been unable to get approvalExpression and weightExpression to be applied.

    I browsed through PCL repository but didn't find anything obvious to me.

    In the end to circumvent this issue I have tested SS returned measurement values and approved accordingly.

  2. Another issue I encountered that could be linked to the first one, is that the measurements array seems to be readonly, I had to instantiate a new one and feed it.

Is there a way to get those expressions to be used by my JS instantiated SS process?

If not, is there a way to call the JSEvaluator used by the PCL process or shall I code my own expression evaluator?


Many thanks!

Cheers and CS!
 
Last edited:

Palmito

Member
Jan 16, 2019
15
2
If nobody can help, can someone point me in the right direction for compiling and debugging?

I havent coded C++ in over 20 years, so:
  • In order to build and debug processes, can I use Visual Studio Express?
  • Is it cross compiling from Windows?

Many thanks!

Cheers and CS!
 

pfile

PTeam Member
Nov 23, 2009
6,933
297
if you check out the PCL repository from gitlab, there is a readme file at the top that describes how to set up the compile environment. you should be able to compile x86 windows dlls from windows itself so there's no cross compiling involved...

rob
 
  • Like
Reactions: Palmito

jmurphy

PTeam Member
Jun 13, 2010
349
165
Basingstoke, England
@Juan Conejero has the error in MakGenUtility.js been fixed?
See post:
Thanks, John Murphy
 
  • Like
Reactions: Palmito

Palmito

Member
Jan 16, 2019
15
2
So I ended-up coding my expression evaluator. Which to my surprise has been really simple.
The PCL code got me on my way.

For those who might be interested, here are my findings:
  1. The subframe selector process is not designed to consume approvalExpression and weightingExpression. Those two are only used by the GUI.
  2. Expression operations done from the GUI will be be reflected in the measurements array (enabled and weight "columns")
  3. Anything you put in the measurements will be consumed by the process. For instance if you calculate your weights in JS and pass those to the process in OutputSubframe routine mode, the file will contain it.
  4. Beware some values are scaled in the GUI, but not the data in measurements. So they need to be scaled for the expressions evaluation.
    1. FWHM and FHWMMeanDev need to be multiplied by your scale (arcsec/px)
    2. Median, MedianMeanDev and Noise need to by multiplied by your gain (e-/ADU) times your max ADU (2^BitDepth)