stvid/README.md

300 lines
6.3 KiB
Markdown
Raw Permalink Normal View History

2022-07-31 20:45:07 -06:00
# stvid
Fork/clone of cbassa's `stvid`.
2022-08-26 09:18:16 -06:00
![stvid processed image](img/2022-08-25T04:35:05.706_48587_catalog.png)
2023-04-08 13:25:52 -06:00
**NOTE: Unless you have a particular reason to use this, you should use
the main upstream repository.**
https://github.com/cbassa/stvid
2022-08-26 09:18:16 -06:00
2022-07-31 20:59:32 -06:00
# Installation
Debian. Install package dependencies:
```
2022-07-31 21:05:19 -06:00
sudo apt install python3-virtualenv python3-pip python3-dev \
2022-07-31 21:27:08 -06:00
source-extractor astrometry.net \
2022-08-07 14:53:04 -06:00
libeigen3-dev giza-dev libx11-dev
2022-07-31 20:59:32 -06:00
```
2022-07-31 22:23:13 -06:00
Perhaps need some of the `astrometry.net` data files:
```
sudo apt install \
astrometry-data-tycho2 astrometry-data-tycho2-07 \
astrometry-data-tycho2-08 astrometry-data-tycho2-09 \
astrometry-data-tycho2-10-19
```
2022-07-31 20:59:32 -06:00
```
git clone https://spacecruft.org/spacecruft/stvid
# Or use upstream:
git clone https://github.com/cbassa/stvid
```
Optionally, set up python virtual environment:
```
cd stvid
virtualenv -p python3 env
source env/bin/activate
pip install --upgrade pip
```
2022-08-07 14:16:33 -06:00
Install dependencies. Numpy needs to be installed first, or the
install fails.
2022-08-23 19:56:29 -06:00
2022-07-31 20:59:32 -06:00
```
pip install --upgrade numpy
pip install --upgrade -r requirements.txt
2022-07-31 20:59:32 -06:00
```
2022-08-23 19:56:29 -06:00
If the system `python3-numpy` conflicts, you could try installing
numpy in the virtualenv thusly:
```
pip install --upgrade --ignore-installed numpy
```
2022-07-31 21:14:34 -06:00
Debian in bug #941466 changed the name of the `sextractor` dependency to
`source-extractor`, so a symlink is needed for now:
```
sudo ln -s /usr/bin/source-extractor /usr/local/bin/sextractor
```
2022-07-31 21:27:08 -06:00
Install hough3d-code dependency:
```
2022-08-07 14:16:33 -06:00
cd ../
2022-07-31 21:27:08 -06:00
git clone https://gitlab.com/pierros/hough3d-code
cd hough3d-code
make all
sudo cp -p hough3dlines /usr/local/bin/hough3dlines
```
2022-08-22 13:48:03 -06:00
Install `satpredict`:
```
cd ../
git clone https://spacecruft.org/spacecruft/satpredict
# Or
#git clone https://github.com/cbassa/satpredict
cd satpredict/
make
sudo make install
```
2022-07-31 21:27:08 -06:00
# Configure
Thusly...
```
2022-08-07 14:16:33 -06:00
cd stvid/
2022-07-31 21:27:08 -06:00
cp -p configuration.ini-dist configuration.ini
# Edit
2022-07-31 21:54:24 -06:00
# Note for fields st-username and st-password, *don't* use quotes.
# Set:
2022-07-31 21:27:08 -06:00
vi configuration.ini
```
2022-07-31 21:14:34 -06:00
2022-07-31 21:54:24 -06:00
Edit various `configuration.ini` fields:
```
# 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
2022-07-31 22:23:13 -06:00
observations_path = ./data/obs # Path for raw acquisitions
tle_path = ./data/tle # Path where TLEs are stored (and updated)
2022-07-31 21:54:24 -06:00
results_path = ./data/results # Path for results of processed obs
st-username = foo
st-password = bar
# Path to source-extractor
2022-08-11 10:37:50 -06:00
sex_config = /usr/share/source-extractor/default.sex
2022-07-31 21:54:24 -06:00
```
Store downloads here:
```
2022-07-31 22:23:13 -06:00
mkdir -p ./data/obs ./data/tle ./data/results
2022-07-31 21:54:24 -06:00
```
2022-08-11 10:37:50 -06:00
The `ST_DATADIR` variable is still used, from `sattools`.
Maybe set all these in `~/.bashrc` (suit to fit directory setup):
```
export ST_DATADIR=$HOME/sattools
export ST_TLEDIR=$HOME/TLE
export ST_OBSDIR=$HOME/satobs
export ST_LOGIN="identity=foo@no:pass"
```
2022-07-31 22:35:49 -06:00
Set `astrometry.net` to run in parallel, assuming you have enough RAM:
(This doesn't appear to work? Breaks?).
```
sudo vim /etc/astrometry.cfg
# Uncomment:
inparallel
```
2022-07-31 21:54:24 -06:00
2022-08-07 15:07:52 -06:00
# Hardware
Setup with various hardware.
2022-08-11 10:49:53 -06:00
Specs:
2022-08-07 15:07:52 -06:00
2022-08-11 10:49:53 -06:00
* Sony IMX174 or similar.
* 50mm lens.
* f1.2 to f1.6 (faster the better).
* 10Hz image sampling.
* USB-3 (or ethernet?).
2022-08-07 15:07:52 -06:00
2022-08-11 10:49:53 -06:00
For permanent mounts, considerations:
2022-08-07 16:23:44 -06:00
2022-08-11 10:49:53 -06:00
* IP-66 or better.
* PoE?
* 12V.
* Raspberry Pi, Intel NUC, Traverse Ten64.
* Hardware shutter during sunlight (?).
2022-08-07 16:23:44 -06:00
2022-08-11 10:49:53 -06:00
Proprietary examples with IMX174:
2022-08-07 16:23:44 -06:00
2022-08-11 10:49:53 -06:00
* QHYCCD QHY174GPS.
* ZWO ASI174MM.
2022-08-07 15:07:52 -06:00
2022-08-07 16:23:44 -06:00
2022-08-22 13:24:10 -06:00
## The Imaging Source
The Imaging Source camera confirmed works well, such as this:
* https://www.theimagingsource.com/products/industrial-cameras/usb-3.0-monochrome/dmk33ux174/
See `README-TIS.md` for more info.
2022-08-11 10:49:53 -06:00
## Libre
Trying to find libre setup that can be used.
2022-08-11 10:53:11 -06:00
Solutions with `gphoto` or other non-video camera setups
should use `stphot` not `stvid`.
2022-08-11 10:49:53 -06:00
## Proprietary
The ASI ZWO and QHY cameras use a proprietary SDK.
There are no libre implementations found.
2022-08-07 15:07:52 -06:00
2022-08-07 16:23:44 -06:00
2022-08-07 15:07:52 -06:00
## Web Cam
Perhaps like this using a web cam and OpenCV
Set up udev:
```
echo 'SUBSYSTEM=="video1", GROUP="video", MODE="0660"' |
sudo tee /etc/udev/rules.d/10-webcam.rules
```
2022-08-07 17:49:00 -06:00
Testing with Logitech BRIO usb web cam. No udev configuration needed.
2022-08-11 10:49:53 -06:00
Camera runs with `stvid` but isn't sensitive enough to be used.
2022-08-07 17:49:00 -06:00
2022-07-31 20:59:32 -06:00
2022-08-07 15:10:32 -06:00
# Usage
Enter `virtualenv`, if used:
```
cd stvid/
source env/bin/activate
```
Get the latest TLEs:
```
./update_tle.py
```
2022-08-07 17:49:00 -06:00
Configure a position (example). XXX Best way to generate ?
```
echo \
'2022-08-07T23:44:14 R: 00:00:00.00 D: 00:00:00.0 H: -152.691 A: 180.000 E: 90.000 q: -28.18' |
> data/obs/control/position.txt
2022-08-11 10:37:50 -06:00
# Maybe
echo \
'2022-08-07T23:44:14 R: 00:00:00.00 D: 00:00:00.0 H: -152.691 A: 180.000 E: 90.000 q: -28.18' |
> $ST_DATADIR/data/position.txt
2022-08-07 17:49:00 -06:00
```
2022-08-07 15:10:32 -06:00
Acquire image, first download archives:
```
./acquire.py
```
2022-08-26 09:35:16 -06:00
![stvid acquired image](img/stvid-acquire.png)
*stvid acquired image, viewed with astroimagej.*
2022-08-23 19:24:09 -06:00
## Preview
This scriptlet isn't in upstream. It does a preview of the camera using the
standard configuration file. So you can get a preview similar to what it actually
looks like for focus, perhaps. Does not require X running, but it does
need `xinit` installed.
Also need to set `X11Forwarding yes` in `/etc/ssh/sshd_config`.
Then login to your host with `-XY` ala:
```
ssh -XY odroidn2
cd stvid
source env/bin/activate
./preview.py
```
2022-08-07 15:10:32 -06:00
2022-07-31 22:09:59 -06:00
# Fixed
2022-07-31 21:59:34 -06:00
When running `acquire.py` on `amd64` architecture it gives this error:
```
OSError: libbcm_host.so: cannot open shared object file: No such file or directory
```
The `libbcm_host.so` is a (non-libre?) firmware file that is part of Raspberry Pi.
https://github.com/raspberrypi/firmware/blob/master/opt/vc/lib/libbcm_host.so
2022-07-31 22:02:28 -06:00
That error comes from installing `picamerax` on `amd64`, which was added to
`requirements.txt`, but should really just be when on Raspberry Pi.
```
env/lib/python3.10/site-packages/picamerax/bcm_host.py:_lib = ct.CDLL('libbcm_host.so')
```
2022-07-31 22:09:59 -06:00
For now, just import the library that calls for that binary if the
Pi camera is used. No need to call it (and crash) if CV2 is used on non-Pi.
2022-07-31 21:59:34 -06:00
2022-07-31 20:45:07 -06:00
# Upstream
See `README-upstream.md`.
`stvid`:
* https://github.com/cbassa/stvid
2022-08-07 14:16:33 -06:00
© 2018-2022 Cees Bassa
2022-07-31 20:45:07 -06:00
# License
Same as upstream license, GPLv3.
2022-07-31 22:35:49 -06:00
© 2022, Jeff Moe