Does Sharpcap integrate with any planning tools?

Somewhere to share your expertise in using SharpCap
Post Reply
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Does Sharpcap integrate with any planning tools?

#1

Post by rwillett »

Hi,

My first post here, I've been using Sharpcap for a couple of weeks and slowly learning how not to do astrophotography. The more I do, the more I learn not to do :)

I was looking for planning tools to help the sessions and can see things like

Astroplanner
Deep Sky Planner
Sky Tools 4 Imagining

Each of these have the advantages and disadvantages and wondered if any of them (or any others) integrate with Sharpcap at all. Whilst Skytools 4 looks great (and has a high price tag to match), it integrates with ACP which is waaaay beyond my level and budget. However ST4 working out the best exposure levels takes a lot of the guesswork out of imaging. Some people like to tinker, I'm one of them TBH, but my allowable time for a session is limited so I need to maximise it as best I can.

So is anybody aware of any integration points, it's not a problem if it requires coding (for some value of not a problem :D ), I can code in most languages, though Python isn't yet on my list, but can be added if I have to. C would be easier :)

Anyway, any advice welcomed.

Many thanks for a great product.

Rob
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap integrate with any planning tools?

#2

Post by admin »

Hi Rob,

if you can code, I'm sure you can glue something together. For instance SharpCap 4.0 has a sequencer module (see viewtopic.php?f=38&t=3109). The saved sequences are text files in a very simple 'not quite a programming language' language. You could take the output of one of the tools you mention and generate a sequence from it (make one using the editor first, then substitute in the correct values). The sequencer even has a step that reads a list of target names and co-ordinates from CSV and repeats a set of sub-steps for each target.

There's also the built in python scripting language - you could get really fancy in that (TCP communications, etc) if you wanted.

cheers,

Robin
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Re: Does Sharpcap integrate with any planning tools?

#3

Post by rwillett »

Robin,

Thanks for the response. Read the thread with interest.

I have to confess to writing a number of compilers, both commercially and for fun, C, and some specialised languages as well as an experimental Lisp compiler which was tricky as Lisp allows you to generate and execute programs from within the language. I haven't done this for some years though, so am rusty and would need to spend a long time catching up on stuff.

I understand the issues over variables (type checking, garbage collection, scoping just for starters, once you add even a simple variable such as a byte or integer, suddenly you're into arrays, objects, collections etc), and can see what you are trying to do. Can I ask if you are building a bytecode type interpreter or some sort of directed tree that you traverse? Professional curisoity and I won't be offended if you want to keep it private :)

I did look at ST4 again after reading your thread. The author of Sky Tools 4 has extremely clear views on what he wants and doesn't want to do. It's still not clear to me if ST4 actually exports anything, I was rather nervous about asking in the foums TBH.

My current intention is to stay with SharpCap as

1. It works very well for me, especially the Polar Alignment. To be honest If SharpCap did nothing but PA, I would still think it an excellent product and great value :)
2. It's excellent value (have I said that already?)

I will keep an eye on ST4 as I like the idea of having some better way of working out how to take better pictures, but until I'm convinced ST4 Imaging can export stuff, I'm loathe to type things in again from one system to another. I work in IT and a major part of my life is automating repetitative jobs, I'm not doing rekeying in my personal life as well.

All the best

Rob
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Re: Does Sharpcap integrate with any planning tools?

#4

Post by rwillett »

Hi,

After looking at a load more videos I can see that Skytools 4 Imaging can output observing plans for iTelescope.net
Screenshot 2021-04-15 at 17.29.03.png
Screenshot 2021-04-15 at 17.29.03.png (143.45 KiB) Viewed 8354 times
I think the the file format is called or is based on ACP and certainly looks to be human readable

More information is here

https://support.itelescope.net/support/ ... elescopes-
http://solo.dc3.com/ar/RefDocs/HelpFile ... anfmt.html

I then downloaded your Beta version of SharpCap and created a quick (and stupid) sequence, saved it as a SCS file and had a quick look at it with NotePad, edited a couple of variables, saved it back and then reloaded it, no issues at all and the updated version had the new variables set.

So I can see a deamon (or Windows Service) watching for files to be saved in a directory from Skytools 4, which runs a Perl script (yep, I'm that old I was one of the beta testers for it), a simple program to take the ACP file in, and spits out an SCS file into another directory with all the timings for cameras as well as moving the mount. Indeed this looks dead simple to be honest. I can see that you even have a repeat control block. The simple addition of the conditional and you are Turing complete :)

My Windows dev skills are a little less useful than my open heart surgery skills, so a quick search around StackOverflow finds

https://stackoverflow.com/questions/237 ... p-creation

Not everything will transfer from ST4, but it doesn't look impossible, even control structures might be possible by unrolling them out, e.g. execute them in Perl so that they are expanded.

Thoughts and views?

Rob
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap integrate with any planning tools?

#5

Post by admin »

Hi Rob,

that all sounds eminently sensible (and do-able). The only thing that gives me the shivers is the use of perl!

One thing to watch out for is that watching for changed/new files is full of horrible edge cases that you need to be aware of - things like

'I've just been notified of a new file and I opened it but it was empty (you opened it before the application wrote to it)'
'I've just been notified of a new file and I can't open it (the application is still writing to it)'
'I've just been notified of a new file but it's gone (the application wrote to a temp file and renamed it)'.

It's probably almost easier to just scan the directory every 5-10 seconds rather than try to listen for notifications. Then once you spot a new file wait a few seconds before trying to process it just in case.

cheers,

Robin
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Re: Does Sharpcap integrate with any planning tools?

#6

Post by rwillett »

Robin,

I''m aware of the edge cases for watching folders, unless the write application is setup to write to a temp file and then move it in an atomic action, it's normally best to catch the first creation and then wait a few seconds and keep checking to see if the file has changed. I can't recall if Windows has a close file event that can be triggered, but I'll have a look. As you say, it's pretty simple to workaround these issues.

Now all I have to do is swallow hard and buy Skytools 4 Imaging edition (gulp). I will have a quick poke around for some sample ACP files first, and see if I can convert them to your sequencing format "just-in-case", however all of that will have to wait as it's a clear evening in North Yorkshire, so glass of wine and some imaging.

Perl is pretty easy BTW, it rips through text files like a chainsaw, and what can possibly go wrong with using a chainsaw....

Rob
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap integrate with any planning tools?

#7

Post by admin »

rwillett wrote: Thu Apr 15, 2021 7:03 pm
Perl is pretty easy BTW, it rips through text files like a chainsaw, and what can possibly go wrong with using a chainsaw....
Cut off both feet in one go maybe :D

I have one perl script I wrote that runs on my Linux server and monitors my energy monitors and PV panel output. If I did it again now I'd do it with Python, just for the increased readability of the code.

cheers,

Robin
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Re: Does Sharpcap integrate with any planning tools?

#8

Post by rwillett »

Robin,

I've been comparing the ACP file description against your sequencing code.

The ACP format is a declarative type language, yours is more imperative or directive. Neither are better or worse than each other, though I tend to favour your style. Declarative languages hide a lot and the semantics can be 'tricky' to understand unelss formally declared.

So ACP says things like

#Filter Red,Clear,Green,Blue
#Binning 2,1,2,2
#Count 5,8,5,10
#Interval 180,240,180,180
M 51 <-- I assume this means that it moves and then tracks M51.

which translates to

Move to M51
set the filter to red
set binning to 2
do five frames of 180 secs
set the filter to clear
set binning to 1
do eight frames of 240 secs
set the filter to green
set binning to 2
do 5 frames of 180 secs
set the filter to blue
set binning to 2
do 10 frames of 180 secs

I suspect that the vast majority of ACP scripts have a very simple basis such as above and most people (and most programs) don't tend to use the more complex options in ACPsuch as repeats. It's not an issue to read the ACP declarative files in, load up the various counters declared in ACP (red, green, durations, binning etc) and unroll them to work with your sequencer. The issues with declarative programming is that it needs to state things like Move to M51 AND THEN KEEP TRACKING. Ahhhhh! People make too many assumptions.

I'm not sure about some of the stuff such as dithering as I don't understand that.

It does actually have a #chain command, which immediately tells me that the person who designed ACP is probably about my age. I thought I'd seen the last of chaining programs decades ago when we had to fit code in 64KB (sic).

I did notice your sequencer allows some sort of subroutine declaration which is nice as well. That will come in useful.

Is there a list of your commands or do I just keep looking through the Beta version of Sharpcap? Also is there any limit on the length of your scripts.

I've now managed to get WSL2 and Emacs on my Windows laptop, so I have a decent dev environment, Windows is still about 30 years behind Unix for development purposes IMHO. This will be a low priority piece of work as I have real paid work to do, so will let it bubble in the background. The cat decided to drop a clock on my partners Macbook, this means I gave my personal macbook to her and ended up with a Windows laptop for my use.

Rob
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap integrate with any planning tools?

#9

Post by admin »

Hi Rob,

the documentation doesn't exist yet for the steps available in the sequencer (and anyway, I'm still adding new ones fairly regularly). However all the steps do show up in the left hand panel of the sequence editor and there is a search box just above the list of available steps to help narrow down quickly to what you are looking for. Once you add a step to the sequence, the 'listing' box bottom left will show the code pattern for the step.

You can define/call subroutines (no parameters though) and also import other sequence files if you want like #include. I am still trying to avoid variables, parameters and if statements - that would make the language 'complete', but would also mean problems trying to estimate how long the sequence would take to run, which is a key feature. Even now, the code gives up trying to estimate if you put something like 'wait for dusk' in a loop.

While I have no problem with emacs, etc (used to use it years back when I wrote scientific Fortran for a living), things have moved on. Have a look at 'Visual Studio Code' - made by Microsoft, but free/open source/cross platform with thousands of useful addins. Turns out it is now the editor of choice for many people who write code day-to-day on Linux - all the web developers where I used to work used it...

cheers,

Robin
rwillett
Posts: 9
Joined: Wed Apr 14, 2021 6:56 am

Re: Does Sharpcap integrate with any planning tools?

#10

Post by rwillett »

I hadn't realised that you wanted the code to work in a certain time, adding in other stuff can affect this. Makes sense though.

There are ways round this but then you end up in real time scheduling and sometimes the easy option of avoiding certain programming constructs is the best way.

I have VSS, indeed installed it earlier today on a laptop for doing some Arduino work, I know Emacs though, its a great OS with a pretty good editor built in, my fingers know the command sequences without my brain getting involved, so I keep on using it.VSS is OK, but I do an awful lot of work on the command line and most of the time, there is nothing graphical to use, hence Emacs is the norm and then vi and then cat :)

Rob
Post Reply