Create Figure 1: Contour overlay of the full field


In [1]:
#import necessary stuff
import matplotlib
matplotlib.use('Agg')
%matplotlib inline
import matplotlib.pyplot as plt
import aplpy
from astropy import units as u
import numpy as np
import sys
sys.path.append('/media/Data/Luke/research/generalpython/')
import matplotlib.patheffects as path_effects
from scipy import stats
from math import pi,log10
from angsep import angsep

In [2]:
import numpy.lib.recfunctions as nprf

In [3]:
font = {'size'   : 24, 'family' : 'serif', 'serif' : 'cm'}
plt.rc('font', **font)
plt.rcParams['text.usetex'] = True
plt.rcParams['axes.linewidth'] = 2.0
#matplotlib.rc('text', usetex=True)
matplotlib.rcParams['text.latex.preamble'] = [r'\boldmath']

In [4]:
#Just m0 map, with squares for the regions
colormap=plt.cm.viridis_r
f1 = aplpy.FITSFigure('HI1020_21.mapPYM2.5b.fits',figsize=(23, 21))
#f1.show_colorscale(cmap=colormap,vmin=0.0,vmax=0.9, stretch='arcsinh')
f1.show_grayscale(invert=True,vmin=0.01,vmax=2.5,stretch='arcsinh')

f1.frame.set_color('black')
f1.frame.set_linewidth(2)
f1.set_tick_labels_font(size='20',weight='bold')
f1.set_axis_labels_font(size='22',weight='bold')
f1.set_tick_labels_format(xformat='hh:mm',yformat='dd')
f1.ticks.set_linewidth(2)
f1.set_tick_color('black')
f1.axis_labels.set_xtext(r'\textbf{RA (J2000)}')
f1.axis_labels.set_ytext(r'\textbf{Dec (J2000)}')

#0.03
levels=[0.13]
#levels = [0.1,0.3,0.9,2.7,8.1]
f1.show_contour('HI1020_21.mapPYM2.5b.fits', colors='black', levels=levels,linewidths=2,smooth=1)


dist = 25.
asecperkpc = 206.265/dist

radius = 1.0/dist*180./3.1415926
print radius

deg500kpc = 500.*asecperkpc/3600
f1.add_scalebar(deg500kpc) # length has to be specified
f1.scalebar.set_label(r'\textbf{500 kpc}')
f1.scalebar.set_linewidth(4)

##add the ALFALFA beam
f1.add_label(153.48,19.05,r'\textbf{Beam:}',weight='bold',size=18)
f1.show_ellipses(153.31,19.05,width=3.3/60., height=3.8/60.,facecolor='grey',edgecolor='black',linewidth=2,hatch="///")

#f1.recenter(156.,21.5,width=7.0,height=7.0)
#f1.recenter(155.,21.,width=7.0,height=7.0)
f1.recenter(155.,21.,width=2*radius,height=2*radius)

f1.show_rectangles(153.95,22.0,2.2,2.2,linewidth=3)
f1.show_rectangles(156.15, 20.1, 2.2, 2.4,linewidth=3)

f1.add_label(153.27,20.95,r'\textbf{NGC 3190 Group}',weight='bold')
f1.add_label(156.8,21.19,r'\textbf{NGC 3227 Group}',weight='bold')
f1.add_label(153.05,20.82,r'\textbf{Figure 6}',weight='bold')
f1.add_label(157.03,21.35,r'\textbf{Figure 4}',weight='bold')


#f1.show_circles(154.45,21.87,radius)
#f1.show_circles(155.,21.,radius)

savefigs=False
if savefigs:
    f1.save('wholefield2Mpc_c.eps')
    f1.save('wholefield2Mpc_c.png')


INFO:astropy:Setting slices=[0]
WARNING: FITSFixedWarning: PC001001= 1.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC001001= 1.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC002001= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC002001= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC003001= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC003001= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC001002= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC001002= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC002002= 1.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC002002= 1.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC003002= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC003002= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC001003= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC001003= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC002003= 0.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC002003= 0.000000000000E+00 
Defunct form of PCi_ja keyword.
WARNING: FITSFixedWarning: PC003003= 1.000000000000E+00 
Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: PC003003= 1.000000000000E+00 
Defunct form of PCi_ja keyword.
/home/luke/anaconda/lib/python2.7/site-packages/matplotlib/artist.py:221: MatplotlibDeprecationWarning: This has been deprecated in mpl 1.5, please use the
axes property.  A removal date has not been set.
  warnings.warn(_get_axes_msg, mplDeprecation, stacklevel=1)
/home/luke/anaconda/lib/python2.7/site-packages/aplpy/labels.py:432: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if self.coord == x or self.axis.apl_tick_positions_world[ipos] > 0:
INFO: Setting slices=[0] [aplpy.core]
INFO
INFO:astropy:Setting slices=[0]
: Setting slices=[0] [aplpy.core]
2.29183121962

In [ ]: