Skip to content

Instantly share code, notes, and snippets.

View SpheMakh's full-sized avatar

Sphesihle Makhathini SpheMakh

View GitHub Profile
# the phase center PSF
self.phasePSF = phasePSF;
# Observed frequency
self.freq0 = freq0 or 1.;
# the compression in time
self.dtime = dtime or 1;
# the compression in frequency
self.dfreq = dfreq or 1;
# the resolution or the pixel size in radian
self.resolution = np.pi*(cellsize/3600.)/180.;
@SpheMakh
SpheMakh / s3-sex2tigger.py
Created January 20, 2016 07:28
Convert s3-sex sky model to tigger LSM format
#!/usr/bin/env python
# Convert s3-sex catalog to tigger LSM format
# Usage: ./s3-sex2tigger.py <s3 catalog> <output name> [freq for fluxes]
# The frequency is optional. It uses 1400 by default
import os
import sys
import tempfile
s3model = sys.argv[1]
@SpheMakh
SpheMakh / pyxis-imaging.py
Created February 9, 2015 08:15
Pyxis script for imaging prac
## imaging Tut.
## update Pyxis if you haven't done so since 05 Feb 2015.
## Also ensure that you have lwimager installed
# run as $ pyxis msname image[options]
# options can be: cellsize,npix,gain,wprojplanes,column/data, etc
# to make a per N channel image add im.IMAGE_CHANNELIZE=N
# Find the MSs at jake:~makhathini/ratt/imaging
import Pyxis
import ms
@SpheMakh
SpheMakh / pyxis-intro.py
Last active August 29, 2015 14:14
Intro to Pyxis
import Pyxis
# once Pyxis is loaded, ms,mqt, im, lsm, std,stefcal become available
import ms # ms module
import im # imager module
import mqt # meqtree-pipeliner wrap
import stefcal # self calibration module
from Pyxis.ModSupport import * # I will make a note whenever I use something from here
define("MS_REDO",True,"Remake MS if it already exists")
@SpheMakh
SpheMakh / itrf2enu.py
Last active January 18, 2016 10:05
itrf 2 enu
import numpy as np
from pyrap.tables import table
import pyrap.measures
def enu2itrf(xyz=None,casa_table=None,**kw):
if casa_table:
xyz = table(anttab).getcol("POSITION")
import pyrap.measures
dm = pyrap.measures.measures()
dq = pyrap.measures.dq