Пример #1
0
    xc = str(xcl[i])
    xs = str(xsl[i])
    yc = str(ycl[i])
    ys = str(ysl[i])
    zc = str(zcl[i])
    zs = str(zsl[i])
    r = str(rvirl[i] * facr)
    rs = str(rsl[i] * facr * 0.9)
    sj = str(i + 1)

    # Dark Matter only
    cmd = gsd + " -inp " + sim
    cmd += " -xc " + xc + " -yc " + yc + " -zc " + zc + " -rc " + r
    cmd += ">" + sim + "dm/dm_" + sj + ".dat && "
    cmd += "octreef " + sim + "dm/dm_" + sj + ".dat > " + sim + "dm/rho_" + sj + ".dat"
    if (show): print cmd
    if (run): my.thread(cmd)

    # stars only
    cmd = gss + " -inp " + sim
    # center on star center, but with virial radius
    if (typ == 1):
        cmd += " -xc " + xc + " -yc " + yc + " -zc " + zc + " -rc " + r
    if (typ == 2):  # second step: use shrinked sphere value for centering
        cmd += " -xc " + xs + " -yc " + ys + " -zc " + zs + " -rc " + r
    cmd += ">" + sim + "stars/stars_" + sj + ".dat"
    if (show): print cmd
    if (run): my.thread(cmd)

#    break # for debug purposes only: break after first halo
Пример #2
0
        my.mkdir(d+'hydro')
        my.mkdir(d+'part')
        my.mv(d+"amr_*",d+"amr")
        my.mv(d+"grav_*",d+'/grav')
        my.mv(d+"hydro_*",d+'/hydro')
        my.mv(d+'part_*',d+'/part')

# convert to Gadget file format
if(action==1):
    for ncounter in range(nstop-nstart+1):
        nc = ncounter + nstart
        num5 = str(nc).zfill(5)
        d  = simdir + "/output_"+num5+"/"
        print "> ramses2gadget"
        my.mkdir(d+"/r2g")
        my.thread("r2g -i "+d)

# run AHFstep on all snapshots
if(action==2):
    print "> AHFstep, rename output, create halo file"
    for ncounter in range(nstop-nstart+1):
        nsnap = ncounter + nstart
        d  = mys.d(nsnap)

        f = open(d+"a.par","w")
        s = d+"r2g/r2g. "
        s += "61 1\nao\n16\n4\n4\n0\n0\n0\n0\n"
        f.write(s)
        f.close()

        cmd = "cd "+d+" && AHFstep a.par"
Пример #3
0
    folder = "output_"+stri
    # plot gas in whole box
    bndry=" -xmi 0.0 -xma 1.0 -ymi 0.0 -yma 1.0 -zmi 0.0 -zma 1.0 "
    cmd1 = "amr2map -typ 1 -lma "+lma+" -inp "+folder
    cmd1 = cmd1 + " -out mov/gas/box/box_"+stri
    cmd1 = cmd1 + ".dat -dir z "+bndry
    cmc = " && "
    cmd2 = "map2img.py -l --colormap=hot "
    cmd2 = cmd2 + "mov/gas/box/box_"+stri+".dat "
    cmd2 = cmd2 + "-o mov/gas/box/box_"+stri+".png"
    if(calc):
        cmd = cmd1 + cmc + cmd2
    else:
        cmd = cmd2
    if(show):print cmd
    if(run): my.thread(cmd)

    # plot gas in slice
    bndry=" -xmi 0.0 -xma 1.0 -ymi 0.0 -yma 1.0 -zmi 0.4 -zma 0.6 "
    cmd1 = "amr2map -typ 1 -lma "+lma+" -inp "+folder
    cmd1 = cmd1 + " -out mov/gas/slice/slice_"+stri
    cmd1 = cmd1 + ".dat -dir z "+bndry
    cmc = " && "
    cmd2 = "map2img.py -l --colormap=hot "
    cmd2 = cmd2 + "mov/gas/slice/slice_"+stri+".dat "
    cmd2 = cmd2 + "-o mov/gas/slice/slice_"+stri+".png"
    if(calc):
        cmd = cmd1 + cmc + cmd2
    else:
        cmd = cmd2
    if(show):print cmd
Пример #4
0
        my.mkdir(d + 'hydro')
        my.mkdir(d + 'part')
        my.mv(d + "amr_*", d + "amr")
        my.mv(d + "grav_*", d + '/grav')
        my.mv(d + "hydro_*", d + '/hydro')
        my.mv(d + 'part_*', d + '/part')

# convert to Gadget file format
if (action == 1):
    for ncounter in range(nstop - nstart + 1):
        nc = ncounter + nstart
        num5 = str(nc).zfill(5)
        d = simdir + "/output_" + num5 + "/"
        print "> ramses2gadget"
        my.mkdir(d + "/r2g")
        my.thread("r2g -i " + d)

# run AHFstep on all snapshots
if (action == 2):
    print "> AHFstep, rename output, create halo file"
    for ncounter in range(nstop - nstart + 1):
        nsnap = ncounter + nstart
        d = mys.d(nsnap)

        f = open(d + "a.par", "w")
        s = d + "r2g/r2g. "
        s += "61 1\nao\n16\n4\n4\n0\n0\n0\n0\n"
        f.write(s)
        f.close()

        cmd = "cd " + d + " && AHFstep a.par"