Example radiopadre notebook for example-reduction-dir on Dropbox

The examples below show how to use the radiopadre machinery. The initialization block below (between "####") is mandatory.

You must select "Cell|Run All" from the above menu to re-run the notebook , and wait for it to finish running.

This particular notebook is built for the example results directory that can be downloaded from Dropbox, use this link to download example-reduction-dir from Dropbox: https://www.dropbox.com/sh/hde4azjdscsw20c/AAB2M0w3Ttm4ioPI0bccOPE-a?dl=0

Then do "cd example-reduction-dir; run-radiopadre.sh" inside your copy of the results directory to start the notebook server and point your browser to the port indicated by the script.


In [ ]:
### MANDATORY INIT ###
%matplotlib inline
from radiopadre import DirList
dirs = DirList()
######################

In [ ]:
# dirs is a directory list object
# By default displays all directories under your results directory 
# dirs.show() will have the same effect
dirs

In [ ]:
dirs[0].files

In [ ]:
dirs[0].fits.summary()  # gives list of FITS files in directory #0 above

In [ ]:
# displays thumbnails for all FITS files in directory #0
dirs[0].fits.thumbs()

In [ ]:
dirs[0].fits.thumbs(zoom=2,vmin=0,vmax=1)

In [ ]:
# gives list of FITS files matching the pattern
dirs[0].fits("*s7*")

In [ ]:
dirs[0].fits("*s7*").show()
dirs[0].fits("*s7*").thumbs()

In [ ]:
# list of images (PNG, JPG, etc.) in directory #3
dirs[3].images.show(ncol=2)

In [ ]:
# clickable thumbnails of same
dirs[3].images.thumbs(ncol=6)

In [ ]:
# first FITS file in directory #0. Stokes axis is unrolled by default, but this can be controlled by
# invoking dirs[0].fits[0].show() with some extra arguments
dirs[0].fits[0].show(vmin=-5e-5,vmax=5e-5)

In [ ]:
# and this shows how to invoke show() with some explicit arguments to control the rendering
dirs[0].fits[0].show(unroll=None,vmin=-5e-5,vmax=5e-5,zoom=4)

In [ ]:
# just some info about the given file
dirs[0].fits[0].info()

In [ ]:
# A more elaborate rendering of the same file using aplpy. Note that .fullpath gives you the path to the file.
# aplpy is quite slow so we don't use it by default for all files, but this example shows you how to do
# a proper rendering
import aplpy
fig = aplpy.FITSFigure(dirs[0].fits[0].fullpath,slices=[0,0])
fig.show_colorscale(cmap='gist_heat',vmin=-5e-5,vmax=5e-5)
fig.add_colorbar()