Arndt Jenssen created a new topic ' Live Stacking with Jocular' in the forum. 3 weeks ago

Hello,
this is my first post here. I want to share my experiences with live stacking with stellarmate on a RPI4 with the community.

After some research I stumbled upon the great Jocular project from Martin Meredith (see links at the end) which fits the bill.

Jocular can use a camera directly, but I want to stay within the KStars eco system. It also has the notion of a watched directory which it can use instead of a camera. I wanted the subs captured from Ekos to stay in place, so I needed to find a way on how to automatically copy the subs from the Ekos capture folder to the Jocular watch directory.

The first route I took was looking at ekos post-capture scripts. Unfortunately they are called with no parameters (like the image path). Then I checked out indi_getprop command line tool and in the end at the pyindi-client which might have worked with blobs but that was getting too complicated for me. Then I checked out Linux tools that can watch changes in a directory and voila, fswatch is suitable for that. It detects new files coming into a directoy and then can issue a command to copy it to the watched folder of Jocular. Then Jocular picks it up and creates a live stack.

I’m running my gear with an RPI4, 8GB and settled on Stellarmate after trying out Astroberry and Astroarch. Currently running Kstars 3.6.9 on Stellarmate OS 1.8.1. To install Jocular and fswatch a bit of command line joggling is needed.

Install Jocular

# create python virtual environment
mkdir jocular_venv
python3 -m venv jocular_venv
. ./jocular_venv/bin/activate

# now we can install jocular
pip install jocular

# some packages need downgrading to make jocular work
pip install scikit-image==0.19.3
pip install Kivy==2.2.0
pip install kivymd==1.0.2

# create jocular data directory 
cd
mkdir joculardata

# startup jocular
jocular
# select joculardata directory on first startup

# if you boot rpi again you need to activate the venv before starting jocular
. ./jocular_venv/bin/activate
jocular

Configure Jocular


Save originals: disabled, because we are already copying the subs to the Jocular watch directory
Binning: You want at least 2x2 here, the higher, the less work Jocular has do do
Color space: when using an OSC select the appropiate color space for the pixel matrix. I use RGGB for my asi533mc.

Install fswatch
sudo su -
apt-get install fswatch
exit

fswatch usage
Use fswatch to copy image files from your capture directory to the jocular watch directory when they are created.
Open a new termin window or create another tab, then adjust the first path depending on your subs directory. A bash script fot that would make it more user friendly.
fswatch -l 5 -d --event=AttributeModified /home/stellarmate/Pictures/astro/test/Light | xargs -I{} cp {} /home/stellarmate/joculardata/watched

Because of the poor I/O of the sd-card I had to use the latency parameter and also watch for the AttributeModified event which occurs roughly at the end of the fits file creation process in Ekos. Your mileage may vary with these parameters.

Test results
Not yet tested in the field but with the Ekos simulators

Single sub


Stacked subs


Links:
Jocular
transpy.eu.pythonanywhere.com/jocular/#
stargazerslounge.com/topic/333372-jocula...era/#comment-3629697
github.com/MartinCooke/jocular

fswatch
emcrisostomo.github.io/fswatch/

Read More...