Skip to content

Instantly share code, notes, and snippets.

@daniestevez
Created November 15, 2021 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniestevez/5e7d746a00a22de03a6c1d62c5434653 to your computer and use it in GitHub Desktop.
Save daniestevez/5e7d746a00a22de03a6c1d62c5434653 to your computer and use it in GitHub Desktop.
Extract Voyager 1 signal from GUPPI files
#!/usr/bin/env python3
import argparse
from blimpy import GuppiRaw
def parse_args():
parser = argparse.ArgumentParser(
description='Extract IQ channel for Voyager-1 from GUPPI file')
parser.add_argument('input_file', type=str,
help='input file')
parser.add_argument('output_file', type=str,
help='output file')
return parser.parse_args()
def main():
vgr_chan = 6 # PFB channel for Voyager-1
args = parse_args()
f_in = GuppiRaw(args.input_file)
with open(args.output_file, 'wb') as f_out:
try:
for _, data_x, _ in f_in.get_data():
x = data_x[vgr_chan]
x.tofile(f_out)
except StopIteration:
pass
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment