In [1]:
%pylab inline
from subprocess import call
import os.path
In [2]:
def data_base_query(query, outputfile, password="42", username="forero"):
website = "http://wget.multidark.org/MyDB?action=doQuery&SQL="
wget_options="--auth-no-challenge --content-disposition --cookies=on --keep-session-cookies --save-cookies=cookie.txt --load-cookies=cookie.txt"
wget_options=wget_options+" -O "+outputfile +" "
wget_command="wget --http-user="+username+" --http-passwd="+password+" "+wget_options
command = wget_command + "\""+ website + query+"\""
#print command
retcode = call(command,shell=True)
Load some haloID data corresponding to a subbox of 20Mpc/h from MultiDark
In [8]:
halo_filename = '../data/special_halo_ID/pathologic_halos.dat'
halo_data = loadtxt(halo_filename)
In [9]:
BDMV_ID = halo_data[:,0]
n_halos = size(BDMV_ID)
In [10]:
for halo_ID in range(n_halos):
profile_query = "select * from MDR1..BDMVprof where bdmId = %d\
order by Rbin"%(BDMV_ID[halo_ID])
output_file = "../data/profile_data/profile_%d_BDMW_ID.csv"%(BDMV_ID[halo_ID])
if(not os.path.exists(output_file)):
print output_file
n = data_base_query(profile_query, output_file, password="lapiz5borra")
In [21]:
prof_data = loadtxt("../data/profile_data/profile_8506860440_BDMW_ID.csv", delimiter=",", skiprows=28)
In [25]:
r_bin = prof_data[:,5]
m_inc = prof_data[:,15]
dens_bin = prof_data[:,8]
In [30]:
plot(log10(r_bin), log10(m_inc))
Out[30]:
In [29]:
plot(log10(r_bin), log10(dens_bin))
Out[29]:
In [ ]: