SNOUG/src/Software.tex

284 lines
7.8 KiB
TeX

%
% Software.tex
%
% SatNOGS Optical Unofficial Guide
%
% Copyright (C) 2022, Jeff Moe
%
% This document is licensed under the Creative Commons Attribution 4.0
% International Public License (CC BY-SA 4.0) by Jeff Moe.
%
\section{Software Overview}
See \ref{fig:operation}, page \pageref{fig:operation}
for a diagram with an overview of the software process.
\begin{center}
\begin{figure}[h!]
% XXX diagram is too large for frame
% \begin{framed}
\smartdiagramset{border color=none,
uniform color list=jebba-light-blue!60 for 4 items,
module x sep=3.75,
back arrow distance=0.75,
}
\smartdiagram[flow diagram:horizontal]{Acquire, Process, Analyze, Upload}
\caption{SatNOGS Optical Operation Pipeline}
\label{fig:operation}
\index{operation}
% \end{framed}
\end{figure}
\end{center}
\section{Setup Optical Ground Station Software}
\label{sec:software-setup}
\index{software}
HOWTO set up and configure a \gls{SatNOGS-Optical} \gls{ground-station}.
Setup an embedded computer, such as an Odroid N2, with \gls{Debian} stable
(11/Bullseye) or testing (Bookworm).
\index{computer}\index{Odroid}\index{Debian}
See each repository for latest documentation.
Install dependencies from \gls{Debian} repository:
\begin{minted}{sh}
sudo apt update
sudo apt install python3-virtualenv python3-pip python3-dev \
source-extractor astrometry.net \
libeigen3-dev giza-dev libx11-dev \
astrometry-data-tycho2 astrometry-data-tycho2-07 \
astrometry-data-tycho2-08 astrometry-data-tycho2-09 \
astrometry-data-tycho2-10-19
\end{minted}
Next, install the \texttt{\gls{hough3d-code}} dependency.
\index{hough3d}
\begin{minted}{sh}
git clone https://gitlab.com/pierros/hough3d-code
cd hough3d-code
make all
sudo cp -p hough3dlines /usr/local/bin/hough3dlines
\end{minted}
Install \texttt{\gls{satpredict}} from using either the cbassa or spacecruft repo.
\index{satpredict}
\begin{minted}{sh}
cd ../
git clone https://spacecruft.org/spacecruft/satpredict
# Or
#git clone https://github.com/cbassa/satpredict
cd satpredict/
make
sudo make install
\end{minted}
Now install \texttt{stvid}, the main acquisition and processing
application. It is written in \gls{Python}. Either use the spacecruft
\texttt{git} repository or the cbassa one.
\index{stvid}
\begin{minted}{sh}
cd ../
git clone https://spacecruft.org/spacecruft/stvid
# Or use upstream:
#git clone https://github.com/cbassa/stvid
\end{minted}
Optionally, set up a \gls{Python} virtual environment:
\index{Python}
\begin{minted}{sh}
cd stvid
virtualenv -p python3 env
source env/bin/activate
pip install --upgrade pip
\end{minted}
Install dependencies. Numpy needs to be installed first, or the
install fails.
\begin{minted}{sh}
pip install --upgrade numpy
pip install --upgrade -r requirements.txt
\end{minted}
\index{numpy}
If the system \texttt{python3-numpy} conflicts, you could try installing
numpy in the virtualenv thusly:
\begin{minted}{sh}
pip install --upgrade --ignore-installed numpy
\end{minted}
\gls{Debian} in bug \texttt{\#941466} changed the name of the
\texttt{sextractor} dependency to \texttt{source-extractor},
so a symlink is needed for now:
\index{Debian}
\begin{minted}{sh}
sudo ln -s /usr/bin/source-extractor /usr/local/bin/sextractor
\end{minted}
\section{Configure}
Configure the embedded computer.
\begin{minted}{sh}
cd stvid/
cp -p configuration.ini-dist configuration.ini
# Edit
# Note for fields st-username and st-password, *don't* use quotes.
# Set:
vi configuration.ini
\end{minted}
\index{stvid}\index{configuration.ini}
Edit various \texttt{configuration.ini} fields:
\begin{minted}{sh}
# For example:
observer_cospar = 9999 # COSPAR number of observer's site
observer_name = Jeff Moe # Name of observer
observer_lat = 40.568912 # Latitude of location in decimal degrees
observer_lon = -105.225852 # Longitude of location in decimal degrees
observer_height = 1860 # Elevation of location in meters
observations_path = ./data/obs # Path for raw acquisitions
tle_path = ./data/tle # Path where TLEs are stored (and updated)
results_path = ./data/results # Path for results of processed obs
st-username = foo
st-password = bar
# Path to source-extractor
sex_config = /usr/share/source-extractor/default.sex
\end{minted}
Store downloads here:
\begin{minted}{sh}
mkdir -p ./data/obs ./data/tle ./data/results
\end{minted}
The \texttt{ST\_DATADIR} variable is still used, from \texttt{sattools}.
Maybe set all these in \texttt{\~/.bashrc} (suit to fit directory setup):
\begin{minted}{sh}
export ST_DATADIR=$HOME/sattools
export ST_TLEDIR=$HOME/TLE
export ST_OBSDIR=$HOME/satobs
export ST_LOGIN="identity=foo@no:pass"
\end{minted}
\index{sattools}
Set \texttt{astrometry.net} to run in parallel, assuming you have enough RAM:
(This doesn't appear to work? Breaks?).
\index{astrometry}
\begin{minted}{sh}
sudo vim /etc/astrometry.cfg
# Uncomment:
inparallel
\end{minted}
\section{skymap}
Use \gls{skymap} for viewing \gls{satellite} \glspl{orbit} tracks
projected on a map of of the sky. Skymap is part of \gls{sattools}.
\Gls{skymap} isn't a required part of the toolchain, but it is useful
to see what \glspl{satellite} are visibile at a particular time and
location.
Source:
* \url{https://github.com/cbassa/sattools}
My fork:
* \url{https://spacecruft.org/spacecruft/sattools}
\begin{figure}[p!]
\begin{center}
\includegraphics[keepaspectratio=true,height=1.00\textheight,width=1.00\textwidth,angle=90]{skymap-giza-21.png}
\caption{\texttt{skymap} example screenshot.}
\index{skymap}\index{sattools}
\label{fig:skymap-giza-21}
\end{center}
\end{figure}
\fbox{
\parbox{\linewidth}{
\textcolor{red}{NOTICE:} \\
The main upstream sattools package requires non-\gls{libre} \texttt{pgplot} on host computer.
\index{proprietary}
}
}
Described below is how to build and install my fork of \gls{sattools} to use
\gls{skymap} instead of upstream. Upstream requires non-libre software which
also happens to be very difficult for most users to compile.
\begin{minted}{sh}
sudo apt install giza-dev git make dos2unix source-extractor wcslib-dev \
libgsl-dev gfortran libpng-dev libx11-dev libjpeg-dev libexif-dev
git clone https://spacecruft.org/spacecruft/sattools
cd sattools/
make
sudo make install
# To clean
make clean
# To rebuild
make clean
make
# To uninstall
sudo make uninstall
\end{minted}
See below for \gls{skymap} usage:
\begin{minted}{sh}
cd bin/
./tleupdate
# set config in ~/.bashrc XXX
./skymap --help
Usage: skymap [OPTION]
Visualize satellites on a map of the sky.
-t, --time Date/time (yyyy-mm-ddThh:mm:ss.sss) [default: now]
-c, --catalog TLE catalog file [default: satnogs.tle]
-i, --id Satellite ID (NORAD) [default: all]
-R, --ra R.A. [hh:mm:ss.sss]
-D, --decl Decl. [+dd:mm:ss.ss]
-A, --azimuth Azimuth (deg)
-E, --elevation Elevation (deg)
-w, --width Screen width (default: 1024). Set height too.
-g, --height Screen height (default: 768). Set width too.
-n, --nmax nmax line resolution/speed (default 128)
-S, --all-night All night
-Q, --no-stars No stars
-a, --all-objects Show all objects from catalog (default: LEO)
-h, --help This help
-s, --site Site (COSPAR)
-d, --iod IOD observations
-l, --length Trail length [default: 60s]
-P, --planar-id planar search satellite ID
-r, --planar-alt planar search altitude
-V, --visibility-alt altitude for visibility contours
-p, --positions-file File with xyz positions
-L, --longitude manual site longitude (deg)
-B, --latitude manual site latitude (deg)
-H, --elevation manual site elevation (m)
\end{minted}