PixInsight Forum

Software Development => New Scripts and Modules => Topic started by: bvalente on 2018 January 18 20:49:05

Title: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2018 January 18 20:49:05
Hello all,

I hope this is the right place to put this

i am posting an updated excel sheet that helps automate a lot of the tedious data calculations for determining things like fwhm min/max, eccentricity min/max, etc.

Now you can just load your images into SubframeSelector, Measure, export the data table, and with one button push you can get an expression complete with all your min/max values set properly

the excel sheet is definitely beta, but works great. please make sure to understand and follow the directions on the first sheet

https://www.dropbox.com/s/ytzlt5rwg7usnij/SubframeSelector%20Weighting%20Expressions%20datacopy.zip?dl=0

let me know what you think, i hope you find it useful

it IS an excel macro, so you have to enable macros to get it working

It's based on the work of David Ault regarding using an expression for weighting subframes, and using a spreadsheet to more easily create the expression itself. I've just taken it one click further to automate a lot of the data viewing and entry

If you aren't familiar with this, you can read up on David's blog post here: http://trappedphotons.com/blog/?p=693

Cheers

Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2018 January 19 14:33:37
Updated version with check and compatibility for Mac platform

https://www.dropbox.com/s/v0z1fkfo5bujbgl/SubframeSelector%20Weighting%20Expressions%20datacopy%20v1.1.zip?dl=0
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2018 January 20 22:25:29
Updated 2.0 version now optimizes the range to use only the approved subframes (make sure to finalize your approved frames prior to outputting the table data)

download here:
https://www.dropbox.com/s/fh5umhkok2u4kxb/SubframeSelector%20Weighting%20Expressions%20datacopy%202.0.zip?dl=0

requires Excel and macro enabled

feedback welcome thanks

Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: tdgm on 2018 January 24 17:15:08
Using Mac  where is the copy data button???
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2018 January 24 17:26:51
Top of  the page.  You need to be using MS Excel


Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: FlyingBeagles on 2018 July 21 19:41:17
Great Macro / Spreadsheet and many thanks for taking the time to produce and share.
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: CharlesW on 2018 October 31 09:53:16
As you may have seen, there is a new SFS module that can be installed that is world’s faster than using the script method. But, as far as I can tell, it doesn’t output a CVS file in the same format that your brilliant Excel function requires. Would you mind taking a look at that and see if you could modify your spreadsheet to read this new format? That would be the best of both. Thanks
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: RickS on 2018 October 31 14:33:55
The new SubframesSelector process has some of these calculations built in which simplifies things a lot.  Here's an example of a weighting formula that I've used (line breaks added to aid the reader):

      80*(1/(FWHM*FWHM)-1/(FWHMMax*FWHMMax))/(1/(FWHMMin*FWHMMin)-1/(FWHMMax*FWHMMax))
      +15*((SNRWeight-SNRWeightMin)/(SNRWeightMax-SNRWeightMin))
      +5*(1-(Eccentricity-EccentricityMin)/(EccentricityMax-EccentricityMin))

Cheers,
Rick.
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: guyroch on 2019 January 07 19:51:31
Any ideas when a new spreadsheet will be available with a working COPY button with the new SubframeSelector file format? 
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2019 January 07 20:17:13
With PixInsight 1.8.2 there is basically no need for the spreadsheet anymore - it's now a process available in general release and does all this for you


Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: guyroch on 2019 January 07 20:33:58
Thank you Brian... ummm.... but you still have to provide an expression... or I'm I missing something with the new process where you don't need to edit the expression.
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2019 January 07 20:48:13
Expressions are all now built into the process - you need to be familiar with expressions within PixInsight, but it's far more flexible and capable now.


Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: guyroch on 2019 January 07 21:00:43
I guess I must be missing the obvious then.  The measure process measures everything but without an expression the weight value is set to 0 for all images. 

What do you mean by Expressions are all now built into the process?  Where are they and most importantly how does one apply a specific expression, built-in or not?  I'm not seeing much difference in the process where the measurement process produces a table with all measurements but with the default expression being blank the weight column is set to 0 for all images.

Thanks again.
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2019 January 07 21:17:14
weighting is also expression based, but to get you rolling here's what I use:

for the filter:

FWHMSigma <1.2 (i'll vary this depending on my data)


for the expression:

35*(1-(FWHM - FWHMMin) / (FWHMMax - FWHMMin)) + 18*(1-(Eccentricity - EccentricityMin) / (EccentricityMax - EccentricityMin)) + 70*((SNRWeight - SNRWeightMin) / (SNRWeightMax - SNRWeightMin)) + 40

essentially this gives a weight that's mostly SNR, some FWHM and a little eccentricity


you can vary the values to weight these differently, but this is what I use (my FWHM is pretty consistent, my SNR varies a lot)


hth


Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2019 January 07 21:22:41
here's an example session using those settings (i just grabbed some random images)

https://www.dropbox.com/s/ysimcvzsueweqjc/example_sfs_session.JPG?dl=0


Brian
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: guyroch on 2019 January 07 22:38:37
Ah, I see it now.  Sigma and Min/Max suffix will get what is needed in lieu of the calculated spreadsheet values.  Thank you.
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: CharlesW on 2019 January 13 21:32:19
I still must be the dumbest guy on the block. I can see how to manually copy a formula into the window but I fail to see where the formulas are “built in.”
Title: Re: Updated Excel Sheet for SubframeSelector expression generation
Post by: bvalente on 2019 January 13 21:58:59
Charles the formulas still need to be created, but many of the calculations are now built-in calls instead of things that have to be done externally on a spreadsheet

for example rather than having to calculate the FWHM maximum, you can just call FWHMmax (as you can see in the formula below)

SNRWeight is a really handy one, for example

hth

Brian