Jul 04
2026
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
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
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
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 …
Mar 28
2023
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
Mar 28
2023
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 …
Feb 04
2023
In order to install the arcgis package in conda, you have to specify the architecture osx-64 otherwise the package will not be found. This works because MacOS will capable of running x86_64 code on Apple Silicon processors - that is how efficient they are!
conda install -c esri/osx-64 arcgis
In …
Jan 10
2023
Backups are a great idea, and encrypted backups are a even better idea. When backing up iOS devices on macOS, it is possible to set an encryption key to protect local files. There is however no straightforward GUI method to verify the encryption key.
Enter mvt:
Dec 20
2022
Went on a journey trying to figure out what valid exif tag types are, in both JPEG and TIFF files. In summary:
| TYPE # |
Name |
Exif 2.32 |
Tiff 6.0 |
Adobe TN[1] |
| 1 |
BYTE |
X
|
X |
|
| 2 |
ASCII |
X |
X |
|
| 3 |
SHORT |
X |
X |
|
| 4 |
LONG
|
X |
X |
|
| 5 … |
Dec 20
2022
Due to unexpected power loss or disconnection of the underlying storage, the filesystem inside Veracrypt volumes is desired to prevent future data loss.
On macOS I tried using
diskutil verifyDisk /dev/diskXXX
This didn't work for some reason, most likely because of some interaction with veracrypt. Same results via Disk …
Jul 30
2022
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:
Type=forking so systemd correctly identifies the real VNC process, not the perl …
Jul 21
2022
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
Scenario
- There exists a policy that snapshots directory ABC
- Directory ABC now no longer exists
- You want to keep existing snapshots
- You want to stop kopia from attempting to take any more snapshots
In order to achieve (4):
- Set the policy to manual only
- Disable inheritance from parent/global policy …
Jan 02
2022
I have been using SpiderOak One since Edward Snowden recommended it in 2013, almost a decade ago. I have over 1.5T of deduplicated data spread across 6 or so devices. This year, in 2022, I will not be renewing my subscriptions.
The main issues:
- Lack of updates: the last …
May 07
2016
I needed to read Lecroy binary waveforms files recently, and the one python script I had found didn't read them properly due to improper handling of 16 bit samples.
I wrote an alternative lecroy.py that should be a drop-in replacement. It handles 16 bit waveforms and exports a LecroyBinaryWaveform …
Apr 16
2016
Arduino-Makefile needed coaxing to in order to compile code targeting the SparkFun Pro Micro 3.3V. A major source of headache is the requirement for BOARD_SUB which isn't documented and required diving into the source code, and also the fact the Pro Micro has 2 PIDs for each variant (5V …
Apr 12
2016
A common pitfall of trying to use message forwarding in Objective-C is forgetting to implement
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
in addition to
- (void)forwardInvocation:(NSInvocation *)anInvocation
Another problem is that sometimes calling objects will use
- (BOOL)respondsToSelector:(SEL)aSelector
to determine if your proxy object can respond to a particular …
Mar 23
2016
I recently started having trouble with Arduino 1.6.x not being able to program Arduino Micro or SparkFun Pro Micro, with avrdude complaining about permission denied when trying to open /dev/ACM0.
The usual solutions to this is to add oneself to the dialup group, or mess around in …
Mar 23
2016
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
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 …