Exemple #1
0
def skewTPlot(nest, time):
    """
     This is the method to use from the outside
     
     nest: The nesting level of the nc-file from WRF 
     time: The time for which to plot
    """
    nc = openWRF(nest)
    _Nx, _Ny, _Nz, _longs, _lats, _dx, _dy, x, y = getDimensions(nc)

    plt.figure()
    _isotherms()
    _isobars()
    _dry_adiabats()
    _moist_adiabats()

    P = nc.variables['P'][time, :, y, x] + nc.variables['PB'][time, :, y, x]

    _windbarbs(nc, time, y, x, P)
    _temperature(nc, time, y, x, P)
    _dewpoint(nc, time, y, x, P)

    plt.axis([-40, 50, P_b, P_t])
    plt.xlabel('Temperatur ($^{\circ}\! C$) ved 1000hPa')
    xticks = np.arange(-40, 51, 5)
    plt.xticks(xticks,
               ['' if tick % 10 != 0 else str(tick) for tick in xticks])
    plt.ylabel('Trykk (hPa)')
    yticks = np.arange(P_bot, P_t - 1, -10**4)
    plt.yticks(yticks, yticks / 100)

    sfcT = nc.variables['T2'][time, y, x] - T_zero
    sfcP = nc.variables['PSFC'][time, y, x]
    sfcW = nc.variables['Q2'][time, y, x]
    sfcTd = td(e(sfcW, sfcP))
    plt.suptitle('Bakketemp: %4.1f$^{\circ}\! C$  Duggpunkt: %3.1f$^{\circ}\! C$  Trykk: %5.1f hPa' % (sfcT,sfcTd,0.01*sfcP), \
                 fontsize=10, x = 0.5, y = 0.03)

    plt.show()
    plt.close()
Exemple #2
0
def skewTPlot(nest,time):   
    """
     This is the method to use from the outside
     
     nest: The nesting level of the nc-file from WRF 
     time: The time for which to plot
    """  
    nc = openWRF(nest)
    _Nx,_Ny,_Nz,_longs,_lats,_dx,_dy,x,y = getDimensions(nc)

    plt.figure()
    _isotherms()
    _isobars()
    _dry_adiabats()
    _moist_adiabats()

    P = nc.variables['P'][time,:,y,x] + nc.variables['PB'][time,:,y,x] 
    
    _windbarbs(nc,time,y,x,P)
    _temperature(nc,time,y,x,P)
    _dewpoint(nc,time,y,x,P)
    
    plt.axis([-40,50,P_b,P_t])
    plt.xlabel('Temperatur ($^{\circ}\! C$) ved 1000hPa')
    xticks = np.arange(-40,51,5)
    plt.xticks(xticks,['' if tick%10!=0 else str(tick) for tick in xticks])
    plt.ylabel('Trykk (hPa)')
    yticks = np.arange(P_bot,P_t-1,-10**4)
    plt.yticks(yticks,yticks/100)

    sfcT = nc.variables['T2'][time,y,x]-T_zero
    sfcP = nc.variables['PSFC'][time,y,x]
    sfcW = nc.variables['Q2'][time,y,x]
    sfcTd = td(e(sfcW,sfcP))
    plt.suptitle('Bakketemp: %4.1f$^{\circ}\! C$  Duggpunkt: %3.1f$^{\circ}\! C$  Trykk: %5.1f hPa' % (sfcT,sfcTd,0.01*sfcP), \
                 fontsize=10, x = 0.5, y = 0.03)        

    plt.show()
    plt.close()
Exemple #3
0
def _dewpoint(nc,time,y,x,P):
    w = nc.variables['QVAPOR'][time,:,y,x]
    plt.semilogy(td(e(w,P)) + _skewnessTerm(P), P, basey=math.e, color = 'red', \
                 linestyle='solid', linewidth = 1.5)
Exemple #4
0
def _dewpoint(nc, time, y, x, P):
    w = nc.variables['QVAPOR'][time, :, y, x]
    plt.semilogy(td(e(w,P)) + _skewnessTerm(P), P, basey=math.e, color = 'red', \
                 linestyle='solid', linewidth = 1.5)