Skip to content

Instantly share code, notes, and snippets.

View cbassa's full-sized avatar

Cees Bassa cbassa

  • ASTRON Netherlands Institute for Radio Astronomy
  • Netherlands
View GitHub Profile
@cbassa
cbassa / satnogs_waterfall_converter.py
Last active April 25, 2020 12:28
satnogs_waterfall_converter.py
#!/usr/bin/env python3
import numpy as np
import h5py
import argparse
import os
if __name__ == "__main__":
# Parse arguments
parser = argparse.ArgumentParser(
description="Convert a SatNOGS waterfall file to HDF5 format")
@cbassa
cbassa / frequencies.txt
Last active July 12, 2019 12:05
UHF STRF frequencies
20442 437.126562
24278 435.795813
25397 435.225625
25544 437.005969
25544 437.049719
27607 436.793406
27844 436.836844
27848 436.849562
27939 435.354062
28895 437.465969
@cbassa
cbassa / convert.py
Created February 11, 2019 21:14
rtl_power to STRF converter
import numpy as np
from astropy.time import Time
import matplotlib.pyplot as plt
def parse_line(line):
# Strip line and split
line = [part.strip() for part in line.strip().split(",")]
# Get MJD
t = Time("%sT%s"%(line[0], line[1]), format="isot", scale="utc")
@cbassa
cbassa / pgplot_test.c
Last active January 13, 2019 20:37
PGPLOT test code. Build with "gcc test_pgplot.c -lX11 -lcpgplot -lpgplot -lm -o test_pgplot"
#include <stdio.h>
#include <cpgplot.h>
int main(int argc,char *argv[])
{
cpgopen("?");
cpgend();
return 0;
# Open file
f=open(fname)
# Read number of channels
nchan=int(np.fromfile(f,dtype='float32',count=1)[0])
# Read channel frequencies
freq=np.fromfile(f,dtype='float32',count=nchan)/1000.0
# Read entire file