1
0
Fork 0

Script to merge TLEs into git archive

main
Jeff Moe 2023-06-24 12:03:34 -06:00
parent bbb04608dd
commit 6e235010f4
2 changed files with 34 additions and 0 deletions

View File

@ -35,6 +35,7 @@ What the little scripts do:
* `spacecruft-dl-ids` --- Download list of IDs photographed and identified
in the Spacecruft archive.
* `spacecruft-ls-ids` --- Lists NORAD IDs in Spacecruft archive.
* `tle2git` --- Convert archive of historical TLEs into git repo.
Scripts that use `sattools`:

33
tle2git 100755
View File

@ -0,0 +1,33 @@
#!/bin/bash
GITDIR="/srv/seesat/tle/git"
TLEDIR="/srv/seesat/tle/classfd"
# Set up directory for git
mkdir -p $GITDIR
cd $GITDIR
git init
# Got to TLE directory and start processing
cd $TLEDIR
for TLEFILE in 20*_*_classfd.txt
do \
YEAR=`echo ${TLEFILE} | cut -c 1-4`
MONTH=`echo ${TLEFILE} | cut -c 5-6`
DAY=`echo ${TLEFILE} | cut -c 7-8`
HOUR=`echo ${TLEFILE} | cut -c 10-11`
MINUTE=`echo ${TLEFILE} | cut -c 12-13`
SECOND=`echo ${TLEFILE} | cut -c 14-15`
cp -p ${TLEFILE} ${GITDIR}/classfd.tle
cd ${GITDIR}
git add classfd.tle
TZ="Etc/UTC" git commit -m"classfd from ${YEAR}-${MONTH}-${DAY}" \
--date="${YEAR}${MONTH}${DAY}T${HOUR}:${MINUTE}:${SECOND}"
cd ${TLEDIR}
done