Beispiel #1
0
def plot_selection(filetime, ipart):
    simul.update(time_int[-1])
    coord = part.subsection(px[:, -1], py[:, -1], offset=10)
    salt = var('temp', simul, coord=coord, depths=[whichdepth]).data
    plt.contourf(salt.T * simul.mask[coord[2]:coord[3], coord[0]:coord[1]].T,
                 100)
    plt.colorbar()
    #plt.plot(px[:,0]-np.nanmin(px[:,0]),py[:,0]-np.nanmin(py[:,0]),'d');
    plt.plot(px[ipart, -1] - coord[2] - base,
             py[ipart, -1] - coord[0] - base,
             'o',
             markersize=5,
             markerfacecolor='white')
    del salt
    plt.title('depth = ' + format(whichdepth))
    plt.savefig(fifig + 'selection.png')
Beispiel #2
0
    ###################################################################################
    # Get positions (px,py,pz) from pyticle file
    ###################################################################################
    #nc = Dataset(ncfile, 'r')

    px = ionetcdf.get(ncfile, 'px', simul, time=itime)
    py = ionetcdf.get(ncfile, 'py', simul, time=itime)
    pz = ionetcdf.get(ncfile, 'pz', simul, time=itime)

    #nc.close()
    print('load px,py,pz.................', tm.time() - tstart)
    tstart = tm.time()

    coord = part.subsection(px,
                            py,
                            ny=simul.coordmax[1],
                            nx=simul.coordmax[3],
                            offset=10)

    ###################################################################################
    # Get depth (z_w) from simulation file
    ###################################################################################
    [_, z_w] = part.get_depths(simul,
                               coord=coord,
                               x_periodic=x_periodic,
                               y_periodic=y_periodic,
                               ng=ng)
    del _

    if not meanflow and alpha_time != 0:
        simul.update(np.ceil(filetime))
Beispiel #3
0
################################################################################
if (nq / nproc) < 10:
    print('----------------------------------------------------')
    print(f'WARNING : Multiprocessing Issue')
    print('number of particles too small relatively to nprocs')
    print(f'in subranges')
    print('use less procs')
    print('----------------------------------------------------')
    #  [nq/nprocs > nprocs-1]
print(' ')
print(' ')
tstart = tm.time()

###############################
time = timerange[0] - dfile
coord = part.subsection(px, py, nx=nx, ny=ny, offset=50)
run_process(plot_selection)
###############################

#Initialization
pm_s = np.array([])

itime = restart_time

for time in timerange:
    print(
        '--------------------------------------------------------------------')
    print(' time is ', time)
    print(
        '--------------------------------------------------------------------')