zcoord = boxsize / nslice * (i + 0.5)
    center = np.array([boxsize / 2., boxsize / 2., zcoord])

    print "center= ", center

    result = coldens.main(
        coords[indexes],
        hsmooth[indexes],
        ionmass[indexes],
        center,
        lgrid,
        lgrid,
        lgridz,
        ngrid,
        ngrid,
        58,
        boxsize,
        fig_name='coldens.%s.%s.%s.l%3.1f.%s.png' %
        (snapname, ionname, sliceinfostr, lgrid, enviro_label),
        Vmin=colmin,
        Vmax=colmax,
        ion=ionname,
        redshift=redshift,
        extralabel=ionname,
        haloinfostr=sliceinfostr,
        docbar=docbar)

    if (do_metals):
        metallicity = eagle.readArray(sniptag,
                                      sim,
                                      input_filename_base,
#sys.stdout = f

#for i in range(0,len(mass)-1):
#print i,mass[i],density[i],temperature[i],hydrogen[i],oxygen[i],chem[i,0],chem[i,28]

#sys.stdout = orig_stdout
#f.close()

result_h_z = coldens.main(coords,
                          hsmooth,
                          mass * hydrogen,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
                          ngrid,
                          ngrid,
                          58,
                          25,
                          fig_name='coldens.%s.hydrogen.z.l%3.1f.png' %
                          (snapname, lgrid),
                          Vmin=16,
                          Vmax=21,
                          ion='H')
result_o_z = coldens.main(coords,
                          hsmooth,
                          mass * oxygen / 16.0,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
                          ngrid,
### call coldens
res = 500  # resoltuion of coldense output (pixels in each direction)
SPH_neighbors = 58  # Ben uses 58
theta = 0.0
psi = 0.0

L_z = 2.0e0 * R / (1.e6 * parsec)

result = coldens.main(gas_coords / (1.e6 * parsec),
                      gasSmoothingLength / (1.e6 * parsec),
                      gas_mass / M_sol,
                      H_m,
                      gal_center,
                      2.0 * R / (1.e6 * parsec),
                      2.0 * R / (1.e6 * parsec),
                      L_z,
                      res,
                      res,
                      SPH_neighbors,
                      box_size,
                      fig_name="GasColdens_Rvir_zhat",
                      theta=theta,
                      psi=psi)

theta = 90
result = coldens.main(gas_coords / (1.e6 * parsec),
                      gasSmoothingLength / (1.e6 * parsec),
                      gas_mass / M_sol,
                      H_m,
                      gal_center,
                      2.0 * R / (1.e6 * parsec),
Si_m = 28.0

### call coldens
res = 3  # resoltuion of coldense output (pixels in each direction)
SPH_neighbors = 1  # Ben uses 58
theta = 0.0
psi = 0.0

result = coldens.main(gas_coords / (1.e6 * parsec),
                      gasSmoothingLength / (1.e6 * parsec),
                      gas_mass / M_sol,
                      H_m,
                      gal_center,
                      2.0 * R / (1.e6 * parsec),
                      2.0 * R / (1.e6 * parsec),
                      2.0 * R / (1.e6 * parsec),
                      res,
                      res,
                      SPH_neighbors,
                      box_size / (1.e6 * parsec),
                      fig_name="GasColumnDensity_R=R_vir",
                      theta=theta,
                      psi=psi)
result = coldens.main(gas_coords / (1.e6 * parsec),
                      gasSmoothingLength / (1.e6 * parsec),
                      H_mass / M_sol,
                      H_m,
                      gal_center,
                      2.0 * R / (1.e6 * parsec),
                      2.0 * R / (1.e6 * parsec),
                      2.0 * R / (1.e6 * parsec),
Beispiel #5
0
    if (i==0):
        direction="x"
        thetaangle = 0
        phiangle = 90
    if (i==1):
        direction="y"
        thetaangle = 90
        phiangle = 0
    if (i==2):
        direction="z"
        thetaangle = 0
        phiangle = 0

    lgridz = lgrid*2 # *2 #Now 2 times as of 12/30/14 # Four times longer than Lgrid in zdirection.

    result_Nh = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens_num.%s.hydrogen.%s.l%3.1f.png'%(snapname,direction,lgrid),Vmin=18.0+np.log10(lgridz/2./lgrid), Vmax=22.0+np.log10(lgridz/2./lgrid),ion='H',npix=ngrid,theta=thetaangle,phi=phiangle,redshift=redshift,extralabel='H')
    print "result_Nh= ", result_Nh
    result_mass = coldens.main(coords, hsmooth, mass, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens_num.%s.mass.%s.l%3.1f.png'%(snapname,direction,lgrid),Vmin=18.0+np.log10(lgridz/2./lgrid), Vmax=22.0+np.log10(lgridz/2./lgrid),ion='mass',npix=ngrid,theta=thetaangle,phi=phiangle,redshift=redshift,extralabel='mass')
    result_tempmass = coldens.main(coords, hsmooth, temp_mass, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens_num.%s.Tmass.%s.l%3.1f.png'%(snapname,direction,lgrid),Vmin=22.0, Vmax=29.0,ion='Tmass',npix=ngrid,theta=thetaangle,phi=phiangle,redshift=redshift,extralabel='T')
    coldens.make_colourmap('coldens_num.%s.T.%s.l%3.1f.png'%(snapname,direction,lgrid), result_tempmass-result_mass, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, 4.0,7.0, "T", ngrid, redshift=redshift, extralabel='T',haloinfostr=haloinfostr)
    print "result_tempmass= ", result_tempmass
    result_nhmass = coldens.main(coords, hsmooth, nh_mass, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens_num.%s.nHmass.%s.l%3.1f.png'%(snapname,direction,lgrid),Vmin=14.0, Vmax=22.0,ion='nhmass',npix=ngrid,theta=thetaangle,phi=phiangle,redshift=redshift,extralabel='')
    coldens.make_colourmap('coldens_num.%s.nh.%s.l%3.1f.png'%(snapname,direction,lgrid), result_nhmass-result_mass, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, -7.0,-1.0, "nH", ngrid, redshift=redshift, extralabel='n$_{\mathrm{H}}$',haloinfostr=haloinfostr)
    print "result_nhmass= ", result_nhmass

    result_vdotroverrmass = coldens.main(coords, hsmooth, vdotroverr_mass, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens_num.%s.vdotroverrmass.%s.l%3.1f.png'%(snapname,direction,lgrid),Vmin=-vlimit, Vmax=vlimit,ion='vdotroverrmass',npix=ngrid,theta=thetaangle,phi=phiangle,redshift=redshift,extralabel='')
    print "result_vdotroverrmass= ", result_vdotroverrmass
    print "10**result_mass= ", 10**result_mass
    coldens.make_colourmap('coldens_num.%s.vdotroverr.%s.l%3.1f.png'%(snapname,direction,lgrid), result_vdotroverrmass/10**result_mass, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, -vlimit,vlimit, "vdotroverr", ngrid, redshift=redshift, extralabel='v',haloinfostr=haloinfostr)
    print "result_vdotroverrmass/10**result_mass= ", result_vdotroverrmass/10**result_mass
Beispiel #6
0
    thetaangle = 90
    phiangle = 0
if (direction == "x"):
    thetaangle = 0
    phiangle = 90

result_den = coldens.main(coords[indexes],
                          hsmooth[indexes],
                          denominator,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
                          ngrid,
                          ngrid,
                          58,
                          boxsize,
                          fig_name='coldens.%s.%s.%s.l%3.1f.png' %
                          (snapname, ion, direction, lgrid),
                          Vmin=colmin,
                          Vmax=colmax,
                          ion=ion,
                          theta=thetaangle,
                          phi=phiangle,
                          redshift=redshift,
                          extralabel=ionname)

if (ion == "temperature" or ion == "T" or ion == "nH" or ion == "Z"
        or ion == "To6"):
    result_num = coldens.main(coords[indexes],
                              hsmooth[indexes],
                              numerator,
Beispiel #7
0
    h1 = chem[:,1]
    c4 = chem[:,10]
    o6 = chem[:,28]
    o7 = chem[:,29]
    o8 = chem[:,30]
    mg2 = chem[:,45] 
    ne8 = chem[:,40]
    mg10 = chem[:,53]
    si12 = chem[:,68]
    n5 = chem[:,19]
    si2 = chem[:,58]
    si3 = chem[:,59]
    si4 = chem[:,60]


result_h_z = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.hydrogen.z.l%3.1f.png'%(snapname,lgrid),Vmin=17.5, Vmax=21.5,ion='H',mhalo=mhalo,extralabel='H',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_o_z = coldens.main(coords, hsmooth, mass*oxygen/16.0, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.oxygen.z.l%3.1f.png'%(snapname,lgrid),Vmin=14, Vmax=18,ion='O',mhalo=mhalo,extralabel='O',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_h1_z = coldens.main(coords, hsmooth, mass*hydrogen*h1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.h1.z.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=21,ion='H I',mhalo=mhalo,extralabel='H I',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_c4_z = coldens.main(coords, hsmooth, mass*hydrogen*c4, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.c4.z.l%3.1f.png'%(snapname,lgrid),Vmin=11.5, Vmax=15.5,ion='C IV',mhalo=mhalo,extralabel='C IV',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_o6_z = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o6.z.l%3.1f.png'%(snapname,lgrid),Vmin=12.7, Vmax=16.7,ion='O VI',mhalo=mhalo,extralabel='O VI',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_o7_z = coldens.main(coords, hsmooth, mass*hydrogen*o7, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o7.z.l%3.1f.png'%(snapname,lgrid),Vmin=13.0, Vmax=17.0,ion='O VII',mhalo=mhalo,extralabel='O VII',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_o8_z = coldens.main(coords, hsmooth, mass*hydrogen*o8, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o8.z.l%3.1f.png'%(snapname,lgrid),Vmin=13.0, Vmax=17.0,ion='O VIII',mhalo=mhalo,extralabel='O VIII',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_mg2_z = coldens.main(coords, hsmooth, mass*hydrogen*mg2, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.mg2.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='Mg II',mhalo=mhalo,extralabel='Mg II',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_si2_z = coldens.main(coords, hsmooth, mass*hydrogen*si2, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.si2.z.l%3.1f.png'%(snapname,lgrid),Vmin=11.5, Vmax=15.5,ion='Si II',mhalo=mhalo,extralabel='Si II',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_si3_z = coldens.main(coords, hsmooth, mass*hydrogen*si3, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.si3.z.l%3.1f.png'%(snapname,lgrid),Vmin=11.5, Vmax=15.5,ion='Si III',mhalo=mhalo,extralabel='Si III',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
result_si4_z = coldens.main(coords, hsmooth, mass*hydrogen*si4, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.si4.z.l%3.1f.png'%(snapname,lgrid),Vmin=11.5, Vmax=15.5,ion='Si IV',mhalo=mhalo,extralabel='Si IV',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
if(snip=="0"):
    result_ne8_z = coldens.main(coords, hsmooth, mass*hydrogen*ne8, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.ne8.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='Ne VIII',mhalo=mhalo,extralabel='Ne VIII',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
    result_mg10_z = coldens.main(coords, hsmooth, mass*hydrogen*mg10, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.mg10.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='Mg X',mhalo=mhalo,extralabel='Mg X',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
    result_si12_z = coldens.main(coords, hsmooth, mass*hydrogen*si12, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.si12.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='Si XII',mhalo=mhalo,extralabel='Si XII',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
    result_n5_z = coldens.main(coords, hsmooth, mass*hydrogen*n5, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.n5.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='N V',mhalo=mhalo,extralabel='N V',haloinfostr=haloinfostr,docbar=docbar, R200=R200)
Ne_m = 20.0
N_m = 14.0
O_m = 16.0
Si_m = 28.0

### Masses of each ion in each SPH particle
O6_mass = (O_m / H_m) * o6 * H_mass

#O6_mass_in_R = EagleFunctions.particles_within_R(gas_coords,O6_mass,R)

### call coldens
res = 500  # resoltuion of coldense output (pixels in each direction)
SPH_neighbors = 58  # Ben uses 58
theta = 0.0
psi = 0.0
gal_center = np.asarray(
    [0.0, 0.0,
     0.0])  # I transform all coordinates into gal centered coordinates

result = coldens.main(gas_coords/(1.e6*parsec), gasSmoothingLength/(1.e6*parsec), O6_mass/M_sol, O_m, gal_center, 2.0*R/(1.e6*parsec), \
2.0*R/(1.e6*parsec), 2.0*R/(1.e6*parsec), res, res, SPH_neighbors, box_size/(1.e6*parsec), fig_name = "OVI_ColumnDensity_R=R_vir", theta=theta,psi=psi)

result = coldens.main(gas_coords/(1.e6*parsec), gasSmoothingLength/(1.e6*parsec), gas_mass/M_sol, H_m, gal_center, 2.0*R/(1.e6*parsec), \
2.0*R/(1.e6*parsec), 2.0*R/(1.e6*parsec), res, res, SPH_neighbors, box_size/(1.e6*parsec), fig_name = "GasColumnDensity_R=R_vir", theta=theta,psi=psi)

result = coldens.main(gas_coords/(1.e6*parsec), gasSmoothingLength/(1.e6*parsec), H_mass/M_sol, H_m, gal_center, 2.0*R/(1.e6*parsec), \
2.0*R/(1.e6*parsec), 2.0*R/(1.e6*parsec), res, res, SPH_neighbors, box_size/(1.e6*parsec), fig_name = "HColumnDensity_R=R_vir", theta=theta,psi=psi)

result = coldens.main(gas_coords/(1.e6*parsec), gasSmoothingLength/(1.e6*parsec), He_mass/M_sol, He_m, gal_center, 2.0*R/(1.e6*parsec), \
2.0*R/(1.e6*parsec), 2.0*R/(1.e6*parsec), res, res, SPH_neighbors, box_size/(1.e6*parsec), fig_name = "HeColumnDensity_R=R_vir", theta=theta,psi=psi)
Beispiel #9
0
    mg10 = chem[:, 53]
    si12 = chem[:, 68]
    n5 = chem[:, 19]

indexes_xray = np.where(temperature > 1e+06)

result_xraydens2_x = coldens.main(
    coords[indexes_xray],
    hsmooth[indexes_xray],
    mass[indexes_xray]**2 * density[indexes_xray]**2,
    center,
    lgrid,
    lgrid,
    lgridz,
    ngrid,
    ngrid,
    58,
    boxsize,
    fig_name='coldens.%s.xraydens2.x.l%3.1f.png' % (snapname, lgrid),
    Vmin=17,
    Vmax=21,
    ion='xraydens2',
    phi=90,
    extralabel='xraydens2',
    haloinfostr=haloinfostr,
    docbar=docbar)
result_dens_x = coldens.main(coords[indexes_xray],
                             hsmooth[indexes_xray],
                             mass[indexes_xray] * density[indexes_xray],
                             center,
                             lgrid,
                             lgrid,
Beispiel #10
0
print center
print coords[0]

orig_stdout = sys.stdout
f = file('/net/galaxy/data2/oppenheimer/snap31.txt', 'w')
#f = file('/net/galaxy/data2/oppenheimer/snap25.txt', 'w')
sys.stdout = f

for i in range(0,len(mass)-1):
    print i,mass[i],density[i],temperature[i],hydrogen[i],oxygen[i],chem[i,0],chem[i,28]

sys.stdout = orig_stdout
f.close()

print "mass whole"
result = coldens.main(coords, hsmooth, mass, center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.mass.whole.png'%tag,Vmin=16, Vmax=21)
print "Z whole"
result = coldens.main(coords, hsmooth, mass*metals, center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.metals.whole.png'%tag,Vmin=16, Vmax=21)
print "H whole"
result = coldens.main(coords, hsmooth, mass*hydrogen, center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.hydrogen.whole.png'%tag,Vmin=16, Vmax=21)
print "O whole"
result = coldens.main(coords, hsmooth, mass*oxygen/16.0, center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.oxygen.whole.png'%tag,Vmin=12, Vmax=18)
print "OI whole"
result = coldens.main(coords, hsmooth, mass*hydrogen*chem[:,23], center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.o1.whole.png'%tag,Vmin=11, Vmax=15)
print "OII whole"
result = coldens.main(coords, hsmooth, mass*hydrogen*chem[:,24], center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.o2.whole.png'%tag,Vmin=11, Vmax=15)
print "OIII whole"
result = coldens.main(coords, hsmooth, mass*hydrogen*chem[:,25], center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.o3.whole.png'%tag,Vmin=11, Vmax=15)
print "OIV whole"
result = coldens.main(coords, hsmooth, mass*hydrogen*chem[:,26], center, 12.5, 12.5, 12.5, ngrid, ngrid, 58, 25,fig_name='%s.o4.whole.png'%tag,Vmin=11, Vmax=15)
print "OV whole"
Beispiel #11
0
        si2 = chem[:, 58]
        si3 = chem[:, 59]
        si4 = chem[:, 60]

print "done reading "

result_h_z = coldens.main(coords,
                          hsmooth,
                          mass * hydrogen,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
                          ngrid,
                          ngrid,
                          58,
                          boxsize,
                          fig_name='coldens.%s.hydrogen.z.l%3.1f.png' %
                          (snapname, lgrid),
                          Vmin=17.5,
                          Vmax=21.5,
                          ion='H',
                          redshift=redshift,
                          extralabel='H',
                          haloinfostr=haloinfostr,
                          docbar=docbar)

result_h_y = coldens.main(coords,
                          hsmooth,
                          mass * hydrogen,
                          center,
                          lgrid,
    o7 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/OxygenVII",numThreads=1)
    o8 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/OxygenVIII",numThreads=1)
else:
    chem = eagle.readArray("SNAP", sim, input_filename_base, "/PartType0/ChemistryAbundances",physicalUnits=1,noH=0,numThreads=1)
    h1 = chem[:,1]
    c4 = chem[:,10]
    o6 = chem[:,28]
    o7 = chem[:,29]
    o8 = chem[:,30]
    mg2 = chem[:,45] 
    ne8 = chem[:,40]
    mg10 = chem[:,53]
    si12 = chem[:,68]
    n5 = chem[:,19]

result_o6_z = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o6.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OVI',redshift=redshift,extralabel='OVI',haloinfostr=haloinfostr,docbar=docbar)
result_o7_z = coldens.main(coords, hsmooth, mass*hydrogen*o7, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o7.z.l%3.1f.png'%(snapname,lgrid),Vmin=12.5, Vmax=16.5,ion='OVII',redshift=redshift,extralabel='OVII',haloinfostr=haloinfostr,docbar=docbar)
result_o8_z = coldens.main(coords, hsmooth, mass*hydrogen*o8, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.o8.z.l%3.1f.png'%(snapname,lgrid),Vmin=12.5, Vmax=16.5,ion='OVIII',redshift=redshift,extralabel='OVIII',haloinfostr=haloinfostr,docbar=docbar)
result_h_z = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.hydrogen.z.l%3.1f.png'%(snapname,lgrid),Vmin=17, Vmax=21,ion='H',redshift=redshift,extralabel='H',haloinfostr=haloinfostr,docbar=docbar)
result_o_z = coldens.main(coords, hsmooth, mass*oxygen/16.0, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, boxsize,fig_name='coldens.%s.oxygen.z.l%3.1f.png'%(snapname,lgrid),Vmin=14, Vmax=18,ion='O',redshift=redshift,extralabel='O',haloinfostr=haloinfostr,docbar=docbar)

coldens.make_colourmap('coldens.%s.fo6.z.l%3.1f.png'%(snapname,lgrid), result_o6_z-result_o_z, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, -4.0, -1.0, 'fOVI', ngrid, redshift=redshift, extralabel='f$_\mathrm{OVI}$',haloinfostr=haloinfostr,docbar=docbar)
coldens.make_colourmap('coldens.%s.fo7.z.l%3.1f.png'%(snapname,lgrid), result_o7_z-result_o_z, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, -3.0, 0.0, 'fOVII', ngrid, redshift=redshift, extralabel='f$_\mathrm{OVII}$',haloinfostr=haloinfostr,docbar=docbar)
coldens.make_colourmap('coldens.%s.fo8.z.l%3.1f.png'%(snapname,lgrid), result_o8_z-result_o_z, -1.0*lgrid/2.0, lgrid/2.0, -1.0*lgrid/2.0, lgrid/2.0, -3.0, 0.0, 'fOVIII', ngrid, redshift=redshift, extralabel='f$_\mathrm{OVIII}$',haloinfostr=haloinfostr,docbar=docbar)

f = file('colion_map.%s.z.l%3.1f.dat'%(snapname,lgrid), 'w')
for i in xrange(ngrid):
    for j in xrange(ngrid):
        f.write('%3d %3d % 5.2f % 5.2f % 5.2f % 5.2f % 5.2f % 5.2f % 5.2f\n'%(i,j,result_h_z[i,j],result_o_z[i,j],result_h_z[i,j],result_o_z[i,j],result_o6_z[i,j],result_o7_z[i,j],result_o8_z[i,j]))
f.close()
#mass_to_density = pixelpc**-2/npartcm2tomsolpc2
hsmooth = hsmooth / 10.

print hsmooth

stellar_mass *= 1.e+10  #/hubble_param

result_stars_z = coldens.main(coords,
                              hsmooth,
                              stellar_mass * conversion,
                              center,
                              lgrid,
                              lgrid,
                              lgridz,
                              ngrid,
                              ngrid,
                              58,
                              25,
                              fig_name='coldens.%s.stars.z.l%5.3f.png' %
                              (snapname, lgrid),
                              Vmin=-1,
                              Vmax=4,
                              ion='Msol/pc^-2',
                              npix=ngrid)

result_stars_y = coldens.main(coords,
                              hsmooth,
                              stellar_mass * conversion,
                              center,
                              lgrid,
                              lgrid,
Beispiel #14
0
if(snip=="1"):
    h1 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/HydrogenI",numThreads=1)
    print 'h1= ', h1
    c4 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/CarbonIV",numThreads=1)
    print 'c4= ', c4
    o6 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/OxygenVI",numThreads=1)
    o7 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/OxygenVII",numThreads=1)
    o8 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/OxygenVIII",numThreads=1)
    mg2 = eagle.readArray("SNIP", sim, input_filename_base, "/PartType0/ChemicalAbundances/MagnesiumII",numThreads=1)
else:
    chem = eagle.readArray("SNAP", sim, input_filename_base, "/PartType0/ChemistryAbundances",physicalUnits=1,noH=0,numThreads=1)
    h1 = chem[:,1]
    #c4 = chem[:,10]
    o6 = chem[:,28]
    #o7 = chem[:,29]
    #o8 = chem[:,30]
    #mg2 = chem[:,45] 

#result_h_z = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.hydrogen.z.l%3.1f.png'%(snapname,lgrid),Vmin=16, Vmax=21,ion='H')
result_h1_z = coldens.main(coords, hsmooth, mass*hydrogen*h1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.h1.z.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=21,ion='HI',npix=ngrid)
#result_o6_z = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.o6.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OVI')

#result_h_y = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.hydrogen.y.l%3.1f.png'%(snapname,lgrid),Vmin=16, Vmax=21,ion='H',theta=90)
#result_h1_y = coldens.main(coords, hsmooth, mass*hydrogen*h1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.h1.y.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=21,ion='HI',theta=90)
#result_o6_y = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.o6.y.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OVI',theta=90)

#result_h_x = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.hydrogen.x.l%3.1f.png'%(snapname,lgrid),Vmin=16, Vmax=21,ion='H',phi=90)
#result_h1_x = coldens.main(coords, hsmooth, mass*hydrogen*h1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.h1.x.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=21,ion='HI',phi=90)
#result_o6_x = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.o6.x.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OVI',phi=90)
#chem = eagle.readArray("SNAP", sim, tag, "/PartType0/ChemistryAbundances"[:,1],numThreads=1)

#center = [8 8 8]
center = np.array([14.26, 10.65, 13.48])
center = np.array([6.98, 5.21, 6.55])
center = np.array([17.5995, 14.08347, 15.8329])
print center
print coords[0]

result = coldens.main(coords,
                      hsmooth,
                      mass * hydrogen,
                      center,
                      0.5,
                      0.5,
                      0.5,
                      400,
                      400,
                      58,
                      25,
                      fig_name='test_hydrogen_z02.pdf',
                      Vmin=16,
                      Vmax=21)

result = coldens.main(coords,
                      hsmooth,
                      mass * hydrogen,
                      center,
                      0.5,
                      0.5,
                      0.5,
                      400,
Beispiel #16
0
else:
    chem = eagle.readArray("SNAP", sim, input_filename_base, "/PartType0/ChemistryAbundances",physicalUnits=1,noH=0,numThreads=1)
    h1 = chem[:,1]
    c2 = chem[:,8]
    c3 = chem[:,9]
    c4 = chem[:,10]
    o1 = chem[:,23]
    o6 = chem[:,28]
#    o7 = chem[:,29]
#    o8 = chem[:,30]
    mg2 = chem[:,45] 
    si2 = chem[:,58]
    si3 = chem[:,59]
    si4 = chem[:,60]

result_h_z = coldens.main(coords, hsmooth, mass*hydrogen, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.hydrogen.z.l%3.1f.png'%(snapname,lgrid),Vmin=16, Vmax=21,ion='H',npix=ngrid)
result_o_z = coldens.main(coords, hsmooth, mass*oxygen/16.0, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.oxygen.z.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=18,ion='O',npix=ngrid)
result_h1_z = coldens.main(coords, hsmooth, mass*hydrogen*h1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.h1.z.l%3.1f.png'%(snapname,lgrid),Vmin=13, Vmax=21,ion='HI',npix=ngrid)
result_c2_z = coldens.main(coords, hsmooth, mass*hydrogen*c2, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.c2.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='CII',npix=ngrid)
result_c3_z = coldens.main(coords, hsmooth, mass*hydrogen*c3, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.c3.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='CIII',npix=ngrid)
result_c4_z = coldens.main(coords, hsmooth, mass*hydrogen*c4, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.c4.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='CIV',npix=ngrid)
result_o1_z = coldens.main(coords, hsmooth, mass*hydrogen*o1, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.o1.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OI',npix=ngrid)
result_o6_z = coldens.main(coords, hsmooth, mass*hydrogen*o6, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.o6.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='OVI',npix=ngrid)
result_mg2_z = coldens.main(coords, hsmooth, mass*hydrogen*mg2, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.mg2.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='MgII',npix=ngrid)
result_si2_z = coldens.main(coords, hsmooth, mass*hydrogen*si2, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.si2.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='SiII',npix=ngrid)
result_si3_z = coldens.main(coords, hsmooth, mass*hydrogen*si3, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.si3.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='SiIII',npix=ngrid)
result_si4_z = coldens.main(coords, hsmooth, mass*hydrogen*si4, center, lgrid, lgrid, lgridz, ngrid, ngrid, 58, 25,fig_name='coldens.%s.si4.z.l%3.1f.png'%(snapname,lgrid),Vmin=11, Vmax=15,ion='SiIV',npix=ngrid)

f = file('coldens_map.%s.z.l%3.1f.dat'%(snapname,lgrid), 'w')
for i in xrange(ngrid):
    for j in xrange(ngrid):
Beispiel #17
0
                           numThreads=1)
oxygen = eagle.readArray(sniptag,
                         sim,
                         input_filename_base,
                         "/PartType0/ElementAbundance/Oxygen",
                         numThreads=1)

result_h_z = coldens.main(coords,
                          hsmooth,
                          mass * hydrogen,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
                          ngrid,
                          ngrid,
                          58,
                          boxsize,
                          fig_name='coldens.%s.hydrogen.z.l%3.1f.png' %
                          (snapname, lgrid),
                          Vmin=16,
                          Vmax=21,
                          ion='H',
                          redshift=redshift)
result_o_z = coldens.main(coords,
                          hsmooth,
                          mass * oxygen / 16.0,
                          center,
                          lgrid,
                          lgrid,
                          lgridz,
print hsmooth

DM_mass *= 1.e+10  #/hubble_param

WIMP_mass = 106.58

result_dm_z = coldens.main(coords,
                           hsmooth,
                           DM_mass / WIMP_mass,
                           center,
                           lgrid,
                           lgrid,
                           lgridz,
                           ngrid,
                           ngrid,
                           58,
                           25,
                           fig_name='coldens.%s.DM.z.l%3.1f.png' %
                           (snapname, lgrid),
                           Vmin=16,
                           Vmax=21,
                           ion='DM(100 GeV)',
                           extralabel='DM',
                           redshift=redshift)

result_dm_y = coldens.main(coords,
                           hsmooth,
                           DM_mass / WIMP_mass,
                           center,
                           lgrid,
                           lgrid,
#chem = eagle.readArray("SNAP", sim, tag, "/PartType0/ChemistryAbundances"[:,1],numThreads=1)

#center = [8 8 8]
center = np.array([14.26, 10.65, 13.48])
center = np.array([6.98, 5.21, 6.55])
print center
print coords[0]

result = coldens.main(coords,
                      hsmooth,
                      mass * hydrogen,
                      center,
                      0.3,
                      0.3,
                      0.3,
                      400,
                      400,
                      58,
                      25,
                      fig_name='test_hydrogen_z2.pdf',
                      Vmin=17,
                      Vmax=23)

result = coldens.main(coords,
                      hsmooth,
                      mass * carbon / 12.0,
                      center,
                      0.3,
                      0.3,
                      0.3,
                      400,
Beispiel #20
0
sys.stdout = f

for i in range(0, len(mass) - 1):
    print i, mass[i], density[i], temperature[i], hydrogen[i], oxygen[i], chem[
        i, 0], chem[i, 28]

sys.stdout = orig_stdout
f.close()

result = coldens.main(coords,
                      hsmooth,
                      mass * hydrogen,
                      center,
                      lgrid,
                      lgrid,
                      lgridlong,
                      ngrid,
                      ngrid,
                      58,
                      25,
                      fig_name='coldens.%s.hydrogen.png' % tag,
                      Vmin=16,
                      Vmax=21)

result = coldens.main(coords,
                      hsmooth,
                      mass * hydrogen,
                      center,
                      lgrid,
                      lgrid,
                      lgridlong,
                      ngrid,
Beispiel #21
0
        thetaangle = 0
        phiangle = 0

    lgridz = lgrid * 0.01  # *2 #Now 2 times as of 12/30/14 # Four times longer than Lgrid in zdirection.

    result_Nh = coldens.main(coords_pos,
                             hsmooth_pos,
                             mass_pos * hydrogen_pos,
                             center,
                             lgrid,
                             lgrid,
                             lgridz,
                             ngrid,
                             ngrid,
                             58,
                             boxsize,
                             fig_name='coldens_num.%s.hydrogen.%s.l%3.1f.png' %
                             (snapname, direction, lgrid),
                             Vmin=18.0 + np.log10(lgridz / 2. / lgrid),
                             Vmax=22.0 + np.log10(lgridz / 2. / lgrid),
                             ion='H',
                             npix=ngrid,
                             theta=thetaangle,
                             phi=phiangle,
                             redshift=redshift,
                             extralabel='H')
    print "result_Nh= ", result_Nh
    result_mass = coldens.main(coords_pos,
                               hsmooth_pos,
                               mass_pos,
                               center,
Beispiel #22
0
### For now one galaxy, in the future we can hopefully take an index for each galaxy. Maybe dict? Maybe not. 

# get gas properties from eagle
species = 'h1' # ion species, will convert to lower case. Currnelty set up only for h1 but masses will be returned for h1 and all h
Lx, Ly, Lz = 0.5, 0.5, 0.5 # sizes of the image (x,y) and depth of the image (z) in Mpcs
npix_x, npix_y = 250, 250 # the number of pixels along each side of the final image (size of output array from coldens)
vmin_HI, vmax_HI, vmin_H, vmax_H = 13., 21.5, 19., 22.
ion, element = "HI", "H"
neighbors = 58 # Ben says this (58) is the needed value but he dones't understand it and I should play with
for gal_index in range(0,np.size(dirs)):
	print "getting galaxy props"
	gas_coords, smoothing_length, element_mass, ion_mass, gal_coords, box_size = EagleFunctions.get_props_for_coldens(species,
																				dirs[gal_index], group_numbers[gal_index], particles_included_keyword[gal_index], group_included_keyword[gal_index], subfind_included_keyword[gal_index], group_dirs[gal_index], all_directories=all_directories)
	print "got galaxy props"
	if known_gal_coords[gal_index] == 0:
		coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, gal_coords, Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, phi=270., fig_name='coldens_test_x.pdf', ion=ion)
		coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, gal_coords, Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, theta=90., fig_name='coldens_test_y.pdf', ion=ion)
		coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, gal_coords, Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, fig_name='coldens_test_z.pdf', ion=ion)
	else:
		# coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, phi=270.)
		# coldens_plot('%s_%s_x.pdf' % (designator[gal_index], ion), Lx, Ly, coldens_map, ion, "x", vmin_HI, vmax_HI)
		# coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, theta=90.)
		# coldens_plot('%s_%s_y.pdf' % (designator[gal_index], ion), Lx, Ly, coldens_map, ion, "y", vmin_HI, vmax_HI)
		# coldens_map = coldens.main(gas_coords, smoothing_length, ion_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size)
		# coldens_plot('%s_%s_z.pdf' % (designator[gal_index], ion), Lx, Ly, coldens_map, ion, "z", vmin_HI, vmax_HI)

		coldens_map = coldens.main(gas_coords, smoothing_length, element_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, phi=270.)
		coldens_plot('%s_%s_x.pdf' % (designator[gal_index], element), Lx, Ly, coldens_map, element, "x", vmin_H, vmax_H)
		coldens_map = coldens.main(gas_coords, smoothing_length, element_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size, theta=90.)
		coldens_plot('%s_%s_y.pdf' % (designator[gal_index], element), Lx, Ly, coldens_map, element, "y", vmin_H, vmax_H)
		coldens_map = coldens.main(gas_coords, smoothing_length, element_mass, known_gal_coords[gal_index], Lx, Ly, Lz, npix_x, npix_y, neighbors, box_size)