Wednesday, July 10, 2019

[Discuss-gnuradio] Question about metadata filesink

#plotData.py

""" This program will read in a data file from Gnu Radio and plot it.
Ellie White 25 Feb. 2017
"""

import pylab as plt
import os
import numpy as np

def main(fftsize=8192):

infile = 'data-raw.obs' #input("Enter the name of the file to read >>> ")
srate = 2000000 #int(input("What is the sampling rate of your SDR? >>> "))
data = []

size = os.path.getsize(infile) / 4
shape = (size/fftsize, fftsize)
x = np.memmap(infile, dtype='float32', mode = 'r', shape=shape)

#x = np.fromfile(infile, float)
print x

freqPlot = np.mean(x, axis=0)
#print freqPlot
fmin = (169010000-(srate/2))/1000000
fmax = (169010000+(srate/2))/1000000
fidx = np.linspace(fmin, fmax, freqPlot.size)

plt.plot(fidx, freqPlot)
plt.show()

if __name__ == "__main__":
main()
Hello!

I am working on a radio astronomy project with the Green Bank
Observatory / NRAO Central Development Lab this summer, utilizing GNU
Radio and an Ettus Research SDR, and I've got a question regarding how
to collect metadata information from a filesink.

I have attached the flowgraph I am using to this email. The project
requires that I use two computers in tandem for data collection -- one
is connected to the Ettus -- it is the TCP server, and sends an
interleaved data stream to the TCP client flowgraph (attached) on the
machine which will be storing the data. As you can see, I am saving
integrated spectra to a file. My question is simply, how do I retrieve
a time stamp corresponding to each spectra using the metadata time
sink? I have been fiddling with this all afternoon attempting to get
it to work properly, and I have been able to save data to a file, read
out spectra (using attached Python program), and display header
information using the command gr_read_file_metadata in the terminal,
but this is just showing me a timestamp for the beginning of the data
collection run, rather than showing me timestamps for each spectrum
which is saved to file, and I am not sure how to implement this.

Any advice would be much appreciated! If I can provide any more info
about my system or what steps I have tried, please let me know. Thank
you so much for your time -- have a good afternoon!

Best,
Ellie

No comments:

Post a Comment