Journey's End

Jul 04
2026

Siril Script to Calculate Total Sequence Exposure Time

When stacking sub-exposures of different durations while also disabling images based on FWHM and visual inspection the question of "what is the total exposure time" can be difficult to answer. The following python script should answer the question.

from collections import Counter

import sirilpy as s

siril = s.SirilInterface()
siril.connect()

seq = siril.get_seq()

print(f'Computing exposure time for sequence {seq.seqname}')
print(f'Sequence has {seq.number} images, {seq.selnum} selected/enabled')

exp_time_table = Counter()

for idx, imparam in enumerate(seq.imgparam):
    if not imparam.incl:
        continue

    header = siril.get_seq_frame_header(idx, return_as='dict')
    exp_time_table[header['EXPTIME']] += 1

total_exp_time_s = 0
for exp_time, count in exp_time_table.items():
    print(f'Exposure time: {count:4d} x {exp_time:4.0f} secs')
    total_exp_time_s += exp_time * count

total_exp_time_min = total_exp_time_s / 60
total_exp_time_hr = total_exp_time_s / 3600

print(f'Total exposure time: {total_exp_time_s:.0f} secs (={total_exp_time_min:.1f} mins '
      f'={total_exp_time_hr:.1f} hrs)')

Example output:

14:06:45: Computing exposure time for sequence r_ngc_6188_combined_
14:06:45: Sequence has 606 images, 566 selected/enabled
14:06:46: Exposure time:  293 x   60 secs
14:06:46: Exposure time:  248 x   30 secs
14:06:46: Exposure time:   25 x  120 secs
14:06:46: Total exposure time: 28020 secs (=467.0 mins =7.8 hrs)

Apr 20
2026

Datetime Display in Django

Suppose you have instruments in different timezones taking readings. You might have the following Django data model:

class Instrument(models.Model):
    timezone_utc_offset_hours = models.FloatField(...)
    ...

class Reading(models.Model):
    instrument = models.ForeignKey(Instrument, ...)
    timestamp = models.DateTimeField(auto_now_add=True)
    ...

Furthermore suppose settings.py contains the following:

...
USE_TZ = True
TIME_ZONE = "Europe/Paris"
...

It …

May 24
2025

Adventures in Compressed DNG

I have been working with industrial cameras and frame-grabbers that simply gives me a dump of their sensor data. To make that data useful it needs to undergo demosaicing, ideally using one of the modern demosaic algorithms like RCD rather than simple interpolation or the rather outdated VNG. Unfortunately the …

Apr 10
2025

Python One-liner for Local QR Code Decoding

Because KeepassXC lacks the ability to decode QR code for TOTP setup and not all MFA implementations show the required secret in text format, I use the following snipet to read the QR code information locally:

  python -c 'from cv2 import QRCodeDetector; from PIL.ImageGrab import grabclipboard; import numpy as …
ts=03:07 tags=[python,software,oss]

Aug 11
2024

PIO and Interrupts

Introduction

I want to be able to raise system level interrupts from PIO programs and there aren’t too many examples of this, so here is my simple contribution.

PIO program

First, the PIO program, which simply waits for a pin to change and then immediately raises PIO IRQ 0 …

Mar 28
2023

Unexpected Latency in Tinyproxy

I love tinyproxy, it is simple to setup and more than enough for my needs. Recently however I noticed that some clients were experiencing unexpected long delays when doing something as simple as curl google.com. After some sleuthing, I tracked it down to the fact I had

LogLevel Info …
ts=20:58 tags=[software,oss]

Mar 28
2023

Conda and Slow Proxies

The default conda connect timeout is 9.15 seconds (no idea why this is, seems to have been the case from day one). If the proxy is slow, e.g. it is in another country or AWS region, this timeout can be triggered and conda will prematurely close the connection …

ts=19:39 tags=[software,oss]

Jul 30
2022

TigerVNC and Systemd

A quick systemd service definition file for tigervnc on Ubuntu 20.04

[Unit]
Description=tigervnc

[Service]
Type=forking
ExecStart=/usr/bin/vncserver -localhost no -depth 24 -geometry 1920x1080 -noreset
User=steve

[Install]
WantedBy=multi-user.target

Key components:

  1. Type=forking so systemd correctly identifies the real VNC process, not the perl …
ts=01:51 tags=[software,linux,oss]

Jul 21
2022

Using SubShapeBinders and Assembly4

Assembly4 and SubShapeBinders make it possible to assemble Parts, then using their position in the assembly to generate new Parts. However because new Parts depend on Parts in the assembly, if you try to add them to the assembly FreeCAD 0.19 will complain about cyclic redundancy, which makes sense …

Jul 21
2022

Kopia: Handling Directories That No Longer Exist

Scenario

  1. There exists a policy that snapshots directory ABC 
  2. Directory ABC now no longer exists
  3. You want to keep existing snapshots
  4. You want to stop kopia from attempting to take any more snapshots

In order to achieve (4):

  1. Set the policy to manual only
  2. Disable inheritance from parent/global policy …

Mar 05
2022

Adventures with Astroberry/KStars/Ekos

In astrophotography the combination of a goto mount, a camera and plate-solving is a powerful one. It allows you to do all kind of neat things, like polar-alignment without having a clear view of the south, extremely accurate goto functionality, and automated capture of multiple predefined targets.

There are roughly …

May 07
2016

Apr 16
2016

Mar 23
2016

Mar 23
2016

Notes on Migrating a Linux Install

Some issues I ran into when trying to move a Linux install from a 500 GB drive to a smaller 120 G SSD:

  • When duplicating the filesystem, make sure that /proc exists, otherwise when you boot the new drive the kernel will complaint that /proc is missing and it can't …

Mar 23
2016

Thinkpad Mute Buttons and Xubuntu

I recently acquired a used Lenovo X220 for use as a linux laptop, and needed the following in my openbox configuration XML to make the hardware speaker and mic mute buttons work:

  <!-- Modified for X220 -->
  <keybind key="XF86AudioMute">
    <action name="Execute">
      <command>pactl set-sink-mute 0 toggle</command>
    </action>
  </keybind>
  <keybind …

Aug 26
2014

Oct 16
2012

Sep 14
2012

Notes On Running Calibre On A Server

Calibre is a great tool, especially for converting between ebook formats. Here are some notes for getting it to run on a headless server.

  • The binary installer off the website works fine — ignore warnings about completion and desktop integration failing.
  • The installer will always pollute /usr/bin regardless of the …
ts=09:50 tags=[software,oss,linux]

Aug 23
2012

Jumpcut is dead. Long live Jumpcut

I used to use Jumpcut a long time ago, and was a big fan of it. At some point, I think around 10.5, it stopped working, and I let it go -- too busy at the time to poke at it.

Recently however my interest in it was piqued again …

ts=07:57 tags=[software,osx,oss]
Next → Page 1 of 2