Starnet v2 Call with Macro

Image processing, astrometry, photometry, etc.
User avatar
Rudi
Posts: 160
Joined: 08 Jan 2019, 04:47

Re: Starnet v2

Post by Rudi » 08 Feb 2022, 05:27

Morten Lerager wrote:
07 Feb 2022, 19:45
Another approach using a macro.

https://youtu.be/nwLST-FLPo0
Would You care to share that macro Morten?
/Rudi

User avatar
Morten Lerager
Posts: 69
Joined: 08 Oct 2021, 14:53
Location: Denmark

Re: Starnet v2

Post by Morten Lerager » 08 Feb 2022, 09:30

Oh, sorry Rudi. As soon I get home from my work :shock:
The Macro is a little funny. I must be blind, can't find a command for copy and deleting file.
So there are a lot of fussy workaround.
If you know the syntax for copy or delete please share.
Or if any can write it, some less confusing, let me know.

Only run in AA8 SP1

Code: Select all

' StarnetV2
' Inviroment: Macro AA8 SP1
' Tested on Windows 11
' 07-02-2022 Morten Lerager
'
' *** Init ***
' Path to Starnet install dir
Starnet = "C:\Users\morte\Documents\AA8\StarNetv2CLI_Win\"
' Tiles: Lower value = better removement, slower performens
' Chould be change to user Input
Tiles = "256" 
'

InName=Image.FileNameWithPath
MyPath = ExtractPath(InName)
ImageName = Image.FileName

' Chek Input file
If Right(ImageName,3)<>"tif" and Right(ImageName,4)<>"tiff" then
	message("Image has to be in 16 bit Tif format")
	END
endif

' Put the Image in Starnet folder
CMD="Robocopy " + MyPath + " " + starnet + " " + ImageName
System.Execute(CMD)

' Delete Starless if found
FileExists = findfile$(starnet,"Starless_" + ImageName) 
If FileExists <>"" then ' Delete before run
	savetext$("Del "+ starnet + "Starless_" + ImageName , Starnet + "ImageDelete.cmd")
	CMD=Starnet+"ImageDelete.cmd"
	System.Execute(CMD)
endif


' Running Starnet
savetext$("Pause"+crlf()+"pushd "+Starnet+crlf()+"Pause"+crlf()+"starnet++.exe "+ImageName+" Starless_"+ImageName+" "+Tiles+crlf()+"Pause"+crlf()+"popd",Starnet+"Starnet.cmd")
CMD=Starnet+"Starnet.cmd"
System.Execute(CMD)

' Wait for Starnet Finish
FileExists=""
while FileExists=""
	pause(10) 
	FileExists = findfile$(starnet,"Starless_" + ImageName) 
endwhile


' Open the StarLess Image
Image.Open(Starnet+"Starless_"+ImageName) 
' Save it in Home folder
Image.Save(MyPath+"Starless_"+ImageName)
' Close active Image
Image.Close
' Open it from Home folder
Image.Open(MyPath+"Starless_"+ImageName) 


' Delete the Image in Starnet folder
savetext$("Del "+ starnet + ImageName+crlf(),Starnet+"ImageDelete.cmd")
AppendText("Del "+ starnet + "Starless_" + ImageName , Starnet + "ImageDelete.cmd")
CMD=Starnet+"ImageDelete.cmd"
System.Execute(CMD)

END
function ExtractPath(s)
   return Mid(s, 1, InStrRev(s,"\"))
end function
HEQ5 Pro 150PDS 60mm guide. Asiair.
Asi294mc. AA8.

fabdev
Posts: 500
Joined: 03 Dec 2018, 21:43

Re: Starnet v2 Call with Macro

Post by fabdev » 14 May 2022, 13:36

An updated plugin for version 2.0 is available as well, so there's no longer need to rename the executable:

Download at: https://www.msb-astroart.com/

User avatar
Rudi
Posts: 160
Joined: 08 Jan 2019, 04:47

Re: Starnet v2 Call with Macro

Post by Rudi » 14 May 2022, 17:08

Thanks Fabio!
/Rudi

User avatar
Morten Lerager
Posts: 69
Joined: 08 Oct 2021, 14:53
Location: Denmark

Re: Starnet v2 Call with Macro

Post by Morten Lerager » 21 May 2022, 21:40

Superb!
HEQ5 Pro 150PDS 60mm guide. Asiair.
Asi294mc. AA8.

Post Reply