Question on scripting

anirban

New member
Dec 11, 2020
2
0
Is there a programmatic way to close a ProcessInstance?

Code:
var P = ProcessInstance.fromIcon("Process01");
P.launch();
P.executeOn(w[0].currentView);
I want close the ProcessInstance P programmatically.

Can anyone help?
 

Juan Conejero

PixInsight Staff
Sep 2, 2004
7,895
226
57
Valencia, Spain
pixinsight.com
This functionality is not available. Once you open an interface window, only the user can close it.

However, why are you launching the instance (which forces its interface to be shown)? This is not necessary to execute a process instance. In other words, unless you have a very good reason to open the interface window, you can simply delete the second line in your code snippet.
 
  • Like
Reactions: robyx

anirban

New member
Dec 11, 2020
2
0
I was using this for DBE. I didn't find a good way of adjusting sample weights across images without launching the interface.
 

robyx

PixInsight Staff
Jul 17, 2019
173
43
44
Zurich
Just to understand the context: changing the points programmatically is not the big question I guess, the real question is why you would a script to place the points on your behalf? DBE is a process that highly requires the user to inspect the data to accurately place the control points in order to address issues that are mostly recognized visually or performing punctual measurements on the data. I can hardly immagine a script that could do this job on behalf of you...
 

robyx

PixInsight Staff
Jul 17, 2019
173
43
44
Zurich
By the way, I guess modifying programmatically the DB points programmatically is not straightforward, looking at the source code transported by the DB Icon I see a lot of parameters associated with the points calculated and stored by the process, so changing a point programmatically would require adjusting those parameters accordingly...
 

pfile

PTeam Member
Nov 23, 2009
6,381
217
i think that in some instances a script which could do initial placement of samples while avoiding stars under the guidance of an astrometric solution would be awesome.
 
  • Like
Reactions: robyx

pfile

PTeam Member
Nov 23, 2009
6,381
217
true, now that astrometry is so embedded in PI’s paradigm it could be a PCL thing.