python
135 posts — page 8
-
clviewer, interactive plot of CMB spectra
Today it was HackDay at .Astronomy, so I felt compelled to hack something around myself, creating something I have been thinking for a while after my previous work on Interactive CMB power spectra in the browser
-
Planck CMB map at high resolution
Prompted by a colleague, I created a high-resolution version of the Cosmic Microwave Background map in MollWeide projection released by the Planck collaboration, available on the Planck Data Release Website in FITS format.
-
Run Hadoop Python jobs on Amazon with mrjob
First we need to install mrjob with: pip install mrjob I am starting with a simple example of word counting. MrJob makes the implementation of the reducer particularly simple. Using hadoop-streaming directly, we needed also to first parse back the output of the mapper into python objects, while MrJob does it for you and gives directly the key and the list of count, that we just need to sum.
-
Export google analytics data via API with Python
Fun weekend hacking project: export google analytics data using the google APIs. Clone the latest version of the API client from: https://code.google.com/p/google-api-python-client there is an example for accessing analytics APIs in the samples/analytics folder, but you need to fill in clientsecrets.json.
-
Processing sources in Planck maps with Hadoop and Python
Purpose The purpose of this post is to investigate how to process in parallel sources extracted from full sky maps, in this case the maps release by Planck, using Hadoop instead of more traditional MPI-based HPC custom software.
-
How to use the IPython notebook on a small computing cluster
The IPython notebook is a powerful and easy to use interface for using Python and particularly useful when running remotely, because it allows the interface to run locally in your browser, while the computing kernel runs remotely on the cluster.
-
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.
-
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.
-
Interactive 3D plot of a sky map
update May 2024: See the new version of this tutorial 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:
-
Butterworth filter with Python
Using IPython notebook of course: http://nbviewer.ipython.org/3843014/
-
IPython.parallel for Planck data analysis at NERSC
Planck is a Space mission for high precision measurements of the Cosmic Microwave Background (CMB), data are received as timestreams of output voltages from the 2 instruments on-board, the Low and High Frequency Instruments [LFI / HFI].
-
doctests and unittests happiness 2
nosetests -v --with-doctest Doctest: healpy.pixelfunc.ang2pix ... ok Doctest: healpy.pixelfunc.getallneighbours ... ok Doctest: healpy.pixelfunc.getinterpval ... ok Doctest: healpy.pixelfunc.getmapsize ... ok Doctest: healpy.pixelfunc.getminvalidnside ... ok Doctest: healpy.pixelfunc.getneighbours ...
-
some python resources
python tutorial: https://docs.python.org/3/tutorial/ numpy tutorial [arrays]: https://numpy.org/doc/stable/user/quickstart.html plotting tutorial: https://matplotlib.org/stable/tutorials/pyplot.html free online books: https://diveintopython3.net/ https://python.swaroopch.com/ install python (recommended): https://www.a
-
cfitsio wrapper in python
After several issues with pyfits, and tired of it being so overengineered, I've wrote my own fits I/O package in python, wrapping the C library cfitsio with ctypes. Pretty easy, first version completely developed in 1 day. https://github.com/zonca/pycfitsio
-
unit testing happiness
nosetests -v testallcols (pycfitsio.test.TestPyCfitsIoRead) ... ok testcolnames (pycfitsio.test.TestPyCfitsIoRead) ... ok testmove (pycfitsio.test.TestPyCfitsIoRead) ... ok testopenfile (pycfitsio.test.TestPyCfitsIoRead) ... ok testreadcol (pycfitsio.test.TestPyCfitsIoRead) ...