Created
November 15, 2021 18:36
-
-
Save daniestevez/5e7d746a00a22de03a6c1d62c5434653 to your computer and use it in GitHub Desktop.
Extract Voyager 1 signal from GUPPI files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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