Wednesday, April 10, 2013

IPython parallell setup on Carver at NERSC

IPython parallel is one of the easiest ways to spawn several Python sessions on a Supercomputing cluster and process jobs in parallel.

On Carver, the basic setup is running a controller on the login node, and submit engines to the computing nodes via PBS.

Sunday, April 7, 2013

Simple Mixin usage in python

One situation where Mixins are useful in Python is when you need to modify  a method of similar classes that you are importing from a package.

For just a single class, it is easier to just create a derived class, but if the same modification must be applied to several classes, then it is cleaner to implement this modification once in a Mixin and then apply it to all of them.

Noise in spectra and map domain

Spectra

NET or $\sigma$ is the standard deviation of the noise, measured in mK/sqrt(Hz), typical values for microwave amplifiers are 0.2-5.
This is the natural unit of the amplitude spectra (ASD), therefore the high frequency tail of the ASD should get to the expected value of the NET.
NET can also be expressed in mKsqrt(s), which is NOT the same unit.
mK/sqrt(Hz) refers to an integration bandwidth of 1 Hz that assumes a 6dB/octave rolloff, its integration time is only about 0.5 seconds.
mK/sqrt(s) instead refers to integration time of 1 second, therefore assumes a top hat bandpass.
Therefore there is a factor of sqrt(2) difference between the two conventions, therefore mK/sqrt(Hz) = sqrt(2) * mK sqrt(s)
See appendix B of Noise Properties of the Planck-LFI Receivers
http://arxiv.org/abs/1001.4608

Maps

To estimate the map domain noise instead we need to integrate the sigma over the time per pixel; in this case it is easier to convert the noise to sigma/sample, therefore we need to multiply by the square root of the sampling frequency:

sigma_per_sample = NET * sqrt(sampling_freq)

Then the variance per pixel is sigma_per_sample**2/number_of_hits

Angular power spectra

$C_\ell$ of the variance map is just the variance map multiplied by the pixel area divided by the integration time.

$$C_\ell = \Omega_{\rm pix} \langle \frac{\sigma^2}{\tau} \rangle = \Omega_{\rm pix} \langle \frac{\sigma^2 f_{\rm samp}}{hits} \rangle$$

Saturday, April 6, 2013

Basic fork/pull git workflow

Typical simple workflow for a (github) repository with few users.

Permissions configuration:
Main developers have write access to the repository, occasional contributor are supposed to fork and create pull requests.

Tuesday, March 12, 2013

Interactive 3D plot of a sky map

Mayavi is a Python package from Enthought for 3D visualization, here a simple example of creating a 3D interactive map starting from a HEALPix pixelization sky map:



Thursday, January 17, 2013

Elliptic beams, FWHM and ellipticity

The relationship between the Full Width Half Max, FWHM (min, max, and average) and the
ellipticity is:

FWHM = sqrt(FWHM_min * FWHM_max)
e = FWHM_max/FWHM_min