4
$\begingroup$

I'm trying to plot a windrose but I don't know how to get the variables ws and wd. Is there any variable in the wrf output that can be used to make a windrose?

I tried with 'wspd' et 'wdir' but I coudn't make my figure.

This is my code:

 # Open the NetCDF file
ncfile = Dataset("wrfout_d03_2017-06-17_15:00:00")


# Extract the pressure, geopotential height, and wind variables


p = getvar(ncfile, "pressure")
z = getvar(ncfile, "z", units="m")
u = getvar(ncfile, "ua", units="m s-1")
v = getvar(ncfile, "va", units="m s-1")
#wspd = getvar(ncfile, "wspd_wdir", units="m s-1")[0,:]



ws = getvar(ncfile, "wspd")[:]
wd = getvar(ncfile, "wdir")[:]


fig=plt.figure()

ax = WindroseAxes.from_ax()
ax.bar(ws, wd, normed=True, opening=0.8, edgecolor='white')
ax.set_legend()


plt.show()

This is the header of the netCDF file:

netcdf wrfout_d03_2017-06-17_19\:05\:00 {
dimensions:
    Time = UNLIMITED ; // (1 currently)
    DateStrLen = 19 ;
    west_east = 486 ;
    south_north = 429 ;
    bottom_top = 47 ;
    bottom_top_stag = 48 ;
    soil_layers_stag = 4 ;
    west_east_stag = 487 ;
    south_north_stag = 430 ;
variables:
    char Times(Time, DateStrLen) ;
    float XLAT(Time, south_north, west_east) ;
        XLAT:FieldType = 104 ;
        XLAT:MemoryOrder = "XY " ;
        XLAT:description = "LATITUDE, SOUTH IS NEGATIVE" ;
        XLAT:units = "degree_north" ;
        XLAT:stagger = "" ;
        XLAT:coordinates = "XLONG XLAT" ;
    float XLONG(Time, south_north, west_east) ;
        XLONG:FieldType = 104 ;
        XLONG:MemoryOrder = "XY " ;
        XLONG:description = "LONGITUDE, WEST IS NEGATIVE" ;
        XLONG:units = "degree_east" ;
        XLONG:stagger = "" ;
        XLONG:coordinates = "XLONG XLAT" ;
    float LU_INDEX(Time, south_north, west_east) ;
        LU_INDEX:FieldType = 104 ;
        LU_INDEX:MemoryOrder = "XY " ;
        LU_INDEX:description = "LAND USE CATEGORY" ;
        LU_INDEX:units = "" ;
        LU_INDEX:stagger = "" ;
        LU_INDEX:coordinates = "XLONG XLAT XTIME" ;
    float ZNU(Time, bottom_top) ;
        ZNU:FieldType = 104 ;
        ZNU:MemoryOrder = "Z  " ;
        ZNU:description = "eta values on half (mass) levels" ;
        ZNU:units = "" ;
        ZNU:stagger = "" ;
    float ZNW(Time, bottom_top_stag) ;
        ZNW:FieldType = 104 ;
        ZNW:MemoryOrder = "Z  " ;
        ZNW:description = "eta values on full (w) levels" ;
        ZNW:units = "" ;
        ZNW:stagger = "Z" ;
    float ZS(Time, soil_layers_stag) ;
        ZS:FieldType = 104 ;
        ZS:MemoryOrder = "Z  " ;
        ZS:description = "DEPTHS OF CENTERS OF SOIL LAYERS" ;
        ZS:units = "m" ;
        ZS:stagger = "Z" ;
    float DZS(Time, soil_layers_stag) ;
        DZS:FieldType = 104 ;
        DZS:MemoryOrder = "Z  " ;
        DZS:description = "THICKNESSES OF SOIL LAYERS" ;
        DZS:units = "m" ;
        DZS:stagger = "Z" ;
    float VAR_SSO(Time, south_north, west_east) ;
        VAR_SSO:FieldType = 104 ;
        VAR_SSO:MemoryOrder = "XY " ;
        VAR_SSO:description = "variance of subgrid-scale orography" ;
        VAR_SSO:units = "m2" ;
        VAR_SSO:stagger = "" ;
        VAR_SSO:coordinates = "XLONG XLAT XTIME" ;
    float U(Time, bottom_top, south_north, west_east_stag) ;
        U:FieldType = 104 ;
        U:MemoryOrder = "XYZ" ;
        U:description = "x-wind component" ;
        U:units = "m s-1" ;
        U:stagger = "X" ;
        U:coordinates = "XLONG_U XLAT_U XTIME" ;
    float V(Time, bottom_top, south_north_stag, west_east) ;
        V:FieldType = 104 ;
        V:MemoryOrder = "XYZ" ;
        V:description = "y-wind component" ;
        V:units = "m s-1" ;
        V:stagger = "Y" ;
        V:coordinates = "XLONG_V XLAT_V XTIME" ;
    float W(Time, bottom_top_stag, south_north, west_east) ;
        W:FieldType = 104 ;
        W:MemoryOrder = "XYZ" ;
        W:description = "z-wind component" ;
        W:units = "m s-1" ;
        W:stagger = "Z" ;
        W:coordinates = "XLONG XLAT XTIME" ;
    float PH(Time, bottom_top_stag, south_north, west_east) ;
        PH:FieldType = 104 ;
        PH:MemoryOrder = "XYZ" ;
        PH:description = "perturbation geopotential" ;
        PH:units = "m2 s-2" ;
        PH:stagger = "Z" ;
        PH:coordinates = "XLONG XLAT XTIME" ;
    float PHB(Time, bottom_top_stag, south_north, west_east) ;
        PHB:FieldType = 104 ;
        PHB:MemoryOrder = "XYZ" ;
        PHB:description = "base-state geopotential" ;
        PHB:units = "m2 s-2" ;
        PHB:stagger = "Z" ;
        PHB:coordinates = "XLONG XLAT XTIME" ;
    float T(Time, bottom_top, south_north, west_east) ;
        T:FieldType = 104 ;
        T:MemoryOrder = "XYZ" ;
        T:description = "perturbation potential temperature (theta-t0)" ;
        T:units = "K" ;
        T:stagger = "" ;
        T:coordinates = "XLONG XLAT XTIME" ;
    float HFX_FORCE(Time) ;
        HFX_FORCE:FieldType = 104 ;
        HFX_FORCE:MemoryOrder = "0  " ;
        HFX_FORCE:description = "SCM ideal surface sensible heat flux" ;
        HFX_FORCE:units = "W m-2" ;
        HFX_FORCE:stagger = "" ;
    float LH_FORCE(Time) ;
        LH_FORCE:FieldType = 104 ;
        LH_FORCE:MemoryOrder = "0  " ;
        LH_FORCE:description = "SCM ideal surface latent heat flux" ;
        LH_FORCE:units = "W m-2" ;
        LH_FORCE:stagger = "" ;
    float TSK_FORCE(Time) ;
        TSK_FORCE:FieldType = 104 ;
        TSK_FORCE:MemoryOrder = "0  " ;
        TSK_FORCE:description = "SCM ideal surface skin temperature" ;
        TSK_FORCE:units = "W m-2" ;
        TSK_FORCE:stagger = "" ;
    float HFX_FORCE_TEND(Time) ;
        HFX_FORCE_TEND:FieldType = 104 ;
        HFX_FORCE_TEND:MemoryOrder = "0  " ;
        HFX_FORCE_TEND:description = "SCM ideal surface sensible heat flux tendency" ;
        HFX_FORCE_TEND:units = "W m-2 s-1" ;
        HFX_FORCE_TEND:stagger = "" ;
    float LH_FORCE_TEND(Time) ;
        LH_FORCE_TEND:FieldType = 104 ;
        LH_FORCE_TEND:MemoryOrder = "0  " ;
        LH_FORCE_TEND:description = "SCM ideal surface latent heat flux tendency" ;
        LH_FORCE_TEND:units = "W m-2 s-1" ;
        LH_FORCE_TEND:stagger = "" ;
    float TSK_FORCE_TEND(Time) ;
        TSK_FORCE_TEND:FieldType = 104 ;
        TSK_FORCE_TEND:MemoryOrder = "0  " ;
        TSK_FORCE_TEND:description = "SCM ideal surface skin temperature tendency" ;
        TSK_FORCE_TEND:units = "W m-2 s-1" ;
        TSK_FORCE_TEND:stagger = "" ;
    float MU(Time, south_north, west_east) ;
        MU:FieldType = 104 ;
        MU:MemoryOrder = "XY " ;
        MU:description = "perturbation dry air mass in column" ;
        MU:units = "Pa" ;
        MU:stagger = "" ;
        MU:coordinates = "XLONG XLAT XTIME" ;
    float MUB(Time, south_north, west_east) ;
        MUB:FieldType = 104 ;
        MUB:MemoryOrder = "XY " ;
        MUB:description = "base state dry air mass in column" ;
        MUB:units = "Pa" ;
        MUB:stagger = "" ;
        MUB:coordinates = "XLONG XLAT XTIME" ;
    float NEST_POS(Time, south_north, west_east) ;
        NEST_POS:FieldType = 104 ;
        NEST_POS:MemoryOrder = "XY " ;
        NEST_POS:description = "-" ;
        NEST_POS:units = "-" ;
        NEST_POS:stagger = "" ;
        NEST_POS:coordinates = "XLONG XLAT XTIME" ;
    float P(Time, bottom_top, south_north, west_east) ;
        P:FieldType = 104 ;
        P:MemoryOrder = "XYZ" ;
        P:description = "perturbation pressure" ;
        P:units = "Pa" ;
        P:stagger = "" ;
        P:coordinates = "XLONG XLAT XTIME" ;
    float PB(Time, bottom_top, south_north, west_east) ;
        PB:FieldType = 104 ;
        PB:MemoryOrder = "XYZ" ;
        PB:description = "BASE STATE PRESSURE" ;
        PB:units = "Pa" ;
        PB:stagger = "" ;
        PB:coordinates = "XLONG XLAT XTIME" ;
    float FNM(Time, bottom_top) ;
        FNM:FieldType = 104 ;
        FNM:MemoryOrder = "Z  " ;
        FNM:description = "upper weight for vertical stretching" ;
        FNM:units = "" ;
        FNM:stagger = "" ;
    float FNP(Time, bottom_top) ;
        FNP:FieldType = 104 ;
        FNP:MemoryOrder = "Z  " ;
        FNP:description = "lower weight for vertical stretching" ;
        FNP:units = "" ;
        FNP:stagger = "" ;
    float RDNW(Time, bottom_top) ;
        RDNW:FieldType = 104 ;
        RDNW:MemoryOrder = "Z  " ;
        RDNW:description = "inverse d(eta) values between full (w) levels" ;
        RDNW:units = "" ;
        RDNW:stagger = "" ;
    float RDN(Time, bottom_top) ;
        RDN:FieldType = 104 ;
        RDN:MemoryOrder = "Z  " ;
        RDN:description = "inverse d(eta) values between half (mass) levels" ;
        RDN:units = "" ;
        RDN:stagger = "" ;
    float DNW(Time, bottom_top) ;
        DNW:FieldType = 104 ;
        DNW:MemoryOrder = "Z  " ;
        DNW:description = "d(eta) values between full (w) levels" ;
        DNW:units = "" ;
        DNW:stagger = "" ;
    float DN(Time, bottom_top) ;
        DN:FieldType = 104 ;
        DN:MemoryOrder = "Z  " ;
        DN:description = "d(eta) values between half (mass) levels" ;
        DN:units = "" ;
        DN:stagger = "" ;
    float CFN(Time) ;
        CFN:FieldType = 104 ;
        CFN:MemoryOrder = "0  " ;
        CFN:description = "extrapolation constant" ;
        CFN:units = "" ;
        CFN:stagger = "" ;
    float CFN1(Time) ;
        CFN1:FieldType = 104 ;
        CFN1:MemoryOrder = "0  " ;
        CFN1:description = "extrapolation constant" ;
        CFN1:units = "" ;
        CFN1:stagger = "" ;
    int THIS_IS_AN_IDEAL_RUN(Time) ;
        THIS_IS_AN_IDEAL_RUN:FieldType = 106 ;
        THIS_IS_AN_IDEAL_RUN:MemoryOrder = "0  " ;
        THIS_IS_AN_IDEAL_RUN:description = "T/F flag: this is an ARW ideal simulation" ;
        THIS_IS_AN_IDEAL_RUN:units = "-" ;
        THIS_IS_AN_IDEAL_RUN:stagger = "" ;
    float P_HYD(Time, bottom_top, south_north, west_east) ;
        P_HYD:FieldType = 104 ;
        P_HYD:MemoryOrder = "XYZ" ;
        P_HYD:description = "hydrostatic pressure" ;
        P_HYD:units = "Pa" ;
        P_HYD:stagger = "" ;
        P_HYD:coordinates = "XLONG XLAT XTIME" ;
    float Q2(Time, south_north, west_east) ;
        Q2:FieldType = 104 ;
        Q2:MemoryOrder = "XY " ;
        Q2:description = "QV at 2 M" ;
        Q2:units = "kg kg-1" ;
        Q2:stagger = "" ;
        Q2:coordinates = "XLONG XLAT XTIME" ;
    float T2(Time, south_north, west_east) ;
        T2:FieldType = 104 ;
        T2:MemoryOrder = "XY " ;
        T2:description = "TEMP at 2 M" ;
        T2:units = "K" ;
        T2:stagger = "" ;
        T2:coordinates = "XLONG XLAT XTIME" ;
    float TH2(Time, south_north, west_east) ;
        TH2:FieldType = 104 ;
        TH2:MemoryOrder = "XY " ;
        TH2:description = "POT TEMP at 2 M" ;
        TH2:units = "K" ;
        TH2:stagger = "" ;
        TH2:coordinates = "XLONG XLAT XTIME" ;
    float PSFC(Time, south_north, west_east) ;
        PSFC:FieldType = 104 ;
        PSFC:MemoryOrder = "XY " ;
        PSFC:description = "SFC PRESSURE" ;
        PSFC:units = "Pa" ;
        PSFC:stagger = "" ;
        PSFC:coordinates = "XLONG XLAT XTIME" ;
    float U10(Time, south_north, west_east) ;
        U10:FieldType = 104 ;
        U10:MemoryOrder = "XY " ;
        U10:description = "U at 10 M" ;
        U10:units = "m s-1" ;
        U10:stagger = "" ;
        U10:coordinates = "XLONG XLAT XTIME" ;
    float V10(Time, south_north, west_east) ;
        V10:FieldType = 104 ;
        V10:MemoryOrder = "XY " ;
        V10:description = "V at 10 M" ;
        V10:units = "m s-1" ;
        V10:stagger = "" ;
        V10:coordinates = "XLONG XLAT XTIME" ;
    float RDX(Time) ;
        RDX:FieldType = 104 ;
        RDX:MemoryOrder = "0  " ;
        RDX:description = "INVERSE X GRID LENGTH" ;
        RDX:units = "" ;
        RDX:stagger = "" ;
    float RDY(Time) ;
        RDY:FieldType = 104 ;
        RDY:MemoryOrder = "0  " ;
        RDY:description = "INVERSE Y GRID LENGTH" ;
        RDY:units = "" ;
        RDY:stagger = "" ;
    float RESM(Time) ;
        RESM:FieldType = 104 ;
        RESM:MemoryOrder = "0  " ;
        RESM:description = "TIME WEIGHT CONSTANT FOR SMALL STEPS" ;
        RESM:units = "" ;
        RESM:stagger = "" ;
    float ZETATOP(Time) ;
        ZETATOP:FieldType = 104 ;
        ZETATOP:MemoryOrder = "0  " ;
        ZETATOP:description = "ZETA AT MODEL TOP" ;
        ZETATOP:units = "" ;
        ZETATOP:stagger = "" ;
    float CF1(Time) ;
        CF1:FieldType = 104 ;
        CF1:MemoryOrder = "0  " ;
        CF1:description = "2nd order extrapolation constant" ;
        CF1:units = "" ;
        CF1:stagger = "" ;
    float CF2(Time) ;
        CF2:FieldType = 104 ;
        CF2:MemoryOrder = "0  " ;
        CF2:description = "2nd order extrapolation constant" ;
        CF2:units = "" ;
        CF2:stagger = "" ;
    float CF3(Time) ;
        CF3:FieldType = 104 ;
        CF3:MemoryOrder = "0  " ;
        CF3:description = "2nd order extrapolation constant" ;
        CF3:units = "" ;
        CF3:stagger = "" ;
    int ITIMESTEP(Time) ;
        ITIMESTEP:FieldType = 106 ;
        ITIMESTEP:MemoryOrder = "0  " ;
        ITIMESTEP:description = "" ;
        ITIMESTEP:units = "" ;
        ITIMESTEP:stagger = "" ;
    float XTIME(Time) ;
        XTIME:FieldType = 104 ;
        XTIME:MemoryOrder = "0  " ;
        XTIME:description = "minutes since 2017-06-17 00:00:00" ;
        XTIME:units = "minutes since 2017-06-17 00:00:00" ;
        XTIME:stagger = "" ;
    float QVAPOR(Time, bottom_top, south_north, west_east) ;
        QVAPOR:FieldType = 104 ;
        QVAPOR:MemoryOrder = "XYZ" ;
        QVAPOR:description = "Water vapor mixing ratio" ;
        QVAPOR:units = "kg kg-1" ;
        QVAPOR:stagger = "" ;
        QVAPOR:coordinates = "XLONG XLAT XTIME" ;
    float QCLOUD(Time, bottom_top, south_north, west_east) ;
        QCLOUD:FieldType = 104 ;
        QCLOUD:MemoryOrder = "XYZ" ;
        QCLOUD:description = "Cloud water mixing ratio" ;
        QCLOUD:units = "kg kg-1" ;
        QCLOUD:stagger = "" ;
        QCLOUD:coordinates = "XLONG XLAT XTIME" ;
    float QRAIN(Time, bottom_top, south_north, west_east) ;
        QRAIN:FieldType = 104 ;
        QRAIN:MemoryOrder = "XYZ" ;
        QRAIN:description = "Rain water mixing ratio" ;
        QRAIN:units = "kg kg-1" ;
        QRAIN:stagger = "" ;
        QRAIN:coordinates = "XLONG XLAT XTIME" ;
    float QICE(Time, bottom_top, south_north, west_east) ;
        QICE:FieldType = 104 ;
        QICE:MemoryOrder = "XYZ" ;
        QICE:description = "Ice mixing ratio" ;
        QICE:units = "kg kg-1" ;
        QICE:stagger = "" ;
        QICE:coordinates = "XLONG XLAT XTIME" ;
    float QSNOW(Time, bottom_top, south_north, west_east) ;
        QSNOW:FieldType = 104 ;
        QSNOW:MemoryOrder = "XYZ" ;
        QSNOW:description = "Snow mixing ratio" ;
        QSNOW:units = "kg kg-1" ;
        QSNOW:stagger = "" ;
        QSNOW:coordinates = "XLONG XLAT XTIME" ;
    float QGRAUP(Time, bottom_top, south_north, west_east) ;
        QGRAUP:FieldType = 104 ;
        QGRAUP:MemoryOrder = "XYZ" ;
        QGRAUP:description = "Graupel mixing ratio" ;
        QGRAUP:units = "kg kg-1" ;
        QGRAUP:stagger = "" ;
        QGRAUP:coordinates = "XLONG XLAT XTIME" ;
    float QNICE(Time, bottom_top, south_north, west_east) ;
        QNICE:FieldType = 104 ;
        QNICE:MemoryOrder = "XYZ" ;
        QNICE:description = "Ice Number concentration" ;
        QNICE:units = "  kg-1" ;
        QNICE:stagger = "" ;
        QNICE:coordinates = "XLONG XLAT XTIME" ;
    float QNRAIN(Time, bottom_top, south_north, west_east) ;
        QNRAIN:FieldType = 104 ;
        QNRAIN:MemoryOrder = "XYZ" ;
        QNRAIN:description = "Rain Number concentration" ;
        QNRAIN:units = "  kg(-1)" ;
        QNRAIN:stagger = "" ;
        QNRAIN:coordinates = "XLONG XLAT XTIME" ;
    float SHDMAX(Time, south_north, west_east) ;
        SHDMAX:FieldType = 104 ;
        SHDMAX:MemoryOrder = "XY " ;
        SHDMAX:description = "ANNUAL MAX VEG FRACTION" ;
        SHDMAX:units = "" ;
        SHDMAX:stagger = "" ;
        SHDMAX:coordinates = "XLONG XLAT XTIME" ;
    float SHDMIN(Time, south_north, west_east) ;
        SHDMIN:FieldType = 104 ;
        SHDMIN:MemoryOrder = "XY " ;
        SHDMIN:description = "ANNUAL MIN VEG FRACTION" ;
        SHDMIN:units = "" ;
        SHDMIN:stagger = "" ;
        SHDMIN:coordinates = "XLONG XLAT XTIME" ;
    float SNOALB(Time, south_north, west_east) ;
        SNOALB:FieldType = 104 ;
        SNOALB:MemoryOrder = "XY " ;
        SNOALB:description = "ANNUAL MAX SNOW ALBEDO IN FRACTION" ;
        SNOALB:units = "" ;
        SNOALB:stagger = "" ;
        SNOALB:coordinates = "XLONG XLAT XTIME" ;
    float TSLB(Time, soil_layers_stag, south_north, west_east) ;
        TSLB:FieldType = 104 ;
        TSLB:MemoryOrder = "XYZ" ;
        TSLB:description = "SOIL TEMPERATURE" ;
        TSLB:units = "K" ;
        TSLB:stagger = "Z" ;
        TSLB:coordinates = "XLONG XLAT XTIME" ;
    float SMOIS(Time, soil_layers_stag, south_north, west_east) ;
        SMOIS:FieldType = 104 ;
        SMOIS:MemoryOrder = "XYZ" ;
        SMOIS:description = "SOIL MOISTURE" ;
        SMOIS:units = "m3 m-3" ;
        SMOIS:stagger = "Z" ;
        SMOIS:coordinates = "XLONG XLAT XTIME" ;
    float SH2O(Time, soil_layers_stag, south_north, west_east) ;
        SH2O:FieldType = 104 ;
        SH2O:MemoryOrder = "XYZ" ;
        SH2O:description = "SOIL LIQUID WATER" ;
        SH2O:units = "m3 m-3" ;
        SH2O:stagger = "Z" ;
        SH2O:coordinates = "XLONG XLAT XTIME" ;
    float SMCREL(Time, soil_layers_stag, south_north, west_east) ;
        SMCREL:FieldType = 104 ;
        SMCREL:MemoryOrder = "XYZ" ;
        SMCREL:description = "RELATIVE SOIL MOISTURE" ;
        SMCREL:units = "" ;
        SMCREL:stagger = "Z" ;
        SMCREL:coordinates = "XLONG XLAT XTIME" ;
    float SEAICE(Time, south_north, west_east) ;
        SEAICE:FieldType = 104 ;
        SEAICE:MemoryOrder = "XY " ;
        SEAICE:description = "SEA ICE FLAG" ;
        SEAICE:units = "" ;
        SEAICE:stagger = "" ;
        SEAICE:coordinates = "XLONG XLAT XTIME" ;
    float XICEM(Time, south_north, west_east) ;
        XICEM:FieldType = 104 ;
        XICEM:MemoryOrder = "XY " ;
        XICEM:description = "SEA ICE FLAG (PREVIOUS STEP)" ;
        XICEM:units = "" ;
        XICEM:stagger = "" ;
        XICEM:coordinates = "XLONG XLAT XTIME" ;
    float SFROFF(Time, south_north, west_east) ;
        SFROFF:FieldType = 104 ;
        SFROFF:MemoryOrder = "XY " ;
        SFROFF:description = "SURFACE RUNOFF" ;
        SFROFF:units = "mm" ;
        SFROFF:stagger = "" ;
        SFROFF:coordinates = "XLONG XLAT XTIME" ;
    float UDROFF(Time, south_north, west_east) ;
        UDROFF:FieldType = 104 ;
        UDROFF:MemoryOrder = "XY " ;
        UDROFF:description = "UNDERGROUND RUNOFF" ;
        UDROFF:units = "mm" ;
        UDROFF:stagger = "" ;
        UDROFF:coordinates = "XLONG XLAT XTIME" ;
    int IVGTYP(Time, south_north, west_east) ;
        IVGTYP:FieldType = 106 ;
        IVGTYP:MemoryOrder = "XY " ;
        IVGTYP:description = "DOMINANT VEGETATION CATEGORY" ;
        IVGTYP:units = "" ;
        IVGTYP:stagger = "" ;
        IVGTYP:coordinates = "XLONG XLAT XTIME" ;
    int ISLTYP(Time, south_north, west_east) ;
        ISLTYP:FieldType = 106 ;
        ISLTYP:MemoryOrder = "XY " ;
        ISLTYP:description = "DOMINANT SOIL CATEGORY" ;
        ISLTYP:units = "" ;
        ISLTYP:stagger = "" ;
        ISLTYP:coordinates = "XLONG XLAT XTIME" ;
    float VEGFRA(Time, south_north, west_east) ;
        VEGFRA:FieldType = 104 ;
        VEGFRA:MemoryOrder = "XY " ;
        VEGFRA:description = "VEGETATION FRACTION" ;
        VEGFRA:units = "" ;
        VEGFRA:stagger = "" ;
        VEGFRA:coordinates = "XLONG XLAT XTIME" ;
    float GRDFLX(Time, south_north, west_east) ;
        GRDFLX:FieldType = 104 ;
        GRDFLX:MemoryOrder = "XY " ;
        GRDFLX:description = "GROUND HEAT FLUX" ;
        GRDFLX:units = "W m-2" ;
        GRDFLX:stagger = "" ;
        GRDFLX:coordinates = "XLONG XLAT XTIME" ;
    float ACGRDFLX(Time, south_north, west_east) ;
        ACGRDFLX:FieldType = 104 ;
        ACGRDFLX:MemoryOrder = "XY " ;
        ACGRDFLX:description = "ACCUMULATED GROUND HEAT FLUX" ;
        ACGRDFLX:units = "J m-2" ;
        ACGRDFLX:stagger = "" ;
        ACGRDFLX:coordinates = "XLONG XLAT XTIME" ;
    float ACSNOM(Time, south_north, west_east) ;
        ACSNOM:FieldType = 104 ;
        ACSNOM:MemoryOrder = "XY " ;
        ACSNOM:description = "ACCUMULATED MELTED SNOW" ;
        ACSNOM:units = "kg m-2" ;
        ACSNOM:stagger = "" ;
        ACSNOM:coordinates = "XLONG XLAT XTIME" ;
    float SNOW(Time, south_north, west_east) ;
        SNOW:FieldType = 104 ;
        SNOW:MemoryOrder = "XY " ;
        SNOW:description = "SNOW WATER EQUIVALENT" ;
        SNOW:units = "kg m-2" ;
        SNOW:stagger = "" ;
        SNOW:coordinates = "XLONG XLAT XTIME" ;
    float SNOWH(Time, south_north, west_east) ;
        SNOWH:FieldType = 104 ;
        SNOWH:MemoryOrder = "XY " ;
        SNOWH:description = "PHYSICAL SNOW DEPTH" ;
        SNOWH:units = "m" ;
        SNOWH:stagger = "" ;
        SNOWH:coordinates = "XLONG XLAT XTIME" ;
    float CANWAT(Time, south_north, west_east) ;
        CANWAT:FieldType = 104 ;
        CANWAT:MemoryOrder = "XY " ;
        CANWAT:description = "CANOPY WATER" ;
        CANWAT:units = "kg m-2" ;
        CANWAT:stagger = "" ;
        CANWAT:coordinates = "XLONG XLAT XTIME" ;
    float SSTSK(Time, south_north, west_east) ;
        SSTSK:FieldType = 104 ;
        SSTSK:MemoryOrder = "XY " ;
        SSTSK:description = "SKIN SEA SURFACE TEMPERATURE" ;
        SSTSK:units = "K" ;
        SSTSK:stagger = "" ;
        SSTSK:coordinates = "XLONG XLAT XTIME" ;
    float COSZEN(Time, south_north, west_east) ;
        COSZEN:FieldType = 104 ;
        COSZEN:MemoryOrder = "XY " ;
        COSZEN:description = "COS of SOLAR ZENITH ANGLE" ;
        COSZEN:units = "dimensionless" ;
        COSZEN:stagger = "" ;
        COSZEN:coordinates = "XLONG XLAT XTIME" ;
    float LAI(Time, south_north, west_east) ;
        LAI:FieldType = 104 ;
        LAI:MemoryOrder = "XY " ;
        LAI:description = "LEAF AREA INDEX" ;
        LAI:units = "m-2/m-2" ;
        LAI:stagger = "" ;
        LAI:coordinates = "XLONG XLAT XTIME" ;
    float VAR(Time, south_north, west_east) ;
        VAR:FieldType = 104 ;
        VAR:MemoryOrder = "XY " ;
        VAR:description = "OROGRAPHIC VARIANCE" ;
        VAR:units = "" ;
        VAR:stagger = "" ;
        VAR:coordinates = "XLONG XLAT XTIME" ;
    float MAPFAC_M(Time, south_north, west_east) ;
        MAPFAC_M:FieldType = 104 ;
        MAPFAC_M:MemoryOrder = "XY " ;
        MAPFAC_M:description = "Map scale factor on mass grid" ;
        MAPFAC_M:units = "" ;
        MAPFAC_M:stagger = "" ;
        MAPFAC_M:coordinates = "XLONG XLAT XTIME" ;
    float MAPFAC_U(Time, south_north, west_east_stag) ;
        MAPFAC_U:FieldType = 104 ;
        MAPFAC_U:MemoryOrder = "XY " ;
        MAPFAC_U:description = "Map scale factor on u-grid" ;
        MAPFAC_U:units = "" ;
        MAPFAC_U:stagger = "X" ;
        MAPFAC_U:coordinates = "XLONG_U XLAT_U XTIME" ;
    float MAPFAC_V(Time, south_north_stag, west_east) ;
        MAPFAC_V:FieldType = 104 ;
        MAPFAC_V:MemoryOrder = "XY " ;
        MAPFAC_V:description = "Map scale factor on v-grid" ;
        MAPFAC_V:units = "" ;
        MAPFAC_V:stagger = "Y" ;
        MAPFAC_V:coordinates = "XLONG_V XLAT_V XTIME" ;
    float MAPFAC_MX(Time, south_north, west_east) ;
        MAPFAC_MX:FieldType = 104 ;
        MAPFAC_MX:MemoryOrder = "XY " ;
        MAPFAC_MX:description = "Map scale factor on mass grid, x direction" ;
        MAPFAC_MX:units = "" ;
        MAPFAC_MX:stagger = "" ;
        MAPFAC_MX:coordinates = "XLONG XLAT XTIME" ;
    float MAPFAC_MY(Time, south_north, west_east) ;
        MAPFAC_MY:FieldType = 104 ;
        MAPFAC_MY:MemoryOrder = "XY " ;
        MAPFAC_MY:description = "Map scale factor on mass grid, y direction" ;
        MAPFAC_MY:units = "" ;
        MAPFAC_MY:stagger = "" ;
        MAPFAC_MY:coordinates = "XLONG XLAT XTIME" ;
    float MAPFAC_UX(Time, south_north, west_east_stag) ;
        MAPFAC_UX:FieldType = 104 ;
        MAPFAC_UX:MemoryOrder = "XY " ;
        MAPFAC_UX:description = "Map scale factor on u-grid, x direction" ;
        MAPFAC_UX:units = "" ;
        MAPFAC_UX:stagger = "X" ;
        MAPFAC_UX:coordinates = "XLONG_U XLAT_U XTIME" ;
    float MAPFAC_UY(Time, south_north, west_east_stag) ;
        MAPFAC_UY:FieldType = 104 ;
        MAPFAC_UY:MemoryOrder = "XY " ;
        MAPFAC_UY:description = "Map scale factor on u-grid, y direction" ;
        MAPFAC_UY:units = "" ;
        MAPFAC_UY:stagger = "X" ;
        MAPFAC_UY:coordinates = "XLONG_U XLAT_U XTIME" ;
    float MAPFAC_VX(Time, south_north_stag, west_east) ;
        MAPFAC_VX:FieldType = 104 ;
        MAPFAC_VX:MemoryOrder = "XY " ;
        MAPFAC_VX:description = "Map scale factor on v-grid, x direction" ;
        MAPFAC_VX:units = "" ;
        MAPFAC_VX:stagger = "Y" ;
        MAPFAC_VX:coordinates = "XLONG_V XLAT_V XTIME" ;
    float MF_VX_INV(Time, south_north_stag, west_east) ;
        MF_VX_INV:FieldType = 104 ;
        MF_VX_INV:MemoryOrder = "XY " ;
        MF_VX_INV:description = "Inverse map scale factor on v-grid, x direction" ;
        MF_VX_INV:units = "" ;
        MF_VX_INV:stagger = "Y" ;
        MF_VX_INV:coordinates = "XLONG_V XLAT_V XTIME" ;
    float MAPFAC_VY(Time, south_north_stag, west_east) ;
        MAPFAC_VY:FieldType = 104 ;
        MAPFAC_VY:MemoryOrder = "XY " ;
        MAPFAC_VY:description = "Map scale factor on v-grid, y direction" ;
        MAPFAC_VY:units = "" ;
        MAPFAC_VY:stagger = "Y" ;
        MAPFAC_VY:coordinates = "XLONG_V XLAT_V XTIME" ;
    float F(Time, south_north, west_east) ;
        F:FieldType = 104 ;
        F:MemoryOrder = "XY " ;
        F:description = "Coriolis sine latitude term" ;
        F:units = "s-1" ;
        F:stagger = "" ;
        F:coordinates = "XLONG XLAT XTIME" ;
    float E(Time, south_north, west_east) ;
        E:FieldType = 104 ;
        E:MemoryOrder = "XY " ;
        E:description = "Coriolis cosine latitude term" ;
        E:units = "s-1" ;
        E:stagger = "" ;
        E:coordinates = "XLONG XLAT XTIME" ;
    float SINALPHA(Time, south_north, west_east) ;
        SINALPHA:FieldType = 104 ;
        SINALPHA:MemoryOrder = "XY " ;
        SINALPHA:description = "Local sine of map rotation" ;
        SINALPHA:units = "" ;
        SINALPHA:stagger = "" ;
        SINALPHA:coordinates = "XLONG XLAT XTIME" ;
    float COSALPHA(Time, south_north, west_east) ;
        COSALPHA:FieldType = 104 ;
        COSALPHA:MemoryOrder = "XY " ;
        COSALPHA:description = "Local cosine of map rotation" ;
        COSALPHA:units = "" ;
        COSALPHA:stagger = "" ;
        COSALPHA:coordinates = "XLONG XLAT XTIME" ;
    float HGT(Time, south_north, west_east) ;
        HGT:FieldType = 104 ;
        HGT:MemoryOrder = "XY " ;
        HGT:description = "Terrain Height" ;
        HGT:units = "m" ;
        HGT:stagger = "" ;
        HGT:coordinates = "XLONG XLAT XTIME" ;
    float TSK(Time, south_north, west_east) ;
        TSK:FieldType = 104 ;
        TSK:MemoryOrder = "XY " ;
        TSK:description = "SURFACE SKIN TEMPERATURE" ;
        TSK:units = "K" ;
        TSK:stagger = "" ;
        TSK:coordinates = "XLONG XLAT XTIME" ;
    float P_TOP(Time) ;
        P_TOP:FieldType = 104 ;
        P_TOP:MemoryOrder = "0  " ;
        P_TOP:description = "PRESSURE TOP OF THE MODEL" ;
        P_TOP:units = "Pa" ;
        P_TOP:stagger = "" ;
    float T00(Time) ;
        T00:FieldType = 104 ;
        T00:MemoryOrder = "0  " ;
        T00:description = "BASE STATE TEMPERATURE" ;
        T00:units = "K" ;
        T00:stagger = "" ;
    float P00(Time) ;
        P00:FieldType = 104 ;
        P00:MemoryOrder = "0  " ;
        P00:description = "BASE STATE PRESURE" ;
        P00:units = "Pa" ;
        P00:stagger = "" ;
    float TLP(Time) ;
        TLP:FieldType = 104 ;
        TLP:MemoryOrder = "0  " ;
        TLP:description = "BASE STATE LAPSE RATE" ;
        TLP:units = "" ;
        TLP:stagger = "" ;
    float TISO(Time) ;
        TISO:FieldType = 104 ;
        TISO:MemoryOrder = "0  " ;
        TISO:description = "TEMP AT WHICH THE BASE T TURNS CONST" ;
        TISO:units = "K" ;
        TISO:stagger = "" ;
    float TLP_STRAT(Time) ;
        TLP_STRAT:FieldType = 104 ;
        TLP_STRAT:MemoryOrder = "0  " ;
        TLP_STRAT:description = "BASE STATE LAPSE RATE (DT/D(LN(P)) IN STRATOSPHERE" ;
        TLP_STRAT:units = "K" ;
        TLP_STRAT:stagger = "" ;
    float P_STRAT(Time) ;
        P_STRAT:FieldType = 104 ;
        P_STRAT:MemoryOrder = "0  " ;
        P_STRAT:description = "BASE STATE PRESSURE AT BOTTOM OF STRATOSPHERE" ;
        P_STRAT:units = "Pa" ;
        P_STRAT:stagger = "" ;
    float MAX_MSTFX(Time) ;
        MAX_MSTFX:FieldType = 104 ;
        MAX_MSTFX:MemoryOrder = "0  " ;
        MAX_MSTFX:description = "Max map factor in domain" ;
        MAX_MSTFX:units = "" ;
        MAX_MSTFX:stagger = "" ;
    float MAX_MSTFY(Time) ;
        MAX_MSTFY:FieldType = 104 ;
        MAX_MSTFY:MemoryOrder = "0  " ;
        MAX_MSTFY:description = "Max map factor in domain" ;
        MAX_MSTFY:units = "" ;
        MAX_MSTFY:stagger = "" ;
    float RAINC(Time, south_north, west_east) ;
        RAINC:FieldType = 104 ;
        RAINC:MemoryOrder = "XY " ;
        RAINC:description = "ACCUMULATED TOTAL CUMULUS PRECIPITATION" ;
        RAINC:units = "mm" ;
        RAINC:stagger = "" ;
        RAINC:coordinates = "XLONG XLAT XTIME" ;
    float RAINSH(Time, south_north, west_east) ;
        RAINSH:FieldType = 104 ;
        RAINSH:MemoryOrder = "XY " ;
        RAINSH:description = "ACCUMULATED SHALLOW CUMULUS
$\endgroup$
  • $\begingroup$ It will be useful if you could add more details. Are you getting errors? Please also format your question better and post the full code. You must be importing something. I have never used the pywrf module, but as far as I recall isn't the wrfout file 3-dimensional for 10m wind speed? So you need something like wd = getvar(ncfile, "wdir")[:,:,:]? $\endgroup$ – Whir Mar 11 at 15:51
  • $\begingroup$ Please also post the header of the netCDF file ncdump -h wrfout_d03_2017-06-17_15:00:00. $\endgroup$ – daniel.heydebreck Mar 11 at 20:29
  • $\begingroup$ The bar functions of an instance of WindroseAxes seems to expect the wind direction wd, first, and, then, the wind speed ws according to this example from the windrose documentation. It is the other way around in your code. $\endgroup$ – daniel.heydebreck Mar 11 at 20:31
  • $\begingroup$ wrfout files won't have wind direction as a single value as far as I know. They will have u,v components with which you can calculate wind direction. NCL has a function for that... ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml Though GeoCAT looks to be the future for that group wrf-python.readthedocs.io/en/latest/internal_api/… $\endgroup$ – farrenthorpe Mar 12 at 4:47
  • $\begingroup$ Thanks for the answers everybody. $\endgroup$ – Diana Arteaga Mar 19 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.