Skip to content

Instantly share code, notes, and snippets.

View zonca's full-sized avatar

Andrea Zonca zonca

View GitHub Profile
@zonca
zonca / whiteangpow.py
Created October 2, 2012 18:24
angular power spectrum white noise
nside = 128
import healpy as hp
import numpy as np
tmap = np.random.normal(scale=1, size=12*nside**2)
qmap = np.random.normal(scale=1.2, size=12*nside**2)
umap = np.random.normal(scale=.8, size=12*nside**2)
cltt, clee, clbb, clte, cleb, cltb = hp.anafast( [tmap, qmap, umap], lmax=2*nside )
exp = 4.*np.pi/12./nside**2
@zonca
zonca / noisenorm.ipynb
Created October 3, 2012 18:56
Noise normalization for spectra
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zonca
zonca / Butterworth.ipynb
Created October 5, 2012 23:18
Butterworth Filter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zonca
zonca / hdf5example.ipynb
Created October 5, 2012 23:39
hdf5 example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zonca
zonca / mancheck_delta.py
Created October 11, 2012 16:51
manual check on convoluted dipole
import numpy as np;import cPickle;from math import sin, cos, sqrt
dpcconv = np.load("dipole_27M_od100.npy")
dpcpnt = cPickle.load(open("pointing_DPC_LFI27M_100_DX9.pkl", 'rb'))
# sample 20000 of OD 100 LFI28S
p = 20000
scet = dpcpnt['sampleSCET'][p] # 1629538470557322
# relativistic add of:
@zonca
zonca / ipyn_carv.py
Created October 11, 2012 22:51 — forked from marius311/ipyn.carv
Get an IPython notebook running on Carver.
#!/usr/bin/env python
#Specify this:
username = ''
"""
Get an IPython notebook running on Carver.
Usage:
@zonca
zonca / phasebin.py
Created October 12, 2012 16:36
Phase binning code for producing pseudomaps
import numpy as np
import cPickle
import pycfitsio
from collections import defaultdict
import healpy
from planck import Planck
from testenv import remix, todtools
from planck.pointingtools import AHF_btw_OBT
@zonca
zonca / hdf5.bib
Last active February 2, 2024 07:28
How to cite HDF5 in a paper
See the references below directly
@zonca
zonca / 3d_map.py
Last active December 14, 2015 20:49
Interactive 3D plot of a sky map
from mayavi import mlab
import numpy as np
import healpy as hp
# load a WMAP map
m = hp.read_map("data/wmap_band_iqumap_r9_7yr_W_v4.fits", 0) * 1e3 # muK
nside = hp.npix2nside(len(m))
vmin = -1e3; vmax = 1e3
@zonca
zonca / config.status
Created March 29, 2013 20:00
healpy debugging, MAC OSX 10.5 64bit with 32bit python cfitsio config.status
#! /bin/bash
# Generated by configure.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false