Author Topic: Subframe Selector PCL Module  (Read 39392 times)

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Subframe Selector PCL Module
« Reply #30 on: 2017 November 27 09:53:21 »
Still looking for an answer have installed module on my Mac running High Sierra  and module seems to run fine except noted 2 things pf mentioned above but I still can't get a graph That is mentioned in the original post (An additional Graph is also included which shows a histogram of the selected property with a line representing the Empirical Distribution Function. While this graph is not as interactive as the previous, it helps to identify ranges within your distribution of data that are best to include or exclude),.

Please help


Steve

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Subframe Selector PCL Module
« Reply #31 on: 2017 November 27 10:25:11 »
this is with the latest build i just made - i see the histogram on the right...

did you load the latest build?

rob

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Subframe Selector PCL Module
« Reply #32 on: 2017 November 27 11:08:36 »
Thank Rob

Since the downloads file has the same name I was not sure what version it was but I did switch the files to the latest download on this post and now it is present thanks again.


Steve

Offline cameronleger

  • PTeam Member
  • Member
  • *
  • Posts: 51
    • Blog
Re: Subframe Selector PCL Module
« Reply #33 on: 2017 November 27 19:56:43 »
Thanks, Rob, I updated the OP with the new link.

Re: left-click scrolling, I think a single-click works as well, but that's not the problem. I did not see a method to scroll to an item in the TreeBox, so I'm scrolling to a position I gather from the item at that index. It's possible that I'm using the wrong coordinates; I noticed similar behavior but most of the time it worked. I'll look into this.

Re: view-source, while I don't get the segfault on Linux, it can produce an unrecoverable state. I'm not exactly sure what causes this, but I hoped no one would try! I presume it's because I'm directly setting HTML content instead of pointing to a source file, yet it may have to do with my event handling. I'm hoping I can disable this right-click menu. Otherwise, it's a method to get up a creek without a paddle.

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #34 on: 2018 January 28 10:40:39 »
Hi Cameron,

i'm a late comer here, but just installed and tried this PCL module. it looks very promising! i love the addition of math, which eliminates the extra steps and need for the spreadsheet tool i have been using (posted elsewhere here) to create the weighting value

I may be running into a bug? I was able to run it once successfully, so i know i can get it to work

I was entering various weighting formulas, seeing the red 'x' indicating a formula error, and fixing syntax until i got the green check mark.

however now when I run measure, it errors out with "nan not defined". in addition, i get the red x for some pretty basic approval expressions. I can't get beyond this point

Thanks

Brian

Offline cameronleger

  • PTeam Member
  • Member
  • *
  • Posts: 51
    • Blog
Re: Subframe Selector PCL Module
« Reply #35 on: 2018 January 30 13:53:12 »
Hi Cameron,

i'm a late comer here, but just installed and tried this PCL module. it looks very promising! i love the addition of math, which eliminates the extra steps and need for the spreadsheet tool i have been using (posted elsewhere here) to create the weighting value

I may be running into a bug? I was able to run it once successfully, so i know i can get it to work

I was entering various weighting formulas, seeing the red 'x' indicating a formula error, and fixing syntax until i got the green check mark.

however now when I run measure, it errors out with "nan not defined". in addition, i get the red x for some pretty basic approval expressions. I can't get beyond this point

Thanks

Brian

Hey Brian,
I'm sorry to hear that. Would you mind using the "Edit Instance Source Code" button at the bottom right of the Module and sending me the contents, perhaps via pastebin? That will help me see all the parameters and measurements to try to track this down.

I cannot tell much so far, other than measurements seem to have been taken but the graph view is not visible, so that might be the source of the JS error. I'm wondering if some parameters were not measured correctly, and the translation from PCL into PJSR produces "nan" for non-numbers instead of the "NaN" that JS would read correctly - not that a NaN is a good thing though.

Also, a quick update. I had done the documentation for this Module, and most of the recent changes were not pushed back to Juan. I was unsure how long his process would take and if he would make changes himself, so I wanted to wait to push those afterwards so that I could handle the merging of code instead of giving him more work. Sadly, I haven't had much time to use this since then. I thought winter would be *awesome* for astrophotography, but it turns out in Atlanta winter means few clear skys and very poor seeing!

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #36 on: 2018 January 30 13:58:54 »
sure - i'll get that together tonight and PM you with those contents

Thanks

Brian

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #37 on: 2018 January 30 18:26:54 »
here you go:

https://pastebin.com/i90pcZtJ

two attachments show

1. before state, entered the approval and weighting formulas, they both 'check out'

2. after loading data and pressing measure, get the error

Offline cameronleger

  • PTeam Member
  • Member
  • *
  • Posts: 51
    • Blog
Re: Subframe Selector PCL Module
« Reply #38 on: 2018 January 31 18:57:42 »
Thanks Brian,
I can confirm the issue is with the Weighting Expression, not the Approval Expression, although that one can display the X for some reason.

The 'plain' variables such as FWHM and Eccentricity only represent the current subframe being measured. So, Math.min(FWHM) and Math.max(FWHM) will return the same thing as FWHM, and subtracting these values will result in 0. The 'nan' error appears when it's dividing by 0.

The simple fix here is to use the 'special' variables such as FWHMMax and FWHMMin which are calculated before each subframe and represent the global max and min of all subframe FWHMs. Here's that expression modified to work for me:

Code: [Select]
35*(1-(FWHM - FWHMMin) / (FWHMMax - FWHMMin)) + 7*(1-(Eccentricity - EccentricityMin) / (EccentricityMax - EccentricityMin)) + 18*((SNRWeight - SNRWeightMin) / (SNRWeightMax - SNRWeightMin)) + 40

That said, I will definitely look into 'nicer' or more obvious messages when 'nan's are involved, and try to make the X's work better in these cases.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Subframe Selector PCL Module
« Reply #39 on: 2018 January 31 19:58:55 »
btw there are no logs that i can see, so i don't know how to usefully report these bugs, but i've had a couple of instances where the SFS module hangs up and can't be quit, necessitating a force quit of the whole PI platform. i've taken to saving my project before running it.

i believe these occurred while measuring subframes, but they also may have occurred while interacting with the UI. sorry i can't be of more help...

rob

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #40 on: 2018 January 31 21:32:17 »
Thanks Brian,
I can confirm the issue is with the Weighting Expression, not the Approval Expression, although that one can display the X for some reason.

The 'plain' variables such as FWHM and Eccentricity only represent the current subframe being measured. So, Math.min(FWHM) and Math.max(FWHM) will return the same thing as FWHM, and subtracting these values will result in 0. The 'nan' error appears when it's dividing by 0.

The simple fix here is to use the 'special' variables such as FWHMMax and FWHMMin which are calculated before each subframe and represent the global max and min of all subframe FWHMs. Here's that expression modified to work for me:

Code: [Select]
35*(1-(FWHM - FWHMMin) / (FWHMMax - FWHMMin)) + 7*(1-(Eccentricity - EccentricityMin) / (EccentricityMax - EccentricityMin)) + 18*((SNRWeight - SNRWeightMin) / (SNRWeightMax - SNRWeightMin)) + 40

That said, I will definitely look into 'nicer' or more obvious messages when 'nan's are involved, and try to make the X's work better in these cases.

Great thanks. Is there a place where all the special variables are documented? these are the obvious ones I need for now :)

Brian

Offline cameronleger

  • PTeam Member
  • Member
  • *
  • Posts: 51
    • Blog
Re: Subframe Selector PCL Module
« Reply #41 on: 2018 February 01 19:57:52 »
Hey Rob,
I haven't had anything like that; you're on OS X right? I'll look into debugging/logging information.

Hey Brian,
They're currently in the tooltips on those fields. I think it lists the variables, and that each of them have a few special versions and lists those types. I also have it in the documentation with some examples, but that's not released yet. I could look into distributing that before the formal release, but I think it only works in PI.

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #42 on: 2018 February 01 20:41:37 »
Hey Brian,
They're currently in the tooltips on those fields. I think it lists the variables, and that each of them have a few special versions and lists those types. I also have it in the documentation with some examples, but that's not released yet. I could look into distributing that before the formal release, but I think it only works in PI.

no sweat, you showed me the main ones i need for now, so I am patient for the full release. Thanks again so much, you saved me i don't know how much time.

B

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Subframe Selector PCL Module
« Reply #43 on: 2018 February 01 20:58:58 »
Hey Rob,
I haven't had anything like that; you're on OS X right? I'll look into debugging/logging information.


yes, OSX. thanks.

rob

Offline bvalente

  • Member
  • *
  • Posts: 58
Re: Subframe Selector PCL Module
« Reply #44 on: 2018 February 03 11:57:56 »
Hi Cameron

that works beautifully.

i have one more request - not a huge one, but is there a way to save the weighting formula from session to session or through application restarts?

i typically use the same formula, so i have to either type it in (painfully) every time or copy it from another place.

or maybe there's a way to save and restore different formulas?

minor request, I don't want to look a fabulous gift horse in the mouth ;)


Brian