Add NOAA APT sink block arguments for script

This commit is contained in:
George Vardakis 2017-07-22 20:58:11 +03:00
parent 7890c71130
commit c0829bb02e
2 changed files with 187 additions and 28 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<?grc format='1' created='3.7.10'?>
<flow_graph>
<timestamp>Mon Apr 10 23:26:02 2017</timestamp>
<block>
@ -783,6 +783,49 @@ TX sampling rate</value>
<value>fff</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(504, 724)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>flip_images</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>intx</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>freq_xlating_fir_filter_xxx</key>
<param>
@ -2889,7 +2932,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>flip</key>
<value>False</value>
<value>bool(flip_images)</value>
</param>
<param>
<key>_coordinate</key>
@ -2917,11 +2960,11 @@ we shift the LO a little further</value>
</param>
<param>
<key>split</key>
<value>True</value>
<value>bool(split_images)</value>
</param>
<param>
<key>sync</key>
<value>False</value>
<value>bool(sync)</value>
</param>
</block>
<block>
@ -3081,6 +3124,92 @@ we shift the LO a little further</value>
<value>samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth))</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(320, 724)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>split_images</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>intx</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(424, 724)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>sync</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>intx</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>

View File

@ -5,7 +5,7 @@
# Title: NOAA APT Decoder
# Author: Manolis Surligas, George Vardakis
# Description: A NOAA APT Decoder with automatic image synchronization
# Generated: Fri Jul 21 18:34:01 2017
# Generated: Sat Jul 22 20:55:06 2017
##################################################
from gnuradio import analog
@ -23,7 +23,7 @@ import time
class satnogs_noaa_apt_decoder(gr.top_block):
def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, file_path='/tmp/test.ogg', if_gain=satnogs.not_set_rx_if_gain, image_file_path='/tmp/noaa.png', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=90.4e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'):
def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, file_path='/tmp/test.ogg', if_gain=satnogs.not_set_rx_if_gain, image_file_path='/tmp/noaa.png', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=90.4e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat', split_images=0, sync=0, flip_images=0):
gr.top_block.__init__(self, "NOAA APT Decoder")
##################################################
@ -43,18 +43,21 @@ class satnogs_noaa_apt_decoder(gr.top_block):
self.rx_freq = rx_freq
self.rx_sdr_device = rx_sdr_device
self.waterfall_file_path = waterfall_file_path
self.split_images = split_images
self.sync = sync
self.flip_images = flip_images
##################################################
# Variables
##################################################
self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate']
self.noaa_filter_taps = noaa_filter_taps = firdes.low_pass(1.0, 1.0, 0.17, 0.02, firdes.WIN_HAMMING, 6.76)
self.initial_bandwidth = initial_bandwidth = 100e3
self.first_stage_filter_taps = first_stage_filter_taps = firdes.low_pass(1.0, 1.0, 0.2, 0.1, firdes.WIN_HAMMING, 6.76)
self.first_stage_decimation = first_stage_decimation = 2
self.audio_decimation = audio_decimation = 2
@ -64,7 +67,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)), 0.0, 8, 1024, waterfall_file_path, 0)
self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500)
self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, 48000, 0.8)
self.satnogs_noaa_apt_sink_0 = satnogs.noaa_apt_sink(image_file_path, 2080, 1500, True, False, False)
self.satnogs_noaa_apt_sink_0 = satnogs.noaa_apt_sink(image_file_path, 2080, 1500, bool(split_images), bool(sync), bool(flip_images))
self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx /first_stage_decimation)
self.rational_resampler_xxx_1 = filter.rational_resampler_fff(
interpolation=48000,
@ -96,7 +99,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0)
self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0)
self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0)
self.hilbert_fc_0 = filter.hilbert_fc(65, firdes.WIN_HAMMING, 6.76)
self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(first_stage_decimation, (first_stage_filter_taps), lo_offset, samp_rate_rx)
self.fir_filter_xxx_1 = filter.fir_filter_fff(2, ([0.5, 0.5]))
@ -114,21 +117,21 @@ class satnogs_noaa_apt_decoder(gr.top_block):
##################################################
# Connections
##################################################
self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq'))
self.connect((self.analog_wfm_rcv_0, 0), (self.band_pass_filter_0, 0))
self.connect((self.analog_wfm_rcv_0, 0), (self.rational_resampler_xxx_1, 0))
self.connect((self.band_pass_filter_0, 0), (self.fir_filter_xxx_1, 0))
self.connect((self.blocks_complex_to_mag_0, 0), (self.rational_resampler_xxx_0_0, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.analog_wfm_rcv_0, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.satnogs_waterfall_sink_0, 0))
self.connect((self.fir_filter_xxx_1, 0), (self.rational_resampler_xxx_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
self.connect((self.hilbert_fc_0, 0), (self.blocks_complex_to_mag_0, 0))
self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))
self.connect((self.rational_resampler_xxx_0, 0), (self.hilbert_fc_0, 0))
self.connect((self.rational_resampler_xxx_0_0, 0), (self.satnogs_noaa_apt_sink_0, 0))
self.connect((self.rational_resampler_xxx_1, 0), (self.satnogs_ogg_encoder_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.fir_filter_xxx_0, 0))
self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq'))
self.connect((self.analog_wfm_rcv_0, 0), (self.band_pass_filter_0, 0))
self.connect((self.analog_wfm_rcv_0, 0), (self.rational_resampler_xxx_1, 0))
self.connect((self.band_pass_filter_0, 0), (self.fir_filter_xxx_1, 0))
self.connect((self.blocks_complex_to_mag_0, 0), (self.rational_resampler_xxx_0_0, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.analog_wfm_rcv_0, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.satnogs_waterfall_sink_0, 0))
self.connect((self.fir_filter_xxx_1, 0), (self.rational_resampler_xxx_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
self.connect((self.hilbert_fc_0, 0), (self.blocks_complex_to_mag_0, 0))
self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))
self.connect((self.rational_resampler_xxx_0, 0), (self.hilbert_fc_0, 0))
self.connect((self.rational_resampler_xxx_0_0, 0), (self.satnogs_noaa_apt_sink_0, 0))
self.connect((self.rational_resampler_xxx_1, 0), (self.satnogs_ogg_encoder_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.fir_filter_xxx_0, 0))
def get_antenna(self):
return self.antenna
@ -228,6 +231,24 @@ class satnogs_noaa_apt_decoder(gr.top_block):
def set_waterfall_file_path(self, waterfall_file_path):
self.waterfall_file_path = waterfall_file_path
def get_split_images(self):
return self.split_images
def set_split_images(self, split_images):
self.split_images = split_images
def get_sync(self):
return self.sync
def set_sync(self, sync):
self.sync = sync
def get_flip_images(self):
return self.flip_images
def set_flip_images(self, flip_images):
self.flip_images = flip_images
def get_samp_rate_rx(self):
return self.samp_rate_rx
@ -318,6 +339,15 @@ def argument_parser():
parser.add_option(
"", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat',
help="Set waterfall_file_path [default=%default]")
parser.add_option(
"", "--split-images", dest="split_images", type="intx", default=0,
help="Set split_images [default=%default]")
parser.add_option(
"", "--sync", dest="sync", type="intx", default=0,
help="Set sync [default=%default]")
parser.add_option(
"", "--flip-images", dest="flip_images", type="intx", default=0,
help="Set flip_images [default=%default]")
return parser
@ -325,7 +355,7 @@ def main(top_block_cls=satnogs_noaa_apt_decoder, options=None):
if options is None:
options, _ = argument_parser().parse_args()
tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, file_path=options.file_path, if_gain=options.if_gain, image_file_path=options.image_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, waterfall_file_path=options.waterfall_file_path)
tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, file_path=options.file_path, if_gain=options.if_gain, image_file_path=options.image_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, waterfall_file_path=options.waterfall_file_path, split_images=options.split_images, sync=options.sync, flip_images=options.flip_images)
tb.start()
tb.wait()