From c8e99f13c66b57e20d5f29286966610649699c86 Mon Sep 17 00:00:00 2001 From: lu7did Date: Fri, 23 Aug 2019 11:27:32 -0300 Subject: [PATCH] MinElParm --- planSatNOGS.sh | 49 ++++++++++++++++++++++++++++++++++++++ priorities_499.txt | 23 ++++++++++++++++++ priorities_499_test.txt | 19 +++++++++++++++ schedule_single_station.py | 22 ++++++++++++----- 4 files changed, 107 insertions(+), 6 deletions(-) create mode 100755 planSatNOGS.sh create mode 100644 priorities_499.txt create mode 100644 priorities_499_test.txt diff --git a/planSatNOGS.sh b/planSatNOGS.sh new file mode 100755 index 0000000..3ae4432 --- /dev/null +++ b/planSatNOGS.sh @@ -0,0 +1,49 @@ +#!/bin/sh +#*-------------------------------------------------------------------- +#* planSatNOGS.sh +#* +#* Script to load SatNOGS observations automatically +#* +#*-------------------------------------------------------------------- +ID=499 +TIME=24.0 +PRIORITY="priorities_$ID.txt" +TRANSMITTERS="/tmp/cache/transmitters_$ID.txt" +OPS=" -f -l INFO" +MODES="CW" +NORAD=" 20442 " +EXCLUIDO="43466 39430 43591" +AZMIN=" --azmin 335 " +AZMAX=" --azmax 25 " +ELMIN=" --elmin 20 " +echo "*********************" +echo "* Set priorities *" +echo "*********************" +rm -r $PRIORITY + +#*---- Include satellites by mode +for mode in $MODES; do + echo "Selecting priority for Mode($mode)" + awk '{if ($3>=80) print $0 }' $TRANSMITTERS | grep -e $mode | awk '{printf("%s 1.0 %s\n",$1,$2)}' | tee -a $PRIORITY +done + +#*---- Include satellites despite of the mode by NORAD Id +for norad in $NORAD; do + echo "Selecting priority for Satellite($NORAD)" + awk '{if ($3>=80) print $0 }' $TRANSMITTERS | grep -e $norad | awk '{printf("%s 1.0 %s\n",$1,$2)}' | tee -a $PRIORITY +done + +#*---- Remove unwanted satellites +for excl in $EXCLUIDO; do + echo "Excluding satellite $excl" + awk '!/$excl/' priorities_499.txt > temp && mv temp priorities_499.txt +done + +echo "$(date) planSatNOGS: $(cat $PRIORITY | wc -l) satellites prioritized" | logger -i -t "$ID" +echo "$(date) planSatNOGS: Parameters ID($ID) Time($TIME) Prio($PRIORITY) Az($AZMIN-$AZMAX) El($ELMIN) Ops($OPS)" + +echo "*********************" +echo "* Scheduling passes *" +echo "*********************" +python /home/pi/satnogs-auto-scheduler/schedule_single_station.py -s $ID -d $TIME -P $PRIORITY $AZMIN $AZMAX $ELMIN $OPS +exit 0 diff --git a/priorities_499.txt b/priorities_499.txt new file mode 100644 index 0000000..b1117a9 --- /dev/null +++ b/priorities_499.txt @@ -0,0 +1,23 @@ +27848 1.0 aBHGFxMopeCscUYRyiYdXC +42792 1.0 AoDzLwqzB8jt4sFQmmBxRo +41340 1.0 BRs3oJkUeAmQbLsJFaUuBP +41340 1.0 c2yGXJPJH5jXjQ3dcyhWXH +44329 1.0 fB7B6jkc7fUcMhYrP3xJU8 +41460 1.0 gEDKtJFX6d7kM6xUAM4MJ8 +42790 1.0 LVJfPNYASyQ3PUBvcpxLwn +33493 1.0 MLBshLfC6cFP4AsoaR2MWh +27844 1.0 mqQF9JxmD4KB6MqTVXqQBQ +33499 1.0 MquDcKUEW6mR3VP3M2vAdQ +44331 1.0 mwLCtnmHojERWGKTnMT6Kj +32791 1.0 N7SGiqMhkHpjfjeGh42wvX +43591 1.0 NwfFCEAaoAnX3DhjdzS4qg +44330 1.0 osebQczQC5X852ueXKBXjH +43466 1.0 qPdK6RfA6UPT8CWogypiz4 +42775 1.0 rAtiFkr9f4e7PnGAxcWxkF +33493 1.0 rmv9kRFrXDtQ8H7wucWwbm +32785 1.0 SqKWM4e6CfqZ9JryAZcJTf +39430 1.0 ULXxBCypZh4f2qPnJeg6WH +43677 1.0 w7P94GHjtdfjHnYG9RrkHJ +43937 1.0 w9atysxgD3MMHnX2Rv3svC +35935 1.0 WjSuDmnkX32dASG7NqajhU +20442 1.0 ZAKErADdWKpMiDjvKKhmmB diff --git a/priorities_499_test.txt b/priorities_499_test.txt new file mode 100644 index 0000000..8204743 --- /dev/null +++ b/priorities_499_test.txt @@ -0,0 +1,19 @@ +27848 1.0 aBHGFxMopeCscUYRyiYdXC +42792 1.0 AoDzLwqzB8jt4sFQmmBxRo +41340 1.0 BRs3oJkUeAmQbLsJFaUuBP +41340 1.0 c2yGXJPJH5jXjQ3dcyhWXH +41460 1.0 gEDKtJFX6d7kM6xUAM4MJ8 +42790 1.0 LVJfPNYASyQ3PUBvcpxLwn +33493 1.0 MLBshLfC6cFP4AsoaR2MWh +27844 1.0 mqQF9JxmD4KB6MqTVXqQBQ +33499 1.0 MquDcKUEW6mR3VP3M2vAdQ +32791 1.0 N7SGiqMhkHpjfjeGh42wvX +43591 1.0 NwfFCEAaoAnX3DhjdzS4qg +43466 1.0 qPdK6RfA6UPT8CWogypiz4 +42775 1.0 rAtiFkr9f4e7PnGAxcWxkF +33493 1.0 rmv9kRFrXDtQ8H7wucWwbm +32785 1.0 SqKWM4e6CfqZ9JryAZcJTf +43677 1.0 w7P94GHjtdfjHnYG9RrkHJ +43937 1.0 w9atysxgD3MMHnX2Rv3svC +35935 1.0 WjSuDmnkX32dASG7NqajhU +20442 1.0 ZAKErADdWKpMiDjvKKhmmB diff --git a/schedule_single_station.py b/schedule_single_station.py index bf0f7f6..b9bcb5f 100755 --- a/schedule_single_station.py +++ b/schedule_single_station.py @@ -120,6 +120,11 @@ def main(): #*------------------------------------------------------------------------------------------------- #* define two new arguments to specify Az (min,max) window #*------------------------------------------------------------------------------------------------- + parser.add_argument("-e", + "--elmin", + help="Minimum pass elevation admitted [degrees; ground station default=0,maximum: 90]", + type=float, + default=None) parser.add_argument("-a", "--azmin", help="Minimum Az window [degrees; ground station default=0,maximum: 359]", @@ -210,6 +215,11 @@ def main(): else: min_priority = args.min_priority + if (args.elmin >=0) and (args.elmin <=90): + elmin=args.elmin + else: + elmin=0 + if (args.azmin >= 0) and (args.azmin <= 360): azmin=args.azmin else: @@ -241,7 +251,7 @@ def main(): os.mkdir(cache_dir) # Printing Az window - logging.info('Az window set as Min(%3.0f) Max(%3.0f)' % (azmin,azmax)) + logging.info('Pass window set as Az Min(%3.0f) Max(%3.0f) and El Min(%3.0f)' % (azmin,azmax,elmin)) # Update logic update = update_needed(tnow, ground_station_id, cache_dir) @@ -444,12 +454,12 @@ def main(): #*------ Filter passes based on Az Window - if (checkAz(float(satpass['azr']),azmin,azmax)) or (checkAz(float(satpass['azs']),azmin,azmax)): + if ((checkAz(float(satpass['azr']),azmin,azmax)) or (checkAz(float(satpass['azs']),azmin,azmax))) and (float(satpass['altt'])>=elmin): logging.info("\n") - logging.info("scheduling Sat(%d) UUID(%s) Rise(%s) Set(%s)" % (int(satpass['id']),satpass['uuid'], + logging.info("scheduling Sat(%d) UUID(%s) Rise(%s) Set(%s) El(%3.0f)" % (int(satpass['id']),satpass['uuid'], satpass['tr'].strftime("%Y-%m-%d %H:%M:%S") + ".000", - satpass['ts'].strftime("%Y-%m-%d %H:%M:%S") + ".000")) + satpass['ts'].strftime("%Y-%m-%d %H:%M:%S") + ".000",float(satpass['altt']))) schedule_observation(session, int(satpass['id']), satpass['uuid'], ground_station_id, @@ -460,9 +470,9 @@ def main(): else: logging.info("\n") - logging.info("rejecting Sat(%d) UUID(%s) Rise(%s) Set(%s)" % (int(satpass['id']),satpass['uuid'], + logging.info("rejecting Sat(%d) UUID(%s) Rise(%s) Set(%s) El(%3.0f)" % (int(satpass['id']),satpass['uuid'], satpass['tr'].strftime("%Y-%m-%d %H:%M:%S") + ".000", - satpass['ts'].strftime("%Y-%m-%d %H:%M:%S") + ".000")) + satpass['ts'].strftime("%Y-%m-%d %H:%M:%S") + ".000",float(satpass['altt']))) logging.info("\n")