Monday, 31 August 2020

Release of AstroDMx Capture for Linux version 0.78.3

Release of version 0.78.3 of AstroDMx Capture for X64 Linux, and Linux for 32 & 64 bit ARM architecture on the Raspberry Pi 4B.

The Linux versions of AstroDMx Capture are being released first, to be followed quickly by versions for MacOS, Windows and FreeBSD.

The software can be downloaded from https://www.linux-astro-imaging.uk/

New features and new cameras are included in this version of AstroDMx Capture, and a new Logo represents the platforms on which the software now runs.


This version seems to have been quite a log time coming. However, Nicola has been working flat out on the programming, and the project has now grown to greater than 50 KLOCS (Thousands of lines of source code, not including internal documentation and camera SDKs). Moreover this release has involved significant code refactoring in order to bring the other operating systems on board. The lines of internal documentation exceed 11,000 lines of comments.

To put this in an understandable and realistic perspective: If a book had 50 lines per page, then to contain all of the lines of source code in AstroDMx Capture would require a minimum of two, 500 page volumes. This is a minimum because many lines of code actually require more than one physical line to contain them, as they can be quite long lines. In reality, the books would be much larger than this because they would also have to contain all of the internal documentation that allows the developer to understand the workings of the code when it is revisited for maintenance purposes or modification in the future. If we include the lines of internal documentation, an additional volume of about 240 pages would be required.

The process doesn’t end with writing the code. Next, the code has to be compiled and linked. In order to do this the compilers and cross compilers have themselves to be compiled so that they are optimised for the platforms and processors. The initial compiling is done in debug mode and only when it looks as though everything works, is the project compiled in release mode. However, before a release can be made, extensive bench-testing has to take place in release mode to make sure that all of the supported cameras and all of the features work as intended. This is an iterative process leading to a final release of the software.

The aim has been to build a single code base to facilitate development and management across the operating system platforms. The software for Linux, Windows, MacOS and FreeBSD all look similar and are operated in the same way. The FreeBSD version is limited to the DMK, DFK and DBK cameras, UVC cameras and Tethered Canon and Nikon DSLRs. The reason for this is simple lack of SDK support by the camera manufacturers. We considered it particularly worthwhile to include FreeBSD because we were able to support DSLR tethering, so FreeBSD can use supported Canon and Nikon DSLRs for capture with full computer control over the camera. Incidentally, DSLR tethering should also work with other manufacturer supported tethering, but we have been unable to test other makes of camera.

New cameras supported

1) SVBONY SV305 Pro

2) QHY 5III178C

3) QHY 5III178M

New Features

1)  Nicola has implemented Live view for supported DSLR cameras. The resolution of the live view is specific to and determined by the camera. This is a useful function to aid focusing on bright objects such as the Moon.

2)  This version of AstroDMx Capture brings online the latest SVBONY SV305 Pro camera, which is much like the original SV305, but also has a guide port. It has a larger metal body, so it is likely that it will be more efficient at dissipating camera heat, particularly important for long exposures. It works on all tested X64 Linux distributions as well as 32 bit Raspberry Pi OS and 64 bit Rasbian. The original SVBONY SV305 camera doesn’t work on the 32 bit Raspberry Pi OS. However, it works fine in 32 bit Ubuntu MATE on the Raspberry Pi as well as on the 64 bit version of MATE and 64 bit Rasbian.

3)  High quality, uncompressed Tiff snapshot capture has been included in this version of AstroDMx Capture. This is of particular use for scientific imaging such as microscopy that may not be using movie files (SER or AVI) for subsequent stacking.

4)  Motion detection triggered capture of all supported files has been incorporated into AstroDMx Capture. This feature is particularly useful for the monitoring of nesting box cameras or for cameras monitoring wildlife, or for any other situation where motion detection is required.

5)  Software image controls now have Gain implemented in addition to Gamma, Brightness and Contrast. By default, the software controls are non-destructive, in that they do not affect the saved data. In this version, there is the option to apply the software controls to the saved data for 8 bit data. This is useful if the camera has few or no built in controls.

6)  New reticles have been added: An edge indicator, a rule of thirds grid and a simple, diagonal cross hairs reticle.

Raspberry Pi implementations

32 bit Ubuntu MATE


32 bit Raspberry Pi OS


In both of these cases, note that AstroDMx Capture is shown on the desktop in Ubuntu MATE (It is also in the menus); and also in the menus for Raspberry Pi OS.

Imaging of the 89% waxing, Moon with the SVBONY SV305 Pro camera, a Skymax 127 Maksutov and AstroDMx Capture for the Raspberry Pi running in 32 bit Ubuntu MATE.

Screenshot of AstroDMx Capture for Raspberry Pi capturing a SER file of the Palus Somni using an SVBONY SV305Pro camera

Resulting image after stacking, wavelet processing and post-processing

Screenshot of AstroDMx Capture for Raspberry Pi capturing a SER file of the Tycho region using  an SVBONY SV305 Pro camera

Resulting image after Stacking, wavelet processing and post-processing

A taste of things to come

Nicola is working to release AstroDMx Capture for FreeBSD, MacOS and Windows as mentioned at the start of this article. Below are some results from AstroDMx Capture for Windows.

Screenshot of AstroDMx Capture for Windows streaming data from the SVBONY SV305 Pro of a Cyanobacterium Nostoc under a transmission microscope.

Snapshot of the field of view showing the filaments of Nostoc cells

Maintenance release will be made if bugs are discovered.

Watch this blog for further information about AstroDMx Capture.

Saturday, 15 August 2020

The SV305Pro camera with AstroDMx Capture for Windows and 32 bit Raspberry Pi

 In the absence of any clear skies for the testing of AstroDMx Capture developments, the next best thing is to do the testing using a microscope instead of a telescope. Scientific imaging ranges from the very small to the very large and distant. Using a research-grade trinocular microscope enables the camera, in this case the SV305Pro to be attached to the camera port of the microscope and used as a scientific imaging system. 

The tests done here were using a Raspberry Pi 4B fitted with heat-sinks and a cooling fan, all within an open-sided acrylic case.

The Pi that we routinely use has an attached USB 3.0 SSD drive onto which results are written.

Click on an image to get a closer view.

Screenshot of AstroDMx Capture for the Raspberry Pi running on 32 bit Rasbian

The filamentous alga Spirogira was imaged.

Snapshot of part of a Spirogyra filament


Snapshot of another filament at lower magnification


A SER movie file was captured showing the presence of some small, active Copepods close to the algal filaments

The short exposure experiments are now complete and demonstrate that the SV305Pro camera functions well with AstroDMx Capture for the Raspberry Pi in both 64 bit and 32 bit Rasbian, the official operating system of the Raspberry Pi.

It is important to remember at this stage that the tests so far have been with 8 bit short exposures. What is now required is to do 16 bit long exposure experiments to test the performance of the camera in this mode. There will be no release of the software until the camera works in all modes, and we are satisfied that the SDKs work correctly.

Stop press! The long exposure problems with the SDK seem to have been fixed so a release of the 32 bit version will be made soon, supporting the SV305 Pro, but it looks unlikely at this stage, that the 32 bit version will support the original SV305. When these problems are sorted out, a maintenance release will be made to support the original SV305 in 32 bit Rasbian.

AstroDMx Capture for Windows, macOS or Linux (Including Raspberry Pi) can be downloaded freely here:

https://www.astrodmx-capture.org.uk

Friday, 14 August 2020

The SV305Pro camera with AstroDMx Capture for Windows and 64 bit Raspberry Pi

 AstroDMx Capture is being developed as a single code-base for multiple operating systems. It is a huge project that now exceeds 50 KLOCs (a KLOC is a thousand lines of Source Code) and this does not include the many thousands of lines of internal documentation within the code. 

This might all seem to some observers like the never-ending story. In a sense, it is, because AstroDMx Capture will continue to be maintained and increased in capability. The bulk of the compiling is done on a Fedora Linux machine using cross-compilers where required and only compiling in a native environment for MacOS or Windows when necessary.

The incorporation of the Windows operating system into AstroDMx Capture is what has taken quite a lot of time. This is because Windows is not a POSIX compliant operating system, and so does things frequently, in a fundamentally different way to the POSIX compliant UNIX and UNIX-like operating systems such as Linux, MacOS and FreeBSD. 

This is all quite ironic. To explain what I mean, I will give a short excerpt from a book that Nicola and I are writing, and will be publishing when we get time. 

'In the early 1980’s there were three branches of UNIX development: Firstly, UNIX system III from the Bell laboratories UNIX Support Group. Secondly, Berkeley Software Distribution (BSD®) from the University of California at Berkeley.  The third branch of UNIX development was Microsoft’s XENIX®, a version of UNIX that ran on the X86 family of processors’ and licensed from AT&T Corporation. In fact, in the early 80s, XENIX had the largest installation base of any UNIX system. UNIX fragmentation produced compatibility problems between UNIX versions which gave rise to the formulation of the POSIX® standard (Portable Operating System Interface for UNIX), which was an attempt to standardise the system-call interface in order to maintain compatibility between operating systems.

Even Microsoft with Windows NT had a go at being POSIX compliant. This because they wanted to win an Air Force contract. The Federal Information Processing Standard required that some types of government software purchases had to be POSIX compliant. Microsoft incorporated the Microsoft POSIX subsystem into the first versions of Windows NT. However, the Windows NT POSIX subsystem did not incorporate a POSIX shell or any UNIX commands. However, the system was sufficiently POSIX compliant to win the contract. They continued with incorporating SUA; a Subsystem for UNIX-based Applications. This was finally removed in Windows 8.1. It is important to understand that being UNIX does not depend on, for example, having a certain kernel; it depends on meeting a number of criteria, mainly POSIX compliance, to conform to the Single UNIX Specification. If Microsoft had gone all of the way in making Windows POSIX compliant, Windows too could have been classified as UNIX. This was obviously not what Microsoft wanted,' which is a huge shame!

The irony goes even further because having removed their Subsystem for Unix-base applications (SUA) in Windows 8, Microsoft have now implemented in Windows 10, WSL (Windows subsystem for Linux) that allows Linux applications to run in a sort of Wine in reverse compatibility layer. WSL2 on the other hand, actually incorporates a Linux kernel in a Virtual environment, yes a Linux kernel sitting alongside the Windows kernel!, so Linux applications can run on a Linux kernel without the requirement for a Wine-like compatibility layer. However, this seems to me to be half-hearted and certain ports and functions cannot be passed through to the WSL2. Microsoft have done this because their Azure cloud systems essentially run on Linux machines and they want a command-line Linux to be available to developers from within Windows.

Nicola has virtually completed the implementation of AstroDMx Capture in Windows, but it  has been nowhere as straightforward as working within the constraints and confines of regular Windows frameworks, whilst protecting against the future effects of systems that have bee deprecated by Microsoft, such a Direct Show.

Testing AstroDMx Capture for Windows with the SV305Pro camera

Click on an image to get a closer view

The SV305Pro is the most recent member of the SVBONY family of cameras.

From left to right are the SV105, SV205, SV305 and the SV305Pro.

Note the blanking plug that we have inserted into the guiding port of the SV305Pro to prevent accidental attempts to insert the camera data cable into the guiding port.

The SV305Pro camera was attached to the camera port of a research-grade trinocular microscope.

AstroDMx Capture for Windows was used to capture data on Nematode micro-worms from the SV305Pro camera on the microscope.

Screenshot of AstroDMx Capture for Windows streaming data from the SV305Pro


A SER file was captured of the nematodes


Snapshot of some nematodes captured by AstroDMx Capture for Windows

The camera worked almost flawlessly with AstroDMx Capture for Windows and good results were obtained. There are however, still some issues that may be SDK related, and further testing will be required to resolve them.



Testing AstroDMx Capture for 64 bit Rasbian on a Raspberry Pi 4B with the SV305Pro camera

Click on an image to get a closer view.

The RaspBerry Pi workstation with two monitors and the Trinocular microscope with the SV305Pro camera

Screenshot of AstroDMx Capture on the main monitor

Screenshot extending across both monitors with the capture windows dragged onto the right hand monitor.

A SER file was captured of the moving nematodes

Snapshot of nematode worms captured as a high quality tiff

The Raspberry Pi has a 64 bit SOC and it is perhaps surprising that only recently a 64 bit version of Rasbian, the official operating system of the Raspberry Pi computer has been available. This test demonstrates that on the 64 bit Rasbian OS the SV305Pro worked well.

If tests on the 32 bit version of Rasbian go well, the Linux and Pi versions of AstroDMx Capture will be released ahead of the MacOS and Windows versions. Before this can happen, Nicola has to complete the implementation of Atik cameras with the new SDK and sort out some last minute bugs introduced during the code refactoring that has been done.

Stop press! The long exposure problems in the SDK seem to have been fixed, so a release will be very soon supporting the SV305 and the SV305 Pro in 64 Bit Rasbian.

AstroDMx Capture for Windows, macOS or Linux (Including Raspberry Pi) can be downloaded freely here: