Пример #1
0
def find_particle(part_id,num,base):
    """Gets the file and position of a particle with id part_id"""
    for i in range(0,500) :
        ids=hdfsim.get_baryon_array("ParticleIDs",num,base,i,dtype=np.int64)
        ind=np.where(ids==part_id)
        if np.size(ind) > 0:
            return (ind[0][0], i)
Пример #2
0
def find_id(pos, num, base, snap_file=0):
    """Gets the id of a particle at some position"""
    ids = hdfsim.get_baryon_array("ParticleIDs",
                                  num,
                                  base,
                                  snap_file,
                                  dtype=np.int64)
    return ids[pos]
Пример #3
0
def find_particle(part_id, num, base):
    """Gets the file and position of a particle with id part_id"""
    for i in range(0, 500):
        ids = hdfsim.get_baryon_array("ParticleIDs",
                                      num,
                                      base,
                                      i,
                                      dtype=np.int64)
        ind = np.where(ids == part_id)
        if np.size(ind) > 0:
            return (ind[0][0], i)
Пример #4
0
def find_id(pos,num,base,snap_file=0):
    """Gets the id of a particle at some position"""
    ids=hdfsim.get_baryon_array("ParticleIDs",num,base,snap_file,dtype=np.int64)
    return ids[pos]