Move util scripts

This commit is contained in:
Tim Schubert 2020-08-13 21:51:39 +02:00
parent 2f94c15455
commit 0834c06e31
9 changed files with 6 additions and 2 deletions

30
utils/import-tle.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/sh
set -u
set -e
search=$1
# Get the ids of sats matching the search term
if [ ! -f ids.txt ]
then
curl https://celestrak.com/pub/satcat.txt | grep "$search" | cut -b14-18 > ids.txt
fi
# Download TLE data for each sat
while read id
do
if [ ! -f $id.txt ]
then
wget "https://celestrak.com/satcat/tle.php?CATNR=$id" -O $id.txt
fi
# 6000 s ~ 95 min ~ 1 orbital period
done < ids.txt
while read id
do
if [ ! -f $id.waypoints ]
then
./tle2wps.py $id.txt 2020 08 28 6000 > $id.waypoints
fi
done < ids.txt