Editing Stream Tags
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 101: | Line 101: | ||
add_item_tag(which_output, abs_offset, key, value, srcid) | add_item_tag(which_output, abs_offset, key, value, srcid) | ||
Note that the key and value are both PMTs. To create a string type PMT you can use pmt.intern("example_key") | Note that the key and value are both PMTs. To create a string type PMT you can use pmt.intern("example_key") | ||
Here is an example of a Python block that loops through samples and puts tags on random ones, and outputs the same signal: | |||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
import numpy as np | import numpy as np | ||
Line 137: | Line 132: | ||
return len(output_items[0]) | return len(output_items[0]) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Getting tags from a Stream === | === Getting tags from a Stream === |