Skip to content

Instantly share code, notes, and snippets.

@c5e3
Last active December 6, 2016 23:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save c5e3/89fb90b0babe31026f24a574d9283ee7 to your computer and use it in GitHub Desktop.
Save c5e3/89fb90b0babe31026f24a574d9283ee7 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat $1 | grep '^IRA:' > $1_positions.csv
sed -i -e 's/^.\+sat:/sat:/' -e 's/\( RAI\:.\+\)\|\(sat:\)\|\(beam:\)\|\(pos=(\)\|\()\)\|\(alt=\)\|\(+\)//g' -e 's%/%;%' -e 's/ /;/g' -e '/^00;00/d' -e 's/$/000/g' -e '/[0-9]\+;[0-9]\+;\([0-9]\+\|-[0-9]\+\).[0-9]\+;\([0-9]\+\|-[0-9]\+\).[0-9]\+;[0-9]\+/!d' $1_positions.csv
awk -F ';' '($5<=100000){print}' $1_positions.csv > $1_positions_spotbeams.csv
awk -F ';' '($5>100000){print}' $1_positions.csv > $1_positions_satellites.csv
sed -i '1 i\satellite;beam;latitude;longitude;altitude' $1_positions*.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment