예제 #1
0
def App():

    oldP = np.load(pathOfFolder + '16-2-21-100p-baby-position.npy')
    oldV = np.load(pathOfFolder + '16-2-21-100p-baby-velocity.npy')
    oldM = np.load(pathOfFolder + '16-2-21-100p-baby-mass.npy')

    initialM = oldM[-1]
    initialP = oldP[-1]
    initialV = oldV[-1]

    print(np.shape(initialM), np.shape(initialP), np.shape(initialV))

    pData, vData, mData = work(initialP, initialV, initialM, t, dt, colRad,
                               minParticles)

    thinP = thinData(pData, compressFactor)
    thinV = thinData(vData, compressFactor)
    thinM = thinData(mData, compressFactor)

    newP = np.concatenate((oldP[:-1], thinP))
    newV = np.concatenate((oldV[:-1], thinV))
    newM = np.concatenate((oldM[:-1], thinM))

    print('saving...')

    np.save(pathOfFolder + '16-2-21-100p-baby-position', newP)
    np.save(pathOfFolder + '16-2-21-100p-baby-velocity', newV)
    np.save(pathOfFolder + '16-2-21-100p-baby-mass', newM)

    print('saved successfully')

    return len(newM)
예제 #2
0
def App():

    oldP = np.load(pathOfFolder + date + '200p-Myr-position.npy')
    oldV = np.load(pathOfFolder + date + '200p-Myr-velocity.npy')
    oldM = np.load(pathOfFolder + date + '200p-Myr-mass.npy')

    initialM = oldM[-1]
    initialP = oldP[-1]
    initialV = oldV[-1]

    pData, vData, mData = work(initialP, initialV, initialM, t, dt, colRad,
                               minParticles)

    thinP = thinData(pData, compressFactor)
    thinV = thinData(vData, compressFactor)
    thinM = thinData(mData, compressFactor)

    newP = np.concatenate((oldP[:-1], thinP))
    newV = np.concatenate((oldV[:-1], thinV))
    newM = np.concatenate((oldM[:-1], thinM))

    np.save(pathOfFolder + date + '200p-Myr-position', newP)
    np.save(pathOfFolder + date + '200p-Myr-velocity', newV)
    np.save(pathOfFolder + date + '200p-Myr-mass', newM)

    print('Saved')

    return len(newM)
예제 #3
0

oldP = np.load(
    pathOfFolder + '16-2-21-200p-Myr-position.npy')
oldV = np.load(
    pathOfFolder + '16-2-21-200p-Myr-velocity.npy')
oldM = np.load(
    pathOfFolder + '16-2-21-200p-Myr-mass.npy')

initialM = oldM[-1]
initialP = oldP[-1]
initialV = oldV[-1]

tick = time()

pData, vData, mData = work(
    initialP, initialV, initialM, t, dt, colRad, minParticles)

thinP = thinData(pData, compressFactor)
thinV = thinData(vData, compressFactor)
thinM = thinData(mData, compressFactor)

np.save(pathOfStore + '16-2-21-200p-Myr-position-final',
        thinP)
np.save(pathOfStore + '16-2-21-200p-Myr-velocity-final',
        thinV)
np.save(pathOfStore + '16-2-21-200p-Myr-mass-final',
        thinM)

tock = time()

print('time taken: ', tock - tick)