diff --git a/get_tle.py b/get_tle.py index fe0d402..dd0cedd 100644 --- a/get_tle.py +++ b/get_tle.py @@ -6,7 +6,7 @@ import sys web_tle = [ 'http://www.celestrak.com/NORAD/elements/weather.txt', 'https://www.celestrak.com/NORAD/elements/stations.txt' ] #celestrak uses a different key value than I do, find all instances of their keys and replace with mine. -sats_of_interest = { 'NOAA-15':'NOAA 15', 'NOAA-18':'NOAA 18', 'NOAA-19':'NOAA 19', 'METEOR-M1':'METEOR-M 1', 'METEOR-M2':'METEOR-M 2', 'ISS':'ISS (ZARYA)' } +sats_of_interest = { 'NOAA-15':'NOAA 15', 'NOAA-18':'NOAA 18', 'NOAA-19':'NOAA 19'} #NOAA 15 [B] #1 25338U 98030A 16173.50363904 .00000079 00000-0 52195-4 0 9991 diff --git a/render.sh b/render.sh index 5e519b9..e59f911 100644 --- a/render.sh +++ b/render.sh @@ -2,14 +2,14 @@ #!/bin/bash #render_options=("ZA" "HVCT" "NO") -render_options=("HVCT") -render_options_night=("MCIR") +render_options=("BD" "HVCT" "MCIR") +render_options_night=("HVCT" "MCIR") direction=${f:(-7):(-6)} echo $1 #remove the directory structure from the first argument f1="${1:0:(-4)}" -file="${f1#'/tmp/'}" +file="${f1#'tmp/'}" #Isolate data values from filename file should begin with YYYYMMDD-HHMM dyear=${file:(0):(4)} @@ -29,7 +29,7 @@ echo "${dyear}/${dmonth}/${dday} ${dhour}:${dminute} /" $unixtimestamp #-gRSCFH are for turning on/off the overlays such as long/lat, cities, lakes, borders, etc. #-H selects the TLE file #-o is when the satellite is overhead forward one minute from the filename just to ensure that the predictor wxmap uses agrees with the pypredict predictor -wxmap -T "NOAA 15" -T "NOAA 18" -T "NOAA 19" -n "Vancouver,Canada" -c l:0xff000 -g 0 -R 0 -S 1 -C 1 -F 0 -H ~/satellites/weather.txt -o $(($unixtimestamp+60)) /tmp/passmap.png +#wxmap -T "NOAA 15" -T "NOAA 18" -T "NOAA 19" -n "Vancouver,Canada" -c l:0xff000 -g 0 -R 0 -S 1 -C 1 -F 0 -H ~/satellites/weather.txt -o $(($unixtimestamp+60)) /tmp/passmap.png #If pass is at night time render differently for daytime. if [[ ${dhour#0} -le 8 ]] || [[ ${dhour#0} -ge 17 ]] #the funny code is to ensure things are translated into base 10. @@ -39,17 +39,21 @@ then do echo "Now rendering option: ${r}" - wxtoimg -e $r -ocK -m /tmp/passmap.png /tmp/$file /tmp/$file"_${r}".png - done + wxtoimg -e $r -oK /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_${r}".png + wxtoimg -p /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_pristine".png + wxtoimg -r /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_raw".png + done else echo "Pass is in sun" for r in "${render_options[@]}" do echo "Now rendering option: ${r}" - wxtoimg -e $r -ocK -m /tmp/passmap.png /tmp/$file /tmp/$file"_${r}".png + wxtoimg -e $r -oK /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_${r}".png + wxtoimg -p /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_pristine".png + wxtoimg -r /home/space/satstuff/Pi_WXRX/tmp/$file.wav /var/www/html/APT/$file"_raw".png done fi #Upload. -bash ~/satellites/ftp.sh /tmp/$file"_${r}".png +#bash ~/satellites/ftp.sh /tmp/$file"_${r}".png diff --git a/satpredict.py b/satpredict.py index b0f65c4..6b0a90d 100644 --- a/satpredict.py +++ b/satpredict.py @@ -4,11 +4,11 @@ import sys import datetime #Frequencies that satellites transmit on. -frequencies = {'NOAA-15':'137.620M', 'NOAA-18':'137.9125M', 'NOAA-19':'137.10M', 'METEOR-M2':'137.925M', 'ISS':'145.80M' } #Meteor M2 is also on 137.1M +frequencies = {'NOAA-15':'137.620M', 'NOAA-18':'137.9125M', 'NOAA-19':'137.10M'} #Meteor M2 is also on 137.1M tle_data = json.load(open('sat_tle.txt')) default_predictions = 1 #how many predictions do we want to predict in advance -default_min_elevation = 30 #how low the angle of the satellitie pass is allowed to be if we want to record a pass +default_min_elevation = 15 #how low the angle of the satellitie pass is allowed to be if we want to record a pass suppress_low_passes = False #Less console spam if you enable this. #You can change the default elevation with the first parameter @@ -47,7 +47,7 @@ def get_sat( sat ): return sat + '\n' + tle_data[sat] #Where on the earth you are. Change this to your location -qth = (49.5, 123.5, 50) # lat (N), long (W), alt (meters) +qth = (52.08, 5.17, 5) # lat (N), long (W), alt (meters) data = {} @@ -59,14 +59,14 @@ for sat, freq in frequencies.iteritems(): count = 0 while ( count < predictions ): p = t.next() - p_nw = t_nw.next() - p_se = t_se.next() + # p_nw = t_nw.next() + # p_se = t_se.next() #peak check. PEAK CHECK! while (p.peak()['elevation'] < default_min_elevation): p = t.next() - p_nw = t_nw.next() - p_se = t_se.next() + # p_nw = t_nw.next() + # p_se = t_se.next() if( not suppress_low_passes ): print name, "pass too low, recalculating" diff --git a/sats.sh b/sats.sh index 44dd298..cf993c7 100644 --- a/sats.sh +++ b/sats.sh @@ -5,7 +5,7 @@ SAT=$1 #current unix time TIEMSTAMP=$(date +%s) #make a file -FILENAME="sat_schedules/schd-${SAT}-${TIEMSTAMP}" +FILENAME="sat_scheds/schd-${SAT}-${TIEMSTAMP}" rm reschd-$SAT.txt diff --git a/satschedule.py b/satschedule.py index 86281fe..f75eb46 100644 --- a/satschedule.py +++ b/satschedule.py @@ -5,18 +5,18 @@ import time import datetime -ppmshift = '1' #adjust this if you don't have a TCXO equipped RTLSDR +ppmshift = '1.1' #adjust this if you don't have a TCXO equipped RTLSDR name = sys.argv[1].upper() #what satellite we're using input_sample_rate = '48000' #actually the bandwidth of the audio sample we're taking from the RTLSDR output_sample_rate = '11025' #what we downconvert to to play nicely with wxtoimg -gain = '40' #software gain +gain = '35' #software gain gain_lower_pass = gain #we can add more or less gain if a satellite is at a lower elevation, currently disabled gain_lower_pass_requirement = 40 data = json.load(open('satpredict.txt')) -af_folder = '/tmp/' -output_folder = '~/sat_output/' +af_folder = 'tmp/' +output_folder = '/home/space/satstuff/PI_WXRX/sat_output/' #this line is depreciated, make it a zero element array to do rtl_power surveys of the downline band wxtoimg_options = ['HVCT', 'MCIR', 'NO'] @@ -75,12 +75,12 @@ filename = datestamp(data[name]['start_unix']) + name + '_' + str(int(data[name] #I may or may not have forgotten to specify you need the heatmap.py from the rtl_power page on keenerd. if( len(wxtoimg_options) == 0 ): - rtlpower = 'rtl_power -f 137M:138M:4k -g ' + gain + ' -i 1s -e ' + str(data[name]['duration_seconds']) + 's -p ' + ppmshift + ' -c 0.2 ' + output_folder + filename + '.csv' - heatmap = 'python heatmap.py ' + output_folder + name + '_' + str(int(data[name]['elevation'])) + '_' + timestamp + '.csv ' + output_folder + name + '_' + data[name]['direction'] + str(int(data[name]['elevation'])) + '_' + timestamp + '.png' +# rtlpower = 'rtl_power -f 137M:138M:4k -g ' + gain + ' -i 1s -e ' + str(data[name]['duration_seconds']) + 's -p ' + ppmshift + ' -c 0.2 ' + output_folder + filename + '.csv' +# heatmap = 'python heatmap.py ' + output_folder + name + '_' + str(int(data[name]['elevation'])) + '_' + timestamp + '.csv ' + output_folder + name + '_' + data[name]['direction'] + str(int(data[name]['elevation'])) + '_' + timestamp + '.png' print timeoutstr, rtlpower print heatmap - print 'bash ftp.sh ' + output_folder + name + '_' + str(int(data[name]['elevation'])) + '_' + timestamp + '.png' +# print 'bash ftp.sh ' + output_folder + name + '_' + str(int(data[name]['elevation'])) + '_' + timestamp + '.png' else: @@ -94,6 +94,7 @@ else: for v in sox_options: soxstr = soxstr + ' ' + v + print '/home/space/satstuff/rtl_biast/build/src/rtl_biast -b1' print timeoutstr, rtlstr, af_folder + filename + '.raw' print soxstr, af_folder + filename + '.raw', af_folder + filename + '.wav', 'rate 11025' print 'touch -r', af_folder + filename + '.raw', af_folder + filename + '.wav'