C Polar Align
1. License
This software is under GPL, so it can be
used redistributed
and modified freely, while respecting the terms of the license, in
particular to retain the copyrights and that the sources (including
additions and or modifications) remain accessible.
The distribution includes CImg (https://cimg.eu/), Ephemeris
(https://github.com/MarScaper/ephemeris) and GetPot
(http://getpot.sourceforge.net/). The star detection algorithm is derived
from https://github.com/carsten0x51h/star_recognizer_code_snippets. Part
of the files are under "Copyright (C) 2015 Carsten Schmitt". The star
catalog is extracted from: VizieR Astronomical Server vizier.u-strasbg.fr.
2. Introduction
This software is an aid tool for the
alignment of an equatorial mount. From 2 images (it use JPEG) with a 90 degree rotation along the AD axis , the software computes the center
of rotation between the 2 images then draws on the images the position
of the stars of the field. After each adjustment, the software
displays the new image.
There is no astrometry, only a geometric algorithm to compute the
center of rotation. The focal length and the size of the pixels must
be accurately specified.
To use it, you need a sensor and a lens that can provide fairly
detailed photos over a fairly wide field around the pole.
A 24x36 digital camera with a 50mm to 300mm focal lens or an APS-C
with between 30mm and 200mm will be fine. A compact will also do
the trick as long as the lens is bright (at minimum zoom) and that we
can pose a few seconds. In all cases, it is essential that it is
possible to control the camera from the PC and in practice, that it is
supported by gphoto2 with "capture" and "download" features.
3. Installation
3.1 Linux
The software is written under Linux. Tested with ubuntu (16, 18 and 20),
gentoo free BSD and also with an old debian on an ARM board.
It depend on:
- libjpeg to compile,
- gphoto2 to execute.
Ubuntu compilation and installation process:
- get libjpeg:
ubuntu% sudo apt-get install libjpeg-dev
- get gphoto2
ubuntu% sudo apt-get install gphoto2
- get basic X11 libraries:
ubuntu% sudo apt-get install libx11-dev
- Get the sources which
includes "CImg" for images processing, "ephemeris" and 'getpot" to manage
options in files or command line:
% git clone
https://gitlab.utc.fr/crubille/polar_align.git
% cd polar_align/polar_align
% cd ephemeris ; make ; cd ..
% cd getpot-c++; make; cd ..
% cd c_polar_align
% make
% make install
If c++ is an old one, try the options commented in the current Makefile.
3.2 portability
3.2.1 Windows
CImg based software compile under Windows. So, it should be possible to port
it to windows. The point is to get a convenient tool to control the camera.
3.2.2 Android
It seems likely that CImg can be used with Android, since there are tools
to control camera but configuration should be integrated.
4. Configure the software
Options allow to adapt the behavior of the software
according to the context, to the camera model, or to users preferences.
These options are added at the command line or stored in files.
- "polar align" first tries to read the "config.cpa"
file in the user's "$HOME" directory and sets the options
- "polar_align" then reads the file given on the
command line after the "-file" or "-config" option and can modify
the parameters
- "polar_align" finally takes into account the options
provided on the command line which are therefore the final values.
options list:
- "-config filename" / "-file filename" to indicate an
option file (usable only on command line).
- "-demo -baseimg=i1.JPG -img=i2.JPG" launches a demo
mode, "i1.JPG" is the first image, then the software always uses the
same "i2.JPG"
- "-longitude 2." Longitude observation
location.
- "-focale 135" Lens focal and pixels size should be set
accurately.
- -pixelsize 4.24
- "-no_ac_motor" / "-ac_motor" If the right ascension
is not trained, the orientation of the sight is adapted
to each image .
- "-SouthPole" By default, the software considers the
pole is the north pole, use this option for the south pole.
- "-AstroLens" By default, the software considers a
photo lens in which the images are "right". This option is for
returned image
- "-fullscreen" / "-screen_width 800" allow to choose the screen
size.
- "-stars_to_print 8" Set the number of stars in
the field for which the software displays the image on the sight
- "-getphoto commande" allows you to change the
default command used to control the camera in order to acquire an
image. So, you can use another utility than gphoto2 or use gphoto2
with options well suited for your camera. See section <5.>
- "-jpgname AP" to choose the prefix of the images names
- "-font 24" Change the font size.
- "-fr" french version (support for other languages using ISO 8859
character set could be easily added).
5. Communication with the camera.
c_polar_align need
- control the camera to take a picture,
- download it,
- if the image is not in JPEG, convert it to JPEG and
give it the correct name,
-
read the image in JPEG format.
To do this, it executes a system command which can be an executable or a
script with its options. This procedure is tested under linux and with
gphoto2.
The default command is 'gphoto2 --force-overwrite
--capture-image-and-download --filename PA0.jpg' . Defaults for files name
are PA0.jpg, PA1.jpg ...
the "polar align" "-getphoto" option allow you to replace this command. The
provided command should
include all options, and if using gphoto2 end with a " ", so the software
just appends the filename at the end.
For example:
The camera should be set in
"RAW+JPEG" mode. The speed is from the camera (not BULB).
- -getphoto 'gphoto2 --set-config bulb=1 --wait-event=5s --set-config
bulb=0 --keep-raw --wait-event-and-download=3s --force-overwrite
--filename '
The camera should be set in
"RAW+JPEG" mode. The speed is set to "BULB" on the camera so the speed is
controlled by gphoto2. Here it is set to 5 seconds.
- -getphoto 'gphoto2-script '
allows
"polar_align" to run a script which takes as argument the name of the
photo to be let in the current directory.
6. Utilisation
Turn the mount between 30 and 90 degrees from horizontal:
Get the first image:
Reset the mount as horizontal as possible and get a second image.
Use "+", "-" from the numeric pad to compensate
for errors in the horizontality of the mount (or time or longitude)
so that each star can be set to its nominal
position by the same translation .
use the alt/az settings of the mount to perform this
translation
Click to zoom at 100%: