Author Topic: BatchStatistics: Process instance: enter new file list  (Read 3365 times)

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
BatchStatistics: Process instance: enter new file list
« on: 2015 September 12 22:17:12 »
I would like to configure an instance of the BatchStatistics script so each time a run it I enter a new list of files and set the output file.  At present there is no option for doing this.

Is there a way to:

a) Modify the BatchStatistics script to display the original script entry form so I can change the file settings?

b) Is there a different script or process that I can use for processing a set of images?

c) Is there a 'template' script that calls a script and fills in the configuration with a predefined set?  I could then modify this to call the BatchStatistics script.

What I want to do is have a process instance where I can select a list of images and have it write a csv file of stats for each image.

Offline IanL

  • PixInsight Addict
  • ***
  • Posts: 116
    • The Imaging Toolbox
Re: BatchStatistics: Process instance: enter new file list
« Reply #1 on: 2015 September 13 11:30:16 »
You can do this the same way you would with most script and processes. Start the script from the menu, configure the options however you would like but leave the output file name and input file list blank. Drag the blue triangle at bottom left of the dialog to the workspace to create a new process icon which stores all of your selections.

Close the script and you can then launch a new script instance using the icon, which will have the previous settings. Select your input and output files and you are good to go.

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: BatchStatistics: Process instance: enter new file list
« Reply #2 on: 2015 September 13 12:23:11 »
I had tried that but when I double click on the process icon it displays a window showing Script Parameters.  For the input file at the bottom it shows a single text entry line.  I don't see how I can click on that line and have it open File Explorer for me to select a group of images and drop the list into that line.

Maybe I am missing something about how to relaunch the script.

Offline IanL

  • PixInsight Addict
  • ***
  • Posts: 116
    • The Imaging Toolbox
Re: BatchStatistics: Process instance: enter new file list
« Reply #3 on: 2015 September 13 13:29:10 »
I had tried that but when I double click on the process icon it displays a window showing Script Parameters.  For the input file at the bottom it shows a single text entry line.  I don't see how I can click on that line and have it open File Explorer for me to select a group of images and drop the list into that line.

Maybe I am missing something about how to relaunch the script.

Ah yes, PI's method of relaunching a script is less than intuitive, which is why I included this in the script documentation:

"21. The blue "Process" triangle can be dragged to the PixInsight workspace to create a process icon.  All file entries in the list and the options are saved as part of the process icon.  The process may be re-instantiated by right clicking the script icon, choosing "Launch Script Instance" and then clicking the round "Apply Global" icon at the bottom of the "Script" dialog."

Hope this clears things up.

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: BatchStatistics: Process instance: enter new file list
« Reply #4 on: 2015 September 13 14:10:19 »
Well that helped heaps .. thank you.

I can now reopen the script GUI and select files.  But when I click the Analyze button nothing happens, though the Process Console shows running.  I click Abort and nothing, but closing the script window then results in this message appearing in the Process Console:

Processing script file: C:/Program Files/PixInsight/src/scripts/BatchStatistics/BatchStatistics.js
*** Error [000]: C:/Program Files/PixInsight/src/scripts/BatchStatistics/BatchStatistics-GUI.js, line 403: Error: File I/O Error: Invalid or empty file name

26.566 s

What I did was select a single image and specified console output only (no file, no headers).

The Script Parameters shows the outputFile and inputFiles are empty.  Is it possible the empty file name error message is because the script parameters shows no file name and when I select one it is not transferred?

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: BatchStatistics: Process instance: enter new file list
« Reply #5 on: 2015 September 13 14:16:51 »
The first time I saved the instance I did not specify any files.  When I run this one and add files I get the error message when analyzing.

But, if I save the instance with some file and then change this when I run the instance, it now works okay, correctly using the new files I select.

This works perfectly now, just getting used to how to use the script properly.


Offline IanL

  • PixInsight Addict
  • ***
  • Posts: 116
    • The Imaging Toolbox
Re: BatchStatistics: Process instance: enter new file list
« Reply #6 on: 2015 September 13 14:41:50 »
OK Thanks Craig, I'll take a look at the code and try to figure out what needs to be fixed to avoid the errors you have identified.  Might not be able to do it for a while though.

Offline IanL

  • PixInsight Addict
  • ***
  • Posts: 116
    • The Imaging Toolbox
Re: BatchStatistics: Process instance: enter new file list
« Reply #7 on: 2015 September 22 08:02:45 »
OK I've found the problem, if you extract the contents of the attached zip and put them in the following location overwriting existing files, you should not have any new problems (existing script instances may still show this behaviour if re-launched):

[PixInsight installation folder]/src/scripts/BatchStatistics

I'll ask Juan to update the official release version with this fix.

(The issue was that if the input files list was empty, a parameter was created in the script instance containing a space.  When trying to extract the parameter that caused the first entry in the input files list to be a space also).
« Last Edit: 2015 September 23 06:27:07 by IanL »

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: BatchStatistics: Process instance: enter new file list
« Reply #8 on: 2015 September 22 22:18:20 »
Works great .. thank you!