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 / sky_imagers.py
Created February 3, 2024 10:36
Different implementations of sky imagers for speed testing
#!/usr/bin/env python3
import time
import numpy as np
import matplotlib.pyplot as plt
import numba
import cupy as cp
@cbassa
cbassa / uhd_capture_s-band.sh
Created February 26, 2023 14:26
S-band capture script for B-200
# Settings
FREQ=2242e6
RATE=4e6
FIFO=$HOME/satobs/s-band/fifo
export UHD_IMAGES_DIR=/opt/uhd/share/uhd/images
# Start channelizer
nice -20 rffft -i $FIFO -p $HOME/satobs/s-band -f $FREQ -s $RATE &
@cbassa
cbassa / keogram.py
Created January 5, 2023 09:00
Create a keogram for 24h of images
#!/usr/bin/env python3
import sys
import tqdm
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.time import Time
@cbassa
cbassa / artemis_1_tle.txt
Created November 16, 2022 07:15
Artemis 1 TLE estimates
These are TLE estimates for the actual launch time of 2022-11-16T06:47:44.
Orbital elements have been estimated from the timeline and parameters by Jonathan
McDowell (https://planet4589.org/space/misc/artemis1.txt).
The TLE describing translunar orbit is only valid for the first 2 days after launch,
as TLEs do not properly model the influence of the Moon at large distances from Earth.
Parking orbit (valid until 2022-11-16T08:32UTC)
1 84001U 22320.31928241 .00000000 00000-0 50000-4 0 04
2 84001 34.0000 15.0000 1103405 21.0000 180.0000 13.71415011 08
@cbassa
cbassa / vdif_convert.py
Created October 17, 2022 09:22
Tool to convert VLBI VDIF format to complex floats
#!/usr/bin/env python3
import os
import sys
import argparse
import numpy as np
import baseband
import astropy.units as u
@cbassa
cbassa / id.sh
Last active August 11, 2022 20:18
Astrometric calibration and prediction
wcsfit
for file in 2*.fits; do
if [ ! -e $file.cal ]; then
addwcs -f $file -r test.fits -m 9 -R 20
satid $file $file.png/png 2>/dev/null
fi
done
@cbassa
cbassa / find.sh
Created August 11, 2022 20:17
Star finding script
#!/bin/bash
# Copy first file
if [ ! -e "test.fits" ]; then
ls -1 2*.fits | head -n1 | awk '{printf("cp %s test.fits\n",$1)}' | sh
fi
# Loop over files
for file in *.fits; do
@cbassa
cbassa / get.sh
Created August 11, 2022 20:16
gphoto2 DSLR image capture and FITS conversion
#!/bin/bash
# Wait for nearest full second
waitfor
# Log date
timestamp=`date -u +%FT%T`
echo $timestamp >>log.txt
# Capture
@cbassa
cbassa / sanitize_csv.py
Created April 8, 2022 13:58
Sanitize Bobcat-1 GPS measurements
#!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
if __name__ == "__main__":
d = ascii.read(sys.argv[1])
@cbassa
cbassa / tle_swap.py
Created November 16, 2021 20:42
Plot TLE parameters to find swapped objects
#!/usr/bin/env python3
import os
import json
from spacetrack import SpaceTrackClient
from sgp4.earth_gravity import wgs84
from sgp4.io import twoline2rv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from astropy.time import Time