變數定義
- wrf-python最強項的功能除了繪圖之外,就屬getvar函數及其內插程式。
- 引數:
(wrfin, varname, timeidx=0, method='cat', squeeze=True, cache=None, meta=True, **kwargs)wrfin: wrf檔案名稱。以netCDF4.Dataset()開啟。varnam: wrf-python使用的變數名稱(詳下表),不是wrfout檔案的變數名稱。為區別二者,前者用小寫,後者在ncf檔案中是大寫。timeidx: 時間序,0~nt-1method: 時間軸是否壓縮。'cat':保持時間軸(內設);'join':聯合(壓縮)時間軸squeeze: 如維度僅有一層在輸出矩陣的shape中是否予以去除?內設為True。cache: 將程式中反覆使用的變數暫存成矩陣名稱(varnam:ndarray),以避免反覆讀取、增加執行效能,內設為None。meta: 是否附帶數據的重要資訊(如座標等)。內設是True。Additional Keyword Arguments: 每個變數不太相同,詳下列表格。- 如果只有一種單位,就不能使用
units選項。
- 如果只有一種單位,就不能使用
- 輸出
getvar會按照新變數定義的意義輸出成帶座標系統(meta)的矩陣。
- 原表格按照字母順序排列,以下按照變數類別分類。
Dimensions and Terran
lat, lon, time
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| lat | Latitude | decimal degrees | |
| lon | Longitude | decimal degrees | |
| times | Times in the File or Sequence | ||
| xtimes | XTIME Coordinate (if applicable) |
minutes since start of model run |
Height
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| ter | Model Terrain Height | m km dm ft mi |
units (str) : Set to desired units. Default is ‘m’. |
| z/height | Model Height for Mass Grid | m km dm ft mi |
msl (boolean): Set to False to return AGL values. True is for MSL. Default is True. units (str) : Set to desired units. Default is ‘m’. |
| height_agl | Model Height for Mass Grid (AGL) | m km dm ft mi |
units (str) : Set to desired units. Default is ‘m’. |
| zstag | Model Height for Vertically Staggered Grid | m km dm ft mi |
msl (boolean): Set to False to return AGL values. True is for MSL. Default is True. units (str) : Set to desired units. Default is ‘m’. |
First order physics
Temperatures
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| eth/theta_e | Equivalent Potential Temperature | K degC degF |
units (str) : Set to desired units. Default is ‘K’. |
| ctt | Cloud Top Temperature | degC K degF |
fill_nocloud (boolean): Set to True to use fill values for cloud free regions rather than surface temperature. Default is False. missing (float): The fill value to use when fill_nocloud is True. opt_thresh (float): The optical depth required to trigger the cloud top temperature calculation. Default is 1.0. units (str) : Set to desired units. Default is ‘degC’. |
| T2 | 2m Temperature | K | |
| td2 | 2m Dew Point Temperature | degC K degF |
units (str) : Set to desired units. Default is ‘degC’. |
| td | Dew Point Temperature | degC K degF |
units (str) : Set to desired units. Default is ‘degC’. |
| tc | Temperature in Celsius | degC | |
| th/theta | Potential Temperature | K degC degF |
units (str) : Set to desired units. Default is ‘K’. |
| temp | Temperature (in specified units) | K degC degF |
units (str) : Set to desired units. Default is ‘K’. |
| tk | Temperature in Kelvin | K | |
| tv | Virtual Temperature | K degC degF |
units (str) : Set to desired units. Default is ‘K’. |
| twb | Wet Bulb Temperature | K degC degF |
units (str) : Set to desired units. Default is ‘K’. |
Pressures
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| p/pres | Full Model Pressure (in specified units) |
Pa hPa mb torr mmhg atm |
units (str) : Set to desired units. Default is ‘Pa’. |
| pressure | Full Model Pressure (hPa) | hPa | |
| slp | Sea Level Pressure | hPa hPa mb torr mmhg atm |
units (str) : Set to desired units. Default is ‘hPa’. |
Second order physics
Velocities
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| omg/omega | Omega(wiki, earthscience) | Pa s-1 | |
| ua | U-component of Wind on Mass Points | m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| va | V-component of Wind on Mass Points | m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| wa | W-component of Wind on Mass Points | m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| uvmet10 | 10 m U and V Components of Wind Rotated to Earth Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| uvmet | U and V Components of Wind Rotated to Earth Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| wspd_wdir | Wind Speed and Direction (wind_from_direction) in Grid Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| wspd_wdir10 | 10m Wind Speed and Direction (wind_from_direction) in Grid Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| uvmet_wspd_wdir | Wind Speed and Direction (wind_from_direction) Rotated to Earth Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
| uvmet10_wspd_wdir | 10m Wind Speed and Direction (wind_from_direction) Rotated to Earth Coordinates |
m s-1 km h-1 mi h-1 kt ft s-1 |
units (str) : Set to desired units. Default is ‘m s-1’. |
3rd and more orders physics
Energy
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| cape_2d | 2D CAPE, Convective Available Potential Energy, Convective Inhibition, Lifted condensation level, level of free convection (MCAPE/MCIN/LCL/LFC) | J kg-1 ; J kg-1 ; m ; m | missing (float): Fill value for output only |
| cape_3d | 3D CAPE and CIN (Convective INhibition, wiki) | J kg-1 | missing (float): Fill value for output only |
| geopt/geopotential | Geopotential for the Mass Grid | m2 s-2 | |
| geopt_stag | Geopotential for the Vertically Staggered Grid | m2 s-2 |
High Order Dynamics
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| avo | Absolute Vorticity | 10-5 s-1 | |
| pvo | Potential Vorticity | PVU | |
| helicity | Storm Relative Helicity(see ref.) | m2 s-2 | top (float): The top level for the calculation in meters. Default is 3000.0. |
| updraft_helicity | Updraft Helicity | m2 s-2 | bottom (float): The bottom level for the calculation in meters. Default is 2000.0. top (float): The top level for the calculation in meters. Default is 5000.0. |
Different Forms of Water
Vapors, Cloudness and Precipitation
| Variable Name | Description | Available Units | Additional Keyword Arguments |
|---|---|---|---|
| pw | Precipitable Water | kg m-2 | |
| rh | Relative Humidity | % | |
| rh2 | 2m Relative Humidity | % | |
| cloudfrac | Cloud Fraction | % | vert_type (str): The vertical coordinate type for the cloud thresholds. Must be ‘height_agl’, ‘height_msl’, or ‘pres’. Default is ‘height_agl’. low_thresh (float): The low cloud threshold (meters for ‘height_agl’ and ‘height_msl’, pascals for ‘pres’). Default is 300 m (97000 Pa) mid_thresh (float): The mid cloud threshold (meters for ‘height_agl’ and ‘height_msl’, pascals for ‘pres’). Default is 2000 m (80000 Pa) high_thresh (float): The high cloud threshold (meters for ‘height_agl’ and ‘height_msl’, pascals for ‘pres’). Default is 6000 m (45000 Pa) |
| dbz | Reflectivity | dBZ | do_variant (boolean): Set to True to enable variant calculation. Default is False. do_liqskin (boolean): Set to True to enable liquid skin calculation. Default is False. |
| mdbz | Maximum Reflectivity | dBZ | do_variant (boolean): Set to True to enable variant calculation. Default is False. do_liqskin (boolean): Set to True to enable liquid skin calculation. Default is False. |