Author Topic: Running a script on a bunch of images?  (Read 11849 times)

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Running a script on a bunch of images?
« on: 2011 June 10 08:13:41 »
This is probably easy, but I've searched and can't quite figure it out.
I would like to run a repair column script on a batch of images.....how is this done.

I've tried the image container but can't quite figure out how to run a script on the deal....
I've also looked at process container...but again, no joy.

Is there a tutorial/video?

thanks for the help,

bud

PS...the script was found here:
http://pixinsight.com/forum/index.php?topic=806.0

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #1 on: 2011 June 10 09:10:18 »
From my -limited- knowledge of how PI and ImageContainer works: it will not work.
You see, you have to create an instance of the imagecontainer on the desktop and apply an instance of a process on it.
That means "triangle" on the script/process, which is missing from this banding script.
As the matter of fact the script acts on the "active image":  

var window = ImageWindow.activeWindow;

so I do not think it can support the ImageContainer.

Of course I may be wrong, in which case I'll be happy to learn how this works.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Running a script on a bunch of images?
« Reply #2 on: 2011 June 10 09:16:24 »
Bud,

If a script has a blue triangle in the left lower hand corner(like the Cosmetic Correction Script) then after setting up the script parameters, drag the triangle to the desktop. This creates a new instance of the script that behaves like other processes. You can then drag the Image Container triangle to this new instance which should then execute the script on all images in the container. If the script doesn't have the triangle then I don't know how to do this. Perhaps one of  PI's Jedi's will chime in with the solution. :D

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #3 on: 2011 June 10 09:32:58 »
Hi guys,

Thanks for the quick responses.

I had found that about using the triangle, but couldn't use it because of the lack of the triangle on this particular script.......but, I figured there must be a way of using a script with more than one image.
Otherwise I must use the script on each image.....save them one at a time.....and this becomes quite time consuming.

the script works very well for removing the column defects in my images, but  it would be nice to automate this to all images..after calibration.

and ideas?......could this script be modified to accomplish this?

Is it possible to put one of these triangle deals on a script?

bud


« Last Edit: 2011 June 10 09:39:53 by budguinn »

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Running a script on a bunch of images?
« Reply #4 on: 2011 June 10 09:40:22 »
If you want to fix columns, you may try the DefectMap process, and apply it to a ImageContainer.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #5 on: 2011 June 10 09:42:13 »
Sure, see the replies I got in similar question (no 2) here http://pixinsight.com/forum/index.php?topic=2177.0 regarding a triangle on a script.
It is not so difficult as it may sound, look Juan's reply - do you know how to write PJSR scripts ?  ;)
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #6 on: 2011 June 10 09:59:02 »
Sure, see the replies I got in similar question (no 2) here http://pixinsight.com/forum/index.php?topic=2177.0 regarding a triangle on a script.
It is not so difficult as it may sound, look Juan's reply - do you know how to write PJSR scripts ?  ;)

Hi John,

It was one of your posts...helping another person....that helped with the triangle...but couldn't get it figured with this script.

I don't know how to write scripts, but I'll take a look at the link and then see if I can figure it out...either with the script or with the defect map.

bud

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #7 on: 2011 June 10 10:01:34 »
Although writing scripts may be fun, I think the DefectMap will be a faster solution
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #8 on: 2011 June 10 10:48:13 »
John, I've tried this a few times but keep getting an error...here is an example:

Quote
PCL win32 System Extension at:...address

I'm using win64.....does it not work with win64?

This seems to get quite complicated to just try to get rid of some bad columns....that are present in all of the images taken with this camera....and it takes quite a bit of time trying to search the entire data base before asking a question, when a manual would be quite helpful......and yes, I've read all of the previous complaints about no manuals.  I'm just saying that this is getting a bit more than I guess I want to fool with.

bud



Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #9 on: 2011 June 10 13:54:35 »
My friend, I can not debug this case, this is beyond me. On my Win7/64 with PIX64 DefectMap seems to work.

Also I can not comment for the rest, as I'm only a -happy- customer, not affiliated with the commercial team.
I complete understand your frustration, even though I do not share it. Some of the reasons I'm happy with PI are the reasons that make you unhappy:
prompt forum support from the authors, peer support from the forum, the ability to write your own scripts (although most of the times I do not have the time to do it), the fact that many things are open source, so I can learn from others or dig in details if I want and  and the joy of discovering new options.

BUT, what I can do, since weekend came and clouds covered the sky  >:( is to try adding the triangle to the original banding script.
This is just for my fun and learning. I already started and may have something soon (I go step by step, trying to understand how it works and how to apply it)

 (Juan, I want payment   ;D )
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #10 on: 2011 June 10 19:08:39 »
OK, here it is. Heavily based on DrawSignature.js (I guess it needs the copyright notice at the top since it is a derived job - Oh, well, these stuff is too mush for me  :P )

Neither clean, nor polished.
With two bugs that I'm too sleepy to correct (a PJSR guru to review the code please ? )


bug 1: if there is no current view open you can not start the script.
           As a workaround for the moment: just open any window before you issue the script, preferable one of your images to be corrected
           This is located at line 215 and it is based on the assumption that you have an active image. I'm too sleepy to think how to correct the logic

bug2:  if you try to drag-drop the triangle over an ImageContainer icon (as you should be able to) , you will get an error that "Attempt to execute a script instance recursively", etc, etc, etc. Not sure why this is happening

So, how to use it and work ?

1) create an ImageContainer, put all files, parameters etc. Drag the triangle on the desktop to create a new icon
2) open one of your images (as a workaround to bug1)
3) open the script, put the parameters
4) drag the triangle to the desktop (workaround to bug 2)
5) close the script. Drag the icon of the saved script from the desktop OVER the icon of ImageContainer


I have to admit that I did not tested it beyond this point, it does something to all images, but I do not have samples to see if it really corrects them or not - at least it says so.


I hope this gives you a solution for the moment, other people may correct-refine it better
(yes, it was fun, but I need some sleep :)  ::) )




Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #11 on: 2011 June 10 21:22:58 »
Hi John,

I really appreciate you taking a look at this and I think you're/we're close.  I tried it and it comes up with an error.
If I just use the fixlines, load my map and then apply it works for the one image.
If I try to bring a process to the desktop and then place this on the image it fails....and of course it will fail the same way when I put it on the image container.
I'll take a look at the error code and see if I can help figure it out.  I just got in and I have a golf tournament over the weekend so I may not have time 'till Sunday evening.

John, again, I appreciate you taking a crack at this....and figuring out how to put the little triangle/instance on the script.

bud

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Running a script on a bunch of images?
« Reply #12 on: 2011 June 13 11:21:37 »
Just come  back from a long weekend. If you can give me more details on the error I may be able to assist more.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #13 on: 2011 June 15 07:09:10 »
Hi John,

I appreciate your help.....I'll try to get back to this...soon.  Right now, I'm going to use either CCDStack or ImagesPlus for this portion of the processing....both have facilities for repairing the columns....and they have the debloom ability.......both of which are absent in PI.

Right now, I've got a bunch of stuff (this retired life is tough) to do...but I'll run it again and try to document the errors that are reported.

thanks again.

bud


Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Running a script on a bunch of images?
« Reply #14 on: 2011 June 15 07:40:12 »
John, I quickly tried the fixlines script.
If I load my previously made column defects map in to the script and press 'ok' it works.  If I drag the triangle to the picture that is open then gives the 'recursive' error.
If I drag the little triangle to the desktop for a new instance, close the script, and then apply the triangle to the open picture....I get the following.

Script: Processing view: M51_B_1200s_00000196_M51

run -x -p="fixColumn,true" -p="fixRow,false" -p="position,0" -p="doColumns,true" -p="doRows,false" -p="columns,91,203,553,572,1229,1610,1947,1991,2017,2092,2950,690,378,839,959,1972,2129,2376,2612,2691,2752,2808,176,279,319,397,1540,1780,1836,1626" -p="rows," -p="average,true" --md5="dcb78cd5791d80df1a1146130c5530f9" -p="isGlobalTarget,false" -p="isViewTarget,true" -p="targetView,M51_B_1200s_00000196_M51" "$PXI_SRCDIR/scripts/fixLines.js"

Processing script file: C:/Program Files/PixInsight/src/scripts/fixLines.js
*** Error [000]: C:/Program Files/PixInsight/src/scripts/fixLines.js, line 40: Error: Image.sample(): invalid argument type: numeric value expected.
Reading swap files...
387.10 MB/s
0.141 s


Same type of thing happens when I apply to an image container.......

bud