Page 1 of 1

Scripting functions for stacking?

Posted: 27 Oct 2019, 07:40
by Rudi
I have a set of over 500 fits, that I need to stack in groups of 10's.

stack1 = stack(i1, i2, ...i10)
stack2 = stack(i11, i12, ...i20)
.
.
.

Doing this manually, quickly becomes boring.

Is it possible to automate this in AA7? I san not find any suitable scripting functions.

Re: Scripting functions for stacking?

Posted: 27 Oct 2019, 13:02
by fabdev
Hi there's an experimental command called "Preprocessing(text)" which accepts a text which contains the files to be stacked. Here is an example of the format of the text:

Code: Select all

#PREPROCESSING
Dark=D:\temp\Drk01.fit
Dark=D:\temp\Drk02.fit
Image=D:\temp\IC1805-R1.fit
Image=D:\temp\IC1805-R2.fit
Image=D:\temp\IC1805-R3.fit
Image=D:\temp\IC1805-R3.fit
Flat=D:\temp\Flats\MFR.fit
AlignMethod=1
CombineMethod=1
ExtraFilters=1
And here is an example to build the text at runtime (you don't need the $ in the string variables):

viewtopic.php?f=5&t=293

you may use a loop to add automatically the files:
Image=i1
Image=i2
..

another example:

Code: Select all

dir = "C:\users\user\desktop\Temp\"
pre = "#PREPROCESSING" + CRLF
pre = pre + "Dark = " + dir + "D300.fit" + CRLF
pre = pre + "Image = " + dir + "FR1.fit" + CRLF
pre = pre + "Image = " + dir + "FR2.fit" + CRLF
pre = pre + "Image = " + dir + "FR3.fit" + CRLF
pre = pre + "AlignMethod=1" + CRLF
pre = pre + "CombineMethod=1" + CRLF
print pre
Preprocessing(pre)
by the way, it's also quick to select the files for a manual preprocessing: just click on "i1", press SHIFT, then click on "i10" to select all the files in between.

Re: Scripting functions for stacking?

Posted: 27 Oct 2019, 20:00
by Rudi
Great, thanks Fabio, just what I was looking for.