示例#1
0
 def onFboss(self, event):
     nstart,nstop=mys.get_range()
     # follow halos backwards, get position list in mt/cen for most massive halo
     #my.run("center_main.py "+str(nstart)+" "+str(nstop))
     # fixes missing snapshots by linear interpolation
     # interpolate missing snapshots by assuming last halo position
     #my.run("fix_shrink_spheres.py")
     my.run("fill_snap_xyz.py "+str(nstart)+" "+str(nstop))
     my.done()
示例#2
0
 def onPlist(self, event):
     nstart, nstop = mys.get_range()
     for nc in range(nstop-nstart+1):
         nsnap = nc + nstart
         # for all halos:
         cmd = "gen_particles_list.py "+str(nsnap)
         cmd += "&& gen_particles_dm.py "+str(nsnap)
         my.run(cmd)
         # if(not loop):
         # break
     my.done()
示例#3
0
 def onGenAOI(self, event):
     nstart,nstop=mys.get_range()
     for nc in range(nstop-nstart+1):
         nsnap = nc + nstart
         if(not mys.snap_exists(nsnap)):
             continue
         d  = mys.d(nsnap)
         my.mkdir(d+"stars")
         my.mkdir(d+"dm")
         cmd = "gen_spheres.py "+str(nsnap)+" 2" # 1 at end: centers from AHF. 2: after shrinking sphere
         my.run(cmd)
     my.done()
示例#4
0
 def onGenSpheres(self, event):
     nstart, nstop = mys.get_range()
     for nc in range(nstop - nstart + 1):
         nsnap = nc + nstart
         if (not mys.snap_exists(nsnap)):
             continue
         d = mys.d(nsnap)
         my.mkdir(d + "dm")
         if (not mys.is_dmonly()):
             my.mkdir(d + "stars")
         cmd = "cd " + d + " && gen_spheres.py " + str(nsnap) + " 1"
         my.run(cmd)
     my.done()
示例#5
0
 def onGenSpheres(self, event):
     nstart,nstop=mys.get_range()
     for nc in range(nstop-nstart+1):
         nsnap = nc + nstart
         if(not mys.snap_exists(nsnap)):
             continue
         d  = mys.d(nsnap)
         my.mkdir(d+"dm")
         if(not mys.is_dmonly()):
             my.mkdir(d+"stars");
         cmd = "cd "+d+" && gen_spheres.py "+str(nsnap)+" 1"
         my.run(cmd)
     my.done()
示例#6
0
 def onGenAOI(self, event):
     nstart, nstop = mys.get_range()
     for nc in range(nstop - nstart + 1):
         nsnap = nc + nstart
         if (not mys.snap_exists(nsnap)):
             continue
         d = mys.d(nsnap)
         my.mkdir(d + "stars")
         my.mkdir(d + "dm")
         cmd = "gen_spheres.py " + str(
             nsnap
         ) + " 2"  # 1 at end: centers from AHF. 2: after shrinking sphere
         my.run(cmd)
     my.done()
示例#7
0
 def onShrink(self, event):
     nstart,nstop=mys.get_range()
     # have xs,xs_star set in the end
     for nc in range(nstop-nstart+1):
         nsnap = nc + nstart
         if(not mys.snap_exists(nsnap)):
             continue
         print(mys.get_nhalo(nsnap))
         for i in range(3):#range(mys.get_nhalo(nsnap)):
             if(not mys.exists_snap(nsnap)):
                 print("snapshot "+str(nsnap)+" missing")
                 continue
             cmd = "shrink_sphere.py "+str(nsnap)+" "+str(i+1)
             my.run(cmd)
             if(not mys.is_dmonly()):
                 cmd = "shrink_sphere_stars.py "+str(nsnap)+" "+str(i+1)
                 my.run(cmd)
             # TODO: if empty xs (shrinking sphere algorithm did not succeed: use xc)
     my.done()
示例#8
0
 def onShrink(self, event):
     nstart, nstop = mys.get_range()
     # have xs,xs_star set in the end
     for nc in range(nstop - nstart + 1):
         nsnap = nc + nstart
         if (not mys.snap_exists(nsnap)):
             continue
         print(mys.get_nhalo(nsnap))
         for i in range(3):  #range(mys.get_nhalo(nsnap)):
             if (not mys.exists_snap(nsnap)):
                 print("snapshot " + str(nsnap) + " missing")
                 continue
             cmd = "shrink_sphere.py " + str(nsnap) + " " + str(i + 1)
             my.run(cmd)
             if (not mys.is_dmonly()):
                 cmd = "shrink_sphere_stars.py " + str(nsnap) + " " + str(
                     i + 1)
                 my.run(cmd)
             # TODO: if empty xs (shrinking sphere algorithm did not succeed: use xc)
     my.done()