示例#1
0
def plume_center(d, t):
    """
      Compute plume center of mass
      :param d: open NetCDF4 dataset
      :param t: number of timestep
      """
    tr = d.variables['tr17_1'][t, :, :, :]
    smoke_int = np.sum(tr, axis=0)
    z = height8p(d, t)
    h = np.sum(z * tr, axis=0)
    h[smoke_int <= smoke_threshold_int] = 0
    smoke_int[smoke_int <= smoke_threshold_int] = 1
    return h / smoke_int
示例#2
0
def plume_height(d, t):
    """
      Compute plume height 
      :param d: open NetCDF4 dataset
      :param t: number of timestep
      """
    z = height8p(d, t)
    tr = d.variables['tr17_1'][t, :, :, :]
    h = np.zeros(tr.shape[1:])
    for i in range(0, tr.shape[2]):
        for j in range(0, tr.shape[1]):
            for k in range(tr.shape[0] - 1, -1, -1):
                if tr[k, j, i] > smoke_threshold:
                    h[j, i] = z[k, j, i]
                    break
    return h
示例#3
0
def smoke_at_height(varname,d,t,level):
      s = interpolate2height(smoke_concentration(d,t),height8p(d,t),level)
      print_stats(varname,s,'ug/m^3')
      return s