{ "metadata": { "name": "", "signature": "sha256:202f95a5a6855adc375fa658e660be4751127a9934f82bfce4b58fd533bbea67" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "The Blackbody Radiation and the Cosmic Microwave Background (CMB) in Python: part I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Autor: [Eduardo Mart\u00edn Calleja](http://balbuceosastropy.blogspot.com.es/)\n", "\n", "This post is the first in a series of two in which we will examine, with the help of the Python language, the features of the blackbody radiation. In a second part, we will apply it to the particular case of the spectrum of the cosmic microwave background (CMB).\n", "\n", "The study of the properties of celestial bodies, such as its color or luminosity, needs the concept of an ideal radiation emitter known as a \"blackbody\". The stars radiate energy that depends on its temperature and the length of the radiation wavelength, and the blackbody emission law can be considered as a first approximation of the characteristics of this radiation. For this reason I will show in this post how to build with Python the curves of radiation of a blackbody at different temperatures, which will also constitute a good exercise to practice with the use of physical units with the \"quantities\" Python package, which was the subject of a [previous post](http://balbuceosastropy.blogspot.com.es/2013/09/how-to-work-with-physical-units-in.html).\n", "\n", "As usual, this entry has been written entirely using the amazing IPython Notebook." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Imports and references" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "\n", "from __future__ import division\n", "\n", "import quantities as pq\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# This IPython magic generates a table with version information\n", "# https://github.com/jrjohansson/version_information\n", "%load_ext version_information\n", "%version_information numpy, matplotlib, quantities" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
Software | Version |
---|---|
Python | 2.7.9 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] |
IPython | 2.3.1 |
OS | Linux 3.13.0 45 generic x86_64 with debian jessie sid |
numpy | 1.9.1 |
matplotlib | 1.4.2 |
quantities | 0.10.1 |
Sat Feb 21 00:33:52 2015 CET |