Skip to content

Instantly share code, notes, and snippets.

View torrance's full-sized avatar

Torrance Hodgson torrance

  • Curtin Institute of Data Science
  • Australia
View GitHub Profile
/****************************/
/* Slide 6: Docker */
/****************************/
Check you are a member of the docker Group
id
groups
Find the container name you want to use:
docker ps -a
#include <beam2016implementation.h>
#include <complex>
#include <math.h>
extern "C" {
Beam2016Implementation* beam_new(double* delays, double* amps, char* path) {
return new Beam2016Implementation(delays, amps, path);
}
void beam_del(Beam2016Implementation* beam) {
#! /usr/bin/python
from __future__ import division, print_function
from astropy.cosmology import Planck15
import astropy.units as units
import matplotlib.pyplot as plt
import numpy as np
redshift_slices = [0.01, 0.02, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3]
volumes = []
#! /usr/bin/env python
from __future__ import print_function, division
import argparse
from astropy.cosmology import Planck15
import astropy.units as units
import matplotlib.pyplot as plt
import numpy as np
@torrance
torrance / .sh
Created October 24, 2019 06:01
#! /bin/bash
#SBATCH -M zeus
#SBATCH --cpus-per-task 24
#SBATCH --mem 120G
#SBATCH -t 24:00:00
#SBATCH --nodes 1
#SBATCH --partition workq
#SBATCH --account pawsey0286
#SBATCh --export=ABSMEM
#!/usr/bin/env python
import os
import sys
import numpy as np
from casacore.tables import *
from askap.footprint import Skypos
if len(sys.argv) != 2:
sys.exit("Usage %s <ms_file>" %(sys.argv[0]))
@torrance
torrance / .py
Created September 17, 2019 05:11
#! /usr/bin/env python
from __future__ import print_function, division
import argparse
import os.path
from astropy.io import fits
from numba import njit, float64, prange
import numpy as np
#! /usr/bin/env python
from __future__ import print_function, division
import glob
from astropy.cosmology import Planck15
import astropy.units as units
import matplotlib.pyplot as plt
import numpy as np
#! /usr/bin/env python
from __future__ import print_function, division
import glob
from astropy.cosmology import Planck15
import astropy.units as units
import numpy as np
for source in ghosts:
if source in close_sources:
continue
xmin, xmax, ymin, ymax = source.bounds()
# Enlarge the bounding box just slightly
xwidth = xmax - xmin
if xwidth > 300:
xmin -= (xwidth * 1.2 - xwidth) / 2