want to create a file for each cluster that contains NSA galaxies in a fixed radial and redshift cut around the cluster.
DR < 3 deg (what we have used in the past, bigger than R200 by a lot)
delta v < 4000 km/s (big enough to include +/- 3 sigma for coma)
I have a program that does this already, but for the Local Cluster Survey sample.
In [1]:
import numpy as np
from matplotlib import pyplot as plt
from astropy.io import fits
%matplotlib inline
# read in NSA catalog
nsafile='/Users/rfinn/research/NSA/nsa_v0_1_2.fits'
nsa=fits.getdata(nsafile)
nsa.columns
Out[1]:
In [2]:
# create a figure of Dec vs RA for NSA galaxies
plt.figure()
plt.plot(nsa.RA,nsa.DEC,'k.',markersize=1,alpha=.1)
plt.xlabel('RA (deg)')
plt.ylabel('Dec (deg)')
plt.show()
In [3]:
infile=open('sample.dat','r')
ra=[]
dec=[]
vr=[]
name=[]
for line in infile:
#print line
t=line.split()
name.append(t[0])
ra.append(float(t[1]))
dec.append(float(t[2]))
vr.append(float(t[3]))
# convert the lists into an array
ra=np.array(ra,'f')
dec=np.array(dec,'f')
vr=np.array(vr,'f')
In [4]:
for i in range(len(name)):
keepflag = (np.sqrt((ra[i] - nsa.RA)**2 + (dec[i]-nsa.DEC)**2) < 3.) & (abs(vr[i] - nsa.ZDIST*3.e5) < 4000.)
outfile=name[i]+'_NSA.fits'
fits.writeto(outfile,nsa[keepflag],clobber=True)
In [ ]: