I have created a divelog page that I distribute to my students. It is based on my experience and it is meant to contain all the important information that an Open Water/Advanced diver should include while describing their dives. I am releasing it as open source, it is saved in svg format, which you can edit with Inkscape.

I prepared it in two versions: the standard “Divelog” format (188x118mm) and the standard “Personal Organizer” format (170x95mm). If you prepare other formats and you would like to see them on this page, or if you make any improvement that you would like to share, feel free to contact me..

Below, you can see the previews of the divelog pages, with links to the svg files and links to pdf files that can be printed on A4 paper double-sided (long edge binding) to have nice double-sided pages ready to be put into your divelog!

Divelog format

Organizer format

Diving cruise in the Maldives 2021

The Maldives offer amazing biodiversity, with large fishes (sharks and mantas) as well as reef life. These pictures are from a week-long cruise with Emperor Maldives. Great experience and great company!

These photos are Copyright by Francesco Santini 2021 and released under a CC-BY-ND license. This means that you can freely use and distribute them, even for commercial purposes, but you must cite the author and cannot modify them. Please contact me for other uses.

Advanced Input Dialog for Python with PyQt5

I recently implemented a swift generic input dialog for PyQt5 which extends the functionality of QInputDialog. It supports multiple inputs in the same window, with text, numeric, boolean, and option inputs.

Its usage is simple and intuitive as demonstrated by the following code snippet:

import sys
from PyQt5.QtWidgets import QApplication
import GenericInputDialog

app = QApplication(sys.argv)

accepted, values = GenericInputDialog.show_dialog("Test",
    [GenericInputDialog.TextLineInput('Text input'),
     GenericInputDialog.IntSpinInput('My Int', 10, -100, 100),
     GenericInputDialog.FloatSpinInput('My Float'),
     GenericInputDialog.IntSliderInput('My slider'),
     GenericInputDialog.BooleanInput('Bool value'),
     GenericInputDialog.OptionInput('My string options', [
                                        'option 1',
                                        'option 2',
                                        'option 3'
                                        ], 'option 3'),
     GenericInputDialog.OptionInput('My int options', [
                                        ('option 1', 1.1),
                                        ('option 2', 2.2),
                                        ('option 3', 3.3)
                                        ], 2.2)
# Note: for option inputs, the value list can be a list
# of strings, and then the output is the string itself, or a
# list of tuples, where the first element is a string (the label) 
# and the second is the returned value (any).
# The default value for options can be the label string, the
# default returned value, or an integer index.

# returned values can be accessed by key or by position
print(values['My Int'])

# they can be iterated like a list
for v in values:

Which produces the following:

The code is in the public domain and is available at https://gist.github.com/fsantini/13bca4e5f57af1f5df66a3006ac441a9

Diving in Liguria 2020

Diving in Liguria (Portofino Natural Park) with Massub diving. August 2020.

DIY Hand Sanitizer Calculator

The World Health Organization published a guide on how to produce an effective hand sanitizer when a commercial one is not available. While they discourage home production, with the COVID-19 pandemics in action, finding hand sanitizer has become challenging everywhere in the world.

I’ve made a google sheet for the calculation of the quantities needed for home production using the WHO recipe. You will need:

Leggi tutto “DIY Hand Sanitizer Calculator”

SimpleElastix precompiled Python modules

I have produced a number of precompiled SimpleElastix Python modules. As it is a pain to recompile it every time, I publish them here in case someone finds it useful. Let me know at francesco.santini@gmail.com if you need more.

Use easy_install to install the .egg files and pip to install the .whl files.

Newer modules are on PyPI maintained by myself! Install them with

pip install SimpleITK-SimpleElastix

All the modules are compiled for the x86_64 architecture.