|
From: | Tom Rondeau |
Subject: | Re: [Discuss-gnuradio] Parsing extra metadata |
Date: | Thu, 21 Aug 2014 19:18:08 -0400 |
Hi Tom,Thanks for looking at this. The answer is "yes," as can be seen from the output below. The rx_freq field is not something that I added. I did add the "dumm" field, however.Sincerely,Dan Marlowaddress@hidden:~/pulsar/DAQ$ gr_read_file_metadata meta_test.dat.hdrHEADER 0Version Number: 0Sample Rate: 4000000.00 spsSeconds: 0.184295Item size: 4Data Type: float (5)Complex? FalseHeader Length: 189 bytesExtra Length: 40Extra Header? TrueSize of Data: 65536 bytes16384 itemsExtra Header:rx_freq:1.2e+09dumm:1408561917746092
On Aug 21, 2014, at 6:03 PM, Tom Rondeau wrote:
On Tue, Aug 19, 2014 at 3:13 PM, Daniel Marlow <address@hidden> wrote:
Hello,I am trying to add some extra information to the standard metadata file header.Following the information posted on http://gnuradio.org/doc/doxygen/page_metadata.html , I am able to write and read the standard metadata. I have attempted to add extra metadata with the following lines in my flowgraph:# add some extra meta datakey = pmt.pmt_intern("dummy")val = pmt.pmt_from_long(77)extras = pmt.pmt_make_dict()extras = pmt.pmt_dict_add(extras, key, val)extras_str = pmt.pmt_serialize_str(extras)nItems = 1024*sizeself.blocks_file_meta_sink_0 = blocks.file_meta_sink(gr.sizeof_float*1,"./meta_test.dat",samp_rate, 1, blocks.GR_FILE_FLOAT, False, nItems, extras_str, True)self.blocks_file_meta_sink_0.set_unbuffered(False)I think that the writing is going OK, since the length of the header increases by a reasonable amount and a Unix hexdump indicates that the "dummy" data is present. However, I am stuck when it comes to getting at the extra data using the parse_file_metadata functions. In particular, when I try to read the data using:cHeader = c[0:185] # character array read from filepmt_dict = pmt.pmt_deserialize_str(cHeader)p = parse_file_metadata.parse_header(pmt_dict,False)p_extra = parse_file_metadata.parse_extra_dict(pmt_dict,info,True)The first parse_file_metadata line successfully provides the standard metadata, but the second parse_file_metadata does not provide the extra "dummy" data. I suspect that it has to do with my poor understanding of what should go in the info argument.Any help would be greatly appreciated.Sincerely,Dan MarlowDan,What happens when you run gr_read_metadata on the file that's created? Does that show your extra header info?Tom
[Prev in Thread] | Current Thread | [Next in Thread] |