Skip to content

Instantly share code, notes, and snippets.

View astropenguin's full-sized avatar

Akio Taniguchi astropenguin

View GitHub Profile
# coding: utf-8
# standard library
import multiprocessing as mp
# dependent packages
import numpy as np
# classes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
"""Mini tool to convert *.nqm to *.fits.
Usage:
$ python nqm_to_fits.py <nqmname> <fitsname>
"""
# standard library
@astropenguin
astropenguin / ppca.py
Last active September 23, 2017 04:14
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
from scipy.special import gammaln
from sklearn import decomposition
def lnpU(k):
q = (D-np.arange(k)) / 2
ln2, lnpi = np.log(2), np.log(np.pi)
return np.sum(-ln2+gammaln(q)-lnpi*q)
from sys import _getframe
from inspect import stack
def default(func):
depth = [s[3] for s in stack()].index('<module>')
myglobals = sys._getframe(depth).f_globals
myglobals['__userfunc__'] = func
spec = getargspec(func)
"""Mini tool to modify nqm to one compatible with CASA's scantable.
Usage:
$ python nqm_for_scantable.py <nqmname>
Notes:
User can use wildcard '*' in <nqmname> for batch process.
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.