Basic operations on the time dimension of netCDF data using Xarray¶
As an atmospheric data scientist, I would like to perform calculations on the time dimension of a netCDF data to answer specific questions such as:
How can I select a subset of data?
What is the state of the atmosphere at any given time?
Is it possible to calculate daily or hourly averages for the given time period in the dataset?
Open Data¶
For our analyses, we are going to use the GFS hourly forecast data initialized at 00UTC, 10 October 2021. The use of visjobs package (see documentation) makes the data-retrieving process easy for us, therefore we are going to make use of it.
Let’s begin with importing the necessary tools, which we will exploit in our calculations.
# Import required libraries
import xarray as xr # tool for analyzing multi-dimensional data
from visjobs.datas import get_MODEL # tool for retrieving the data
import matplotlib.pyplot as plt # tool for visualization
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
plt.rcParams['figure.figsize'] = (12, 5) # Set default plot size
init_year = '2021' # model init year
init_month = '10' # model init month
init_day = '10' # model init day
init_hour = '00' # model init hour in UTC
ds = get_MODEL.pick_data(year=init_year, month=init_month,
day=init_day, hour=init_hour,
model='GFS', hourly=True)
Addressing Data: http://nomads.ncep.noaa.gov:80/dods/gfs_0p25_1hr/gfs20211010/gfs_0p25_1hr_00z
Connected GFS Data via OpenDAP
The get_MODEL
object in visjobs library facilitates accessing various atmopsheric model data remotely. Carefully examine the arguments we passed into the function pick_data
. We easily emphasize the model initialization date, model name, and other additional arguments in the function to get the data we are looking for.
Here’s our dataset: GFS Hourly 0.25 Degree Data Init at 00 UTC, 10 October 2021
See the retrieved data below. It contains 200+ variables (on single or pressure levels
), each of which defined on the dimensions lat
, lev
, lon
, time
. When you click on the data variables button below, it becomes clear what variable is confined to which dimensions.
You’re strongly encouraged to check out the xarray data structures documentation if you are unfamiliar with the data elements Dimensions, Coordinates, Data Variables, and Attributes. At it’s core, these elements define our multi-dimensional dataset, leveraging the concept of matrices.
ds # Retrieved data
<xarray.Dataset> Dimensions: (lat: 721, lev: 41, lon: 1440, time: 121) Coordinates: * time (time) datetime64[ns] 2021-10-10 ... 2021-10-15 * lev (lev) float64 1e+03 975.0 950.0 925.0 ... 0.04 0.02 0.01 * lat (lat) float64 -90.0 -89.75 -89.5 -89.25 ... 89.5 89.75 90.0 * lon (lon) float64 0.0 0.25 0.5 0.75 ... 359.0 359.2 359.5 359.8 Data variables: absvprs (time, lev, lat, lon) float32 ... no4lftxsfc (time, lat, lon) float32 ... acpcpsfc (time, lat, lon) float32 ... albdosfc (time, lat, lon) float32 ... apcpsfc (time, lat, lon) float32 ... capesfc (time, lat, lon) float32 ... cape180_0mb (time, lat, lon) float32 ... cape90_0mb (time, lat, lon) float32 ... cape255_0mb (time, lat, lon) float32 ... cfrzravesfc (time, lat, lon) float32 ... cfrzrsfc (time, lat, lon) float32 ... cicepavesfc (time, lat, lon) float32 ... cicepsfc (time, lat, lon) float32 ... cinsfc (time, lat, lon) float32 ... cin180_0mb (time, lat, lon) float32 ... cin90_0mb (time, lat, lon) float32 ... cin255_0mb (time, lat, lon) float32 ... clwmrprs (time, lev, lat, lon) float32 ... clwmrhy1 (time, lat, lon) float32 ... cnwatsfc (time, lat, lon) float32 ... cpofpsfc (time, lat, lon) float32 ... cpratavesfc (time, lat, lon) float32 ... cpratsfc (time, lat, lon) float32 ... crainavesfc (time, lat, lon) float32 ... crainsfc (time, lat, lon) float32 ... csnowavesfc (time, lat, lon) float32 ... csnowsfc (time, lat, lon) float32 ... cwatclm (time, lat, lon) float32 ... cworkclm (time, lat, lon) float32 ... dlwrfsfc (time, lat, lon) float32 ... dpt2m (time, lat, lon) float32 ... dswrfsfc (time, lat, lon) float32 ... dzdtprs (time, lev, lat, lon) float32 ... fldcpsfc (time, lat, lon) float32 ... fricvsfc (time, lat, lon) float32 ... gfluxsfc (time, lat, lon) float32 ... grleprs (time, lev, lat, lon) float32 ... grlehy1 (time, lat, lon) float32 ... gustsfc (time, lat, lon) float32 ... hcdcavehcll (time, lat, lon) float32 ... hcdchcll (time, lat, lon) float32 ... hgtsfc (time, lat, lon) float32 ... hgtprs (time, lev, lat, lon) float32 ... hgt2pv (time, lat, lon) float32 ... hgtneg2pv (time, lat, lon) float32 ... hgttop0c (time, lat, lon) float32 ... hgtceil (time, lat, lon) float32 ... hgt0c (time, lat, lon) float32 ... hgtmwl (time, lat, lon) float32 ... hgttrop (time, lat, lon) float32 ... hindexsfc (time, lat, lon) float32 ... hlcy3000_0m (time, lat, lon) float32 ... hpblsfc (time, lat, lon) float32 ... icahtmwl (time, lat, lon) float32 ... icahttrop (time, lat, lon) float32 ... icecsfc (time, lat, lon) float32 ... iceg_10m (time, lat, lon) float32 ... icetksfc (time, lat, lon) float32 ... icetmpsfc (time, lat, lon) float32 ... icmrprs (time, lev, lat, lon) float32 ... icmrhy1 (time, lat, lon) float32 ... landsfc (time, lat, lon) float32 ... lcdcavelcll (time, lat, lon) float32 ... lcdclcll (time, lat, lon) float32 ... lftxsfc (time, lat, lon) float32 ... lhtflsfc (time, lat, lon) float32 ... mcdcavemcll (time, lat, lon) float32 ... mcdcmcll (time, lat, lon) float32 ... msletmsl (time, lat, lon) float32 ... o3mrprs (time, lev, lat, lon) float32 ... pevprsfc (time, lat, lon) float32 ... plpl255_0mb (time, lat, lon) float32 ... potsig995 (time, lat, lon) float32 ... prateavesfc (time, lat, lon) float32 ... pratesfc (time, lat, lon) float32 ... preslclb (time, lat, lon) float32 ... preslclt (time, lat, lon) float32 ... presmclb (time, lat, lon) float32 ... presmclt (time, lat, lon) float32 ... preshclb (time, lat, lon) float32 ... preshclt (time, lat, lon) float32 ... pressfc (time, lat, lon) float32 ... pres80m (time, lat, lon) float32 ... pres2pv (time, lat, lon) float32 ... presneg2pv (time, lat, lon) float32 ... prescclb (time, lat, lon) float32 ... prescclt (time, lat, lon) float32 ... presmwl (time, lat, lon) float32 ... prestrop (time, lat, lon) float32 ... prmslmsl (time, lat, lon) float32 ... pwatclm (time, lat, lon) float32 ... refcclm (time, lat, lon) float32 ... refd4000m (time, lat, lon) float32 ... refd1000m (time, lat, lon) float32 ... refdhy1 (time, lat, lon) float32 ... refdhy2 (time, lat, lon) float32 ... rhprs (time, lev, lat, lon) float32 ... rh2m (time, lat, lon) float32 ... rhsg330_1000 (time, lat, lon) float32 ... rhsg440_1000 (time, lat, lon) float32 ... rhsg720_940 (time, lat, lon) float32 ... rhsg440_720 (time, lat, lon) float32 ... rhsig995 (time, lat, lon) float32 ... rh30_0mb (time, lat, lon) float32 ... rhclm (time, lat, lon) float32 ... rhtop0c (time, lat, lon) float32 ... rh0c (time, lat, lon) float32 ... rwmrprs (time, lev, lat, lon) float32 ... rwmrhy1 (time, lat, lon) float32 ... sfcrsfc (time, lat, lon) float32 ... shtflsfc (time, lat, lon) float32 ... snmrprs (time, lev, lat, lon) float32 ... snmrhy1 (time, lat, lon) float32 ... snodsfc (time, lat, lon) float32 ... soill0_10cm (time, lat, lon) float32 ... soill10_40cm (time, lat, lon) float32 ... soill40_100cm (time, lat, lon) float32 ... soill100_200cm (time, lat, lon) float32 ... soilw0_10cm (time, lat, lon) float32 ... soilw10_40cm (time, lat, lon) float32 ... soilw40_100cm (time, lat, lon) float32 ... soilw100_200cm (time, lat, lon) float32 ... sotypsfc (time, lat, lon) float32 ... spfhprs (time, lev, lat, lon) float32 ... spfh2m (time, lat, lon) float32 ... spfh80m (time, lat, lon) float32 ... spfh30_0mb (time, lat, lon) float32 ... sunsdsfc (time, lat, lon) float32 ... tcdcaveclm (time, lat, lon) float32 ... tcdcblcll (time, lat, lon) float32 ... tcdcclm (time, lat, lon) float32 ... tcdcprs (time, lev, lat, lon) float32 ... tcdcccll (time, lat, lon) float32 ... tmax2m (time, lat, lon) float32 ... tmin2m (time, lat, lon) float32 ... tmplclt (time, lat, lon) float32 ... tmpmclt (time, lat, lon) float32 ... tmphclt (time, lat, lon) float32 ... tmpsfc (time, lat, lon) float32 ... tmpprs (time, lev, lat, lon) float32 ... tmp_1829m (time, lat, lon) float32 ... tmp_2743m (time, lat, lon) float32 ... tmp_3658m (time, lat, lon) float32 ... tmp2m (time, lat, lon) float32 ... tmp80m (time, lat, lon) float32 ... tmp100m (time, lat, lon) float32 ... tmpsig995 (time, lat, lon) float32 ... tmp30_0mb (time, lat, lon) float32 ... tmp2pv (time, lat, lon) float32 ... tmpneg2pv (time, lat, lon) float32 ... tmpmwl (time, lat, lon) float32 ... tmptrop (time, lat, lon) float32 ... tozneclm (time, lat, lon) float32 ... tsoil0_10cm (time, lat, lon) float32 ... tsoil10_40cm (time, lat, lon) float32 ... tsoil40_100cm (time, lat, lon) float32 ... tsoil100_200cm (time, lat, lon) float32 ... ugwdsfc (time, lat, lon) float32 ... uflxsfc (time, lat, lon) float32 ... ugrdprs (time, lev, lat, lon) float32 ... ugrd_1829m (time, lat, lon) float32 ... ugrd_2743m (time, lat, lon) float32 ... ugrd_3658m (time, lat, lon) float32 ... ugrd10m (time, lat, lon) float32 ... ugrd20m (time, lat, lon) float32 ... ugrd30m (time, lat, lon) float32 ... ugrd40m (time, lat, lon) float32 ... ugrd50m (time, lat, lon) float32 ... ugrd80m (time, lat, lon) float32 ... ugrd100m (time, lat, lon) float32 ... ugrdsig995 (time, lat, lon) float32 ... ugrd30_0mb (time, lat, lon) float32 ... ugrd2pv (time, lat, lon) float32 ... ugrdneg2pv (time, lat, lon) float32 ... ugrdpbl (time, lat, lon) float32 ... ugrdmwl (time, lat, lon) float32 ... ugrdtrop (time, lat, lon) float32 ... ulwrfsfc (time, lat, lon) float32 ... ulwrftoa (time, lat, lon) float32 ... ustm6000_0m (time, lat, lon) float32 ... uswrfsfc (time, lat, lon) float32 ... uswrftoa (time, lat, lon) float32 ... vgwdsfc (time, lat, lon) float32 ... vegsfc (time, lat, lon) float32 ... vflxsfc (time, lat, lon) float32 ... vgrdprs (time, lev, lat, lon) float32 ... vgrd_1829m (time, lat, lon) float32 ... vgrd_2743m (time, lat, lon) float32 ... vgrd_3658m (time, lat, lon) float32 ... vgrd10m (time, lat, lon) float32 ... vgrd20m (time, lat, lon) float32 ... vgrd30m (time, lat, lon) float32 ... vgrd40m (time, lat, lon) float32 ... vgrd50m (time, lat, lon) float32 ... vgrd80m (time, lat, lon) float32 ... vgrd100m (time, lat, lon) float32 ... vgrdsig995 (time, lat, lon) float32 ... vgrd30_0mb (time, lat, lon) float32 ... vgrd2pv (time, lat, lon) float32 ... vgrdneg2pv (time, lat, lon) float32 ... vgrdpbl (time, lat, lon) float32 ... vgrdmwl (time, lat, lon) float32 ... vgrdtrop (time, lat, lon) float32 ... vissfc (time, lat, lon) float32 ... vratepbl (time, lat, lon) float32 ... vstm6000_0m (time, lat, lon) float32 ... vvelprs (time, lev, lat, lon) float32 ... vvelsig995 (time, lat, lon) float32 ... vwsh2pv (time, lat, lon) float32 ... vwshneg2pv (time, lat, lon) float32 ... vwshtrop (time, lat, lon) float32 ... watrsfc (time, lat, lon) float32 ... weasdsfc (time, lat, lon) float32 ... wiltsfc (time, lat, lon) float32 ... var00212m (time, lat, lon) float32 ... Attributes: title: GFS 0.25 deg starting from 00Z10oct2021, downloaded Oct 10 ... Conventions: COARDS\nGrADS dataType: Grid history: Mon Oct 11 00:38:59 GMT 2021 : imported by GrADS Data Serve...
- lat: 721
- lev: 41
- lon: 1440
- time: 121
- time(time)datetime64[ns]2021-10-10 ... 2021-10-15
- grads_dim :
- t
- grads_mapping :
- linear
- grads_size :
- 121
- grads_min :
- 00z10oct2021
- grads_step :
- 1hr
- long_name :
- time
- minimum :
- 00z10oct2021
- maximum :
- 00z15oct2021
- resolution :
- 0.041666668
array(['2021-10-10T00:00:00.000000000', '2021-10-10T01:00:00.000000000', '2021-10-10T02:00:00.000000000', '2021-10-10T03:00:00.000000000', '2021-10-10T04:00:00.000000000', '2021-10-10T05:00:00.000000000', '2021-10-10T06:00:00.000000000', '2021-10-10T07:00:00.000000000', '2021-10-10T08:00:00.000000000', '2021-10-10T09:00:00.000000000', '2021-10-10T10:00:00.000000000', '2021-10-10T11:00:00.000000000', '2021-10-10T12:00:00.000000000', '2021-10-10T13:00:00.000000000', '2021-10-10T14:00:00.000000000', '2021-10-10T15:00:00.000000000', '2021-10-10T16:00:00.000000000', '2021-10-10T17:00:00.000000000', '2021-10-10T18:00:00.000000000', '2021-10-10T19:00:00.000000000', '2021-10-10T20:00:00.000000000', '2021-10-10T21:00:00.000000000', '2021-10-10T22:00:00.000000000', '2021-10-10T23:00:00.000000000', '2021-10-11T00:00:00.000000000', '2021-10-11T01:00:00.000000000', '2021-10-11T02:00:00.000000000', '2021-10-11T03:00:00.000000000', '2021-10-11T04:00:00.000000000', '2021-10-11T05:00:00.000000000', '2021-10-11T06:00:00.000000000', '2021-10-11T07:00:00.000000000', '2021-10-11T08:00:00.000000000', '2021-10-11T09:00:00.000000000', '2021-10-11T10:00:00.000000000', '2021-10-11T11:00:00.000000000', '2021-10-11T12:00:00.000000000', '2021-10-11T13:00:00.000000000', '2021-10-11T14:00:00.000000000', '2021-10-11T15:00:00.000000000', '2021-10-11T16:00:00.000000000', '2021-10-11T17:00:00.000000000', '2021-10-11T18:00:00.000000000', '2021-10-11T19:00:00.000000000', '2021-10-11T20:00:00.000000000', '2021-10-11T21:00:00.000000000', '2021-10-11T22:00:00.000000000', '2021-10-11T23:00:00.000000000', '2021-10-12T00:00:00.000000000', '2021-10-12T01:00:00.000000000', '2021-10-12T02:00:00.000000000', '2021-10-12T03:00:00.000000000', '2021-10-12T04:00:00.000000000', '2021-10-12T05:00:00.000000000', '2021-10-12T06:00:00.000000000', '2021-10-12T07:00:00.000000000', '2021-10-12T08:00:00.000000000', '2021-10-12T09:00:00.000000000', '2021-10-12T10:00:00.000000000', '2021-10-12T11:00:00.000000000', '2021-10-12T12:00:00.000000000', '2021-10-12T13:00:00.000000000', '2021-10-12T14:00:00.000000000', '2021-10-12T15:00:00.000000000', '2021-10-12T16:00:00.000000000', '2021-10-12T17:00:00.000000000', '2021-10-12T18:00:00.000000000', '2021-10-12T19:00:00.000000000', '2021-10-12T20:00:00.000000000', '2021-10-12T21:00:00.000000000', '2021-10-12T22:00:00.000000000', '2021-10-12T23:00:00.000000000', '2021-10-13T00:00:00.000000000', '2021-10-13T01:00:00.000000000', '2021-10-13T02:00:00.000000000', '2021-10-13T03:00:00.000000000', '2021-10-13T04:00:00.000000000', '2021-10-13T05:00:00.000000000', '2021-10-13T06:00:00.000000000', '2021-10-13T07:00:00.000000000', '2021-10-13T08:00:00.000000000', '2021-10-13T09:00:00.000000000', '2021-10-13T10:00:00.000000000', '2021-10-13T11:00:00.000000000', '2021-10-13T12:00:00.000000000', '2021-10-13T13:00:00.000000000', '2021-10-13T14:00:00.000000000', '2021-10-13T15:00:00.000000000', '2021-10-13T16:00:00.000000000', '2021-10-13T17:00:00.000000000', '2021-10-13T18:00:00.000000000', '2021-10-13T19:00:00.000000000', '2021-10-13T20:00:00.000000000', '2021-10-13T21:00:00.000000000', '2021-10-13T22:00:00.000000000', '2021-10-13T23:00:00.000000000', '2021-10-14T00:00:00.000000000', '2021-10-14T01:00:00.000000000', '2021-10-14T02:00:00.000000000', '2021-10-14T03:00:00.000000000', '2021-10-14T04:00:00.000000000', '2021-10-14T05:00:00.000000000', '2021-10-14T06:00:00.000000000', '2021-10-14T07:00:00.000000000', '2021-10-14T08:00:00.000000000', '2021-10-14T09:00:00.000000000', '2021-10-14T10:00:00.000000000', '2021-10-14T11:00:00.000000000', '2021-10-14T12:00:00.000000000', '2021-10-14T13:00:00.000000000', '2021-10-14T14:00:00.000000000', '2021-10-14T15:00:00.000000000', '2021-10-14T16:00:00.000000000', '2021-10-14T17:00:00.000000000', '2021-10-14T18:00:00.000000000', '2021-10-14T19:00:00.000000000', '2021-10-14T20:00:00.000000000', '2021-10-14T21:00:00.000000000', '2021-10-14T22:00:00.000000000', '2021-10-14T23:00:00.000000000', '2021-10-15T00:00:00.000000000'], dtype='datetime64[ns]')
- lev(lev)float641e+03 975.0 950.0 ... 0.02 0.01
- grads_dim :
- z
- grads_mapping :
- levels
- units :
- millibar
- long_name :
- altitude
- minimum :
- 1000.0
- maximum :
- 0.01
- resolution :
- 24.99975
array([1.00e+03, 9.75e+02, 9.50e+02, 9.25e+02, 9.00e+02, 8.50e+02, 8.00e+02, 7.50e+02, 7.00e+02, 6.50e+02, 6.00e+02, 5.50e+02, 5.00e+02, 4.50e+02, 4.00e+02, 3.50e+02, 3.00e+02, 2.50e+02, 2.00e+02, 1.50e+02, 1.00e+02, 7.00e+01, 5.00e+01, 4.00e+01, 3.00e+01, 2.00e+01, 1.50e+01, 1.00e+01, 7.00e+00, 5.00e+00, 3.00e+00, 2.00e+00, 1.00e+00, 7.00e-01, 4.00e-01, 2.00e-01, 1.00e-01, 7.00e-02, 4.00e-02, 2.00e-02, 1.00e-02])
- lat(lat)float64-90.0 -89.75 -89.5 ... 89.75 90.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array([-90. , -89.75, -89.5 , ..., 89.5 , 89.75, 90. ])
- lon(lon)float640.0 0.25 0.5 ... 359.2 359.5 359.8
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array([0.0000e+00, 2.5000e-01, 5.0000e-01, ..., 3.5925e+02, 3.5950e+02, 3.5975e+02])
- absvprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) absolute vorticity [1/s]
[855741344 values with dtype=float32]
- no4lftxsfc(time, lat, lon)float32...
- long_name :
- ** surface best (4 layer) lifted index [k]
[125627040 values with dtype=float32]
- acpcpsfc(time, lat, lon)float32...
- long_name :
- ** surface convective precipitation [kg/m^2]
[125627040 values with dtype=float32]
- albdosfc(time, lat, lon)float32...
- long_name :
- ** surface albedo [%]
[125627040 values with dtype=float32]
- apcpsfc(time, lat, lon)float32...
- long_name :
- ** surface total precipitation [kg/m^2]
[125627040 values with dtype=float32]
- capesfc(time, lat, lon)float32...
- long_name :
- ** surface convective available potential energy [j/kg]
[125627040 values with dtype=float32]
- cape180_0mb(time, lat, lon)float32...
- long_name :
- ** 180-0 mb above ground convective available potential energy [j/kg]
[125627040 values with dtype=float32]
- cape90_0mb(time, lat, lon)float32...
- long_name :
- ** 90-0 mb above ground convective available potential energy [j/kg]
[125627040 values with dtype=float32]
- cape255_0mb(time, lat, lon)float32...
- long_name :
- ** 255-0 mb above ground convective available potential energy [j/kg]
[125627040 values with dtype=float32]
- cfrzravesfc(time, lat, lon)float32...
- long_name :
- ** surface categorical freezing rain [-]
[125627040 values with dtype=float32]
- cfrzrsfc(time, lat, lon)float32...
- long_name :
- ** surface categorical freezing rain [-]
[125627040 values with dtype=float32]
- cicepavesfc(time, lat, lon)float32...
- long_name :
- ** surface categorical ice pellets [-]
[125627040 values with dtype=float32]
- cicepsfc(time, lat, lon)float32...
- long_name :
- ** surface categorical ice pellets [-]
[125627040 values with dtype=float32]
- cinsfc(time, lat, lon)float32...
- long_name :
- ** surface convective inhibition [j/kg]
[125627040 values with dtype=float32]
- cin180_0mb(time, lat, lon)float32...
- long_name :
- ** 180-0 mb above ground convective inhibition [j/kg]
[125627040 values with dtype=float32]
- cin90_0mb(time, lat, lon)float32...
- long_name :
- ** 90-0 mb above ground convective inhibition [j/kg]
[125627040 values with dtype=float32]
- cin255_0mb(time, lat, lon)float32...
- long_name :
- ** 255-0 mb above ground convective inhibition [j/kg]
[125627040 values with dtype=float32]
- clwmrprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) cloud mixing ratio [kg/kg]
[855741344 values with dtype=float32]
- clwmrhy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level cloud mixing ratio [kg/kg]
[125627040 values with dtype=float32]
- cnwatsfc(time, lat, lon)float32...
- long_name :
- ** surface plant canopy surface water [kg/m^2]
[125627040 values with dtype=float32]
- cpofpsfc(time, lat, lon)float32...
- long_name :
- ** surface percent frozen precipitation [%]
[125627040 values with dtype=float32]
- cpratavesfc(time, lat, lon)float32...
- long_name :
- ** surface convective precipitation rate [kg/m^2/s]
[125627040 values with dtype=float32]
- cpratsfc(time, lat, lon)float32...
- long_name :
- ** surface convective precipitation rate [kg/m^2/s]
[125627040 values with dtype=float32]
- crainavesfc(time, lat, lon)float32...
- long_name :
- ** surface categorical rain [-]
[125627040 values with dtype=float32]
- crainsfc(time, lat, lon)float32...
- long_name :
- ** surface categorical rain [-]
[125627040 values with dtype=float32]
- csnowavesfc(time, lat, lon)float32...
- long_name :
- ** surface categorical snow [-]
[125627040 values with dtype=float32]
- csnowsfc(time, lat, lon)float32...
- long_name :
- ** surface categorical snow [-]
[125627040 values with dtype=float32]
- cwatclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere (considered as a single layer) cloud water [kg/m^2]
[125627040 values with dtype=float32]
- cworkclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere (considered as a single layer) cloud work function [j/kg]
[125627040 values with dtype=float32]
- dlwrfsfc(time, lat, lon)float32...
- long_name :
- ** surface downward long-wave rad. flux [w/m^2]
[125627040 values with dtype=float32]
- dpt2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground dew point temperature [k]
[125627040 values with dtype=float32]
- dswrfsfc(time, lat, lon)float32...
- long_name :
- ** surface downward short-wave radiation flux [w/m^2]
[125627040 values with dtype=float32]
- dzdtprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) vertical velocity (geometric) [m/s]
[855741344 values with dtype=float32]
- fldcpsfc(time, lat, lon)float32...
- long_name :
- ** surface field capacity [fraction]
[125627040 values with dtype=float32]
- fricvsfc(time, lat, lon)float32...
- long_name :
- ** surface frictional velocity [m/s]
[125627040 values with dtype=float32]
- gfluxsfc(time, lat, lon)float32...
- long_name :
- ** surface ground heat flux [w/m^2]
[125627040 values with dtype=float32]
- grleprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) graupel [kg/kg]
[855741344 values with dtype=float32]
- grlehy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level graupel [kg/kg]
[125627040 values with dtype=float32]
- gustsfc(time, lat, lon)float32...
- long_name :
- ** surface wind speed (gust) [m/s]
[125627040 values with dtype=float32]
- hcdcavehcll(time, lat, lon)float32...
- long_name :
- ** high cloud layer high cloud cover [%]
[125627040 values with dtype=float32]
- hcdchcll(time, lat, lon)float32...
- long_name :
- ** high cloud layer high cloud cover [%]
[125627040 values with dtype=float32]
- hgtsfc(time, lat, lon)float32...
- long_name :
- ** surface geopotential height [gpm]
[125627040 values with dtype=float32]
- hgtprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) geopotential height [gpm]
[855741344 values with dtype=float32]
- hgt2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface geopotential height [gpm]
[125627040 values with dtype=float32]
- hgtneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface geopotential height [gpm]
[125627040 values with dtype=float32]
- hgttop0c(time, lat, lon)float32...
- long_name :
- ** highest tropospheric freezing level geopotential height [gpm]
[125627040 values with dtype=float32]
- hgtceil(time, lat, lon)float32...
- long_name :
- ** cloud ceiling geopotential height [gpm]
[125627040 values with dtype=float32]
- hgt0c(time, lat, lon)float32...
- long_name :
- ** 0c isotherm geopotential height [gpm]
[125627040 values with dtype=float32]
- hgtmwl(time, lat, lon)float32...
- long_name :
- ** max wind geopotential height [gpm]
[125627040 values with dtype=float32]
- hgttrop(time, lat, lon)float32...
- long_name :
- ** tropopause geopotential height [gpm]
[125627040 values with dtype=float32]
- hindexsfc(time, lat, lon)float32...
- long_name :
- ** surface haines index [numeric]
[125627040 values with dtype=float32]
- hlcy3000_0m(time, lat, lon)float32...
- long_name :
- ** 3000-0 m above ground storm relative helicity [m^2/s^2]
[125627040 values with dtype=float32]
- hpblsfc(time, lat, lon)float32...
- long_name :
- ** surface planetary boundary layer height [m]
[125627040 values with dtype=float32]
- icahtmwl(time, lat, lon)float32...
- long_name :
- ** max wind icao standard atmosphere reference height [m]
[125627040 values with dtype=float32]
- icahttrop(time, lat, lon)float32...
- long_name :
- ** tropopause icao standard atmosphere reference height [m]
[125627040 values with dtype=float32]
- icecsfc(time, lat, lon)float32...
- long_name :
- ** surface ice cover [proportion]
[125627040 values with dtype=float32]
- iceg_10m(time, lat, lon)float32...
- long_name :
- ** 10 m above mean sea level ice growth rate [m/s]
[125627040 values with dtype=float32]
- icetksfc(time, lat, lon)float32...
- long_name :
- ** surface ice thickness [m]
[125627040 values with dtype=float32]
- icetmpsfc(time, lat, lon)float32...
- long_name :
- ** surface ice temperature [k]
[125627040 values with dtype=float32]
- icmrprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) ice water mixing ratio [kg/kg]
[855741344 values with dtype=float32]
- icmrhy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level ice water mixing ratio [kg/kg]
[125627040 values with dtype=float32]
- landsfc(time, lat, lon)float32...
- long_name :
- ** surface land cover (0=sea, 1=land) [proportion]
[125627040 values with dtype=float32]
- lcdcavelcll(time, lat, lon)float32...
- long_name :
- ** low cloud layer low cloud cover [%]
[125627040 values with dtype=float32]
- lcdclcll(time, lat, lon)float32...
- long_name :
- ** low cloud layer low cloud cover [%]
[125627040 values with dtype=float32]
- lftxsfc(time, lat, lon)float32...
- long_name :
- ** surface surface lifted index [k]
[125627040 values with dtype=float32]
- lhtflsfc(time, lat, lon)float32...
- long_name :
- ** surface latent heat net flux [w/m^2]
[125627040 values with dtype=float32]
- mcdcavemcll(time, lat, lon)float32...
- long_name :
- ** middle cloud layer medium cloud cover [%]
[125627040 values with dtype=float32]
- mcdcmcll(time, lat, lon)float32...
- long_name :
- ** middle cloud layer medium cloud cover [%]
[125627040 values with dtype=float32]
- msletmsl(time, lat, lon)float32...
- long_name :
- ** mean sea level mslp (eta model reduction) [pa]
[125627040 values with dtype=float32]
- o3mrprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) ozone mixing ratio [kg/kg]
[855741344 values with dtype=float32]
- pevprsfc(time, lat, lon)float32...
- long_name :
- ** surface potential evaporation rate [w/m^2]
[125627040 values with dtype=float32]
- plpl255_0mb(time, lat, lon)float32...
- long_name :
- ** 255-0 mb above ground pressure of level from which parcel was lifted [pa]
[125627040 values with dtype=float32]
- potsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level potential temperature [k]
[125627040 values with dtype=float32]
- prateavesfc(time, lat, lon)float32...
- long_name :
- ** surface precipitation rate [kg/m^2/s]
[125627040 values with dtype=float32]
- pratesfc(time, lat, lon)float32...
- long_name :
- ** surface precipitation rate [kg/m^2/s]
[125627040 values with dtype=float32]
- preslclb(time, lat, lon)float32...
- long_name :
- ** low cloud bottom level pressure [pa]
[125627040 values with dtype=float32]
- preslclt(time, lat, lon)float32...
- long_name :
- ** low cloud top level pressure [pa]
[125627040 values with dtype=float32]
- presmclb(time, lat, lon)float32...
- long_name :
- ** middle cloud bottom level pressure [pa]
[125627040 values with dtype=float32]
- presmclt(time, lat, lon)float32...
- long_name :
- ** middle cloud top level pressure [pa]
[125627040 values with dtype=float32]
- preshclb(time, lat, lon)float32...
- long_name :
- ** high cloud bottom level pressure [pa]
[125627040 values with dtype=float32]
- preshclt(time, lat, lon)float32...
- long_name :
- ** high cloud top level pressure [pa]
[125627040 values with dtype=float32]
- pressfc(time, lat, lon)float32...
- long_name :
- ** surface pressure [pa]
[125627040 values with dtype=float32]
- pres80m(time, lat, lon)float32...
- long_name :
- ** 80 m above ground pressure [pa]
[125627040 values with dtype=float32]
- pres2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface pressure [pa]
[125627040 values with dtype=float32]
- presneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface pressure [pa]
[125627040 values with dtype=float32]
- prescclb(time, lat, lon)float32...
- long_name :
- ** convective cloud bottom level pressure [pa]
[125627040 values with dtype=float32]
- prescclt(time, lat, lon)float32...
- long_name :
- ** convective cloud top level pressure [pa]
[125627040 values with dtype=float32]
- presmwl(time, lat, lon)float32...
- long_name :
- ** max wind pressure [pa]
[125627040 values with dtype=float32]
- prestrop(time, lat, lon)float32...
- long_name :
- ** tropopause pressure [pa]
[125627040 values with dtype=float32]
- prmslmsl(time, lat, lon)float32...
- long_name :
- ** mean sea level pressure reduced to msl [pa]
[125627040 values with dtype=float32]
- pwatclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere (considered as a single layer) precipitable water [kg/m^2]
[125627040 values with dtype=float32]
- refcclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere composite reflectivity [db]
[125627040 values with dtype=float32]
- refd4000m(time, lat, lon)float32...
- long_name :
- ** 4000 m above ground reflectivity [db]
[125627040 values with dtype=float32]
- refd1000m(time, lat, lon)float32...
- long_name :
- ** 1000 m above ground reflectivity [db]
[125627040 values with dtype=float32]
- refdhy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level reflectivity [db]
[125627040 values with dtype=float32]
- refdhy2(time, lat, lon)float32...
- long_name :
- ** 2 hybrid level reflectivity [db]
[125627040 values with dtype=float32]
- rhprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) relative humidity [%]
[855741344 values with dtype=float32]
- rh2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground relative humidity [%]
[125627040 values with dtype=float32]
- rhsg330_1000(time, lat, lon)float32...
- long_name :
- ** 0.33-1 sigma layer relative humidity [%]
[125627040 values with dtype=float32]
- rhsg440_1000(time, lat, lon)float32...
- long_name :
- ** 0.44-1 sigma layer relative humidity [%]
[125627040 values with dtype=float32]
- rhsg720_940(time, lat, lon)float32...
- long_name :
- ** 0.72-0.94 sigma layer relative humidity [%]
[125627040 values with dtype=float32]
- rhsg440_720(time, lat, lon)float32...
- long_name :
- ** 0.44-0.72 sigma layer relative humidity [%]
[125627040 values with dtype=float32]
- rhsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level relative humidity [%]
[125627040 values with dtype=float32]
- rh30_0mb(time, lat, lon)float32...
- long_name :
- ** 30-0 mb above ground relative humidity [%]
[125627040 values with dtype=float32]
- rhclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere (considered as a single layer) relative humidity [%]
[125627040 values with dtype=float32]
- rhtop0c(time, lat, lon)float32...
- long_name :
- ** highest tropospheric freezing level relative humidity [%]
[125627040 values with dtype=float32]
- rh0c(time, lat, lon)float32...
- long_name :
- ** 0c isotherm relative humidity [%]
[125627040 values with dtype=float32]
- rwmrprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) rain mixing ratio [kg/kg]
[855741344 values with dtype=float32]
- rwmrhy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level rain mixing ratio [kg/kg]
[125627040 values with dtype=float32]
- sfcrsfc(time, lat, lon)float32...
- long_name :
- ** surface surface roughness [m]
[125627040 values with dtype=float32]
- shtflsfc(time, lat, lon)float32...
- long_name :
- ** surface sensible heat net flux [w/m^2]
[125627040 values with dtype=float32]
- snmrprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) snow mixing ratio [kg/kg]
[855741344 values with dtype=float32]
- snmrhy1(time, lat, lon)float32...
- long_name :
- ** 1 hybrid level snow mixing ratio [kg/kg]
[125627040 values with dtype=float32]
- snodsfc(time, lat, lon)float32...
- long_name :
- ** surface snow depth [m]
[125627040 values with dtype=float32]
- soill0_10cm(time, lat, lon)float32...
- long_name :
- ** 0-0.1 m below ground liquid volumetric soil moisture (non frozen) [proportion]
[125627040 values with dtype=float32]
- soill10_40cm(time, lat, lon)float32...
- long_name :
- ** 0.1-0.4 m below ground liquid volumetric soil moisture (non frozen) [proportion]
[125627040 values with dtype=float32]
- soill40_100cm(time, lat, lon)float32...
- long_name :
- ** 0.4-1 m below ground liquid volumetric soil moisture (non frozen) [proportion]
[125627040 values with dtype=float32]
- soill100_200cm(time, lat, lon)float32...
- long_name :
- ** 1-2 m below ground liquid volumetric soil moisture (non frozen) [proportion]
[125627040 values with dtype=float32]
- soilw0_10cm(time, lat, lon)float32...
- long_name :
- ** 0-0.1 m below ground volumetric soil moisture content [fraction]
[125627040 values with dtype=float32]
- soilw10_40cm(time, lat, lon)float32...
- long_name :
- ** 0.1-0.4 m below ground volumetric soil moisture content [fraction]
[125627040 values with dtype=float32]
- soilw40_100cm(time, lat, lon)float32...
- long_name :
- ** 0.4-1 m below ground volumetric soil moisture content [fraction]
[125627040 values with dtype=float32]
- soilw100_200cm(time, lat, lon)float32...
- long_name :
- ** 1-2 m below ground volumetric soil moisture content [fraction]
[125627040 values with dtype=float32]
- sotypsfc(time, lat, lon)float32...
- long_name :
- ** surface soil type [-]
[125627040 values with dtype=float32]
- spfhprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) specific humidity [kg/kg]
[855741344 values with dtype=float32]
- spfh2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground specific humidity [kg/kg]
[125627040 values with dtype=float32]
- spfh80m(time, lat, lon)float32...
- long_name :
- ** 80 m above ground specific humidity [kg/kg]
[125627040 values with dtype=float32]
- spfh30_0mb(time, lat, lon)float32...
- long_name :
- ** 30-0 mb above ground specific humidity [kg/kg]
[125627040 values with dtype=float32]
- sunsdsfc(time, lat, lon)float32...
- long_name :
- ** surface sunshine duration [s]
[125627040 values with dtype=float32]
- tcdcaveclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere total cloud cover [%]
[125627040 values with dtype=float32]
- tcdcblcll(time, lat, lon)float32...
- long_name :
- ** boundary layer cloud layer total cloud cover [%]
[125627040 values with dtype=float32]
- tcdcclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere total cloud cover [%]
[125627040 values with dtype=float32]
- tcdcprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 250 200 150 100 50) total cloud cover [%]
[855741344 values with dtype=float32]
- tcdcccll(time, lat, lon)float32...
- long_name :
- ** convective cloud layer total cloud cover [%]
[125627040 values with dtype=float32]
- tmax2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground maximum temperature [k]
[125627040 values with dtype=float32]
- tmin2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground minimum temperature [k]
[125627040 values with dtype=float32]
- tmplclt(time, lat, lon)float32...
- long_name :
- ** low cloud top level temperature [k]
[125627040 values with dtype=float32]
- tmpmclt(time, lat, lon)float32...
- long_name :
- ** middle cloud top level temperature [k]
[125627040 values with dtype=float32]
- tmphclt(time, lat, lon)float32...
- long_name :
- ** high cloud top level temperature [k]
[125627040 values with dtype=float32]
- tmpsfc(time, lat, lon)float32...
- long_name :
- ** surface temperature [k]
[125627040 values with dtype=float32]
- tmpprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) temperature [k]
[855741344 values with dtype=float32]
- tmp_1829m(time, lat, lon)float32...
- long_name :
- ** 1829 m above mean sea level temperature [k]
[125627040 values with dtype=float32]
- tmp_2743m(time, lat, lon)float32...
- long_name :
- ** 2743 m above mean sea level temperature [k]
[125627040 values with dtype=float32]
- tmp_3658m(time, lat, lon)float32...
- long_name :
- ** 3658 m above mean sea level temperature [k]
[125627040 values with dtype=float32]
- tmp2m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground temperature [k]
[125627040 values with dtype=float32]
- tmp80m(time, lat, lon)float32...
- long_name :
- ** 80 m above ground temperature [k]
[125627040 values with dtype=float32]
- tmp100m(time, lat, lon)float32...
- long_name :
- ** 100 m above ground temperature [k]
[125627040 values with dtype=float32]
- tmpsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level temperature [k]
[125627040 values with dtype=float32]
- tmp30_0mb(time, lat, lon)float32...
- long_name :
- ** 30-0 mb above ground temperature [k]
[125627040 values with dtype=float32]
- tmp2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface temperature [k]
[125627040 values with dtype=float32]
- tmpneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface temperature [k]
[125627040 values with dtype=float32]
- tmpmwl(time, lat, lon)float32...
- long_name :
- ** max wind temperature [k]
[125627040 values with dtype=float32]
- tmptrop(time, lat, lon)float32...
- long_name :
- ** tropopause temperature [k]
[125627040 values with dtype=float32]
- tozneclm(time, lat, lon)float32...
- long_name :
- ** entire atmosphere (considered as a single layer) total ozone [du]
[125627040 values with dtype=float32]
- tsoil0_10cm(time, lat, lon)float32...
- long_name :
- ** 0-0.1 m below ground soil temperature validation to deprecate [k]
[125627040 values with dtype=float32]
- tsoil10_40cm(time, lat, lon)float32...
- long_name :
- ** 0.1-0.4 m below ground soil temperature validation to deprecate [k]
[125627040 values with dtype=float32]
- tsoil40_100cm(time, lat, lon)float32...
- long_name :
- ** 0.4-1 m below ground soil temperature validation to deprecate [k]
[125627040 values with dtype=float32]
- tsoil100_200cm(time, lat, lon)float32...
- long_name :
- ** 1-2 m below ground soil temperature validation to deprecate [k]
[125627040 values with dtype=float32]
- ugwdsfc(time, lat, lon)float32...
- long_name :
- ** surface zonal flux of gravity wave stress [n/m^2]
[125627040 values with dtype=float32]
- uflxsfc(time, lat, lon)float32...
- long_name :
- ** surface momentum flux, u-component [n/m^2]
[125627040 values with dtype=float32]
- ugrdprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) u-component of wind [m/s]
[855741344 values with dtype=float32]
- ugrd_1829m(time, lat, lon)float32...
- long_name :
- ** 1829 m above mean sea level u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd_2743m(time, lat, lon)float32...
- long_name :
- ** 2743 m above mean sea level u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd_3658m(time, lat, lon)float32...
- long_name :
- ** 3658 m above mean sea level u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd10m(time, lat, lon)float32...
- long_name :
- ** 10 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd20m(time, lat, lon)float32...
- long_name :
- ** 20 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd30m(time, lat, lon)float32...
- long_name :
- ** 30 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd40m(time, lat, lon)float32...
- long_name :
- ** 40 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd50m(time, lat, lon)float32...
- long_name :
- ** 50 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd80m(time, lat, lon)float32...
- long_name :
- ** 80 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd100m(time, lat, lon)float32...
- long_name :
- ** 100 m above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrdsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd30_0mb(time, lat, lon)float32...
- long_name :
- ** 30-0 mb above ground u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrd2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrdneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrdpbl(time, lat, lon)float32...
- long_name :
- ** planetary boundary layer u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrdmwl(time, lat, lon)float32...
- long_name :
- ** max wind u-component of wind [m/s]
[125627040 values with dtype=float32]
- ugrdtrop(time, lat, lon)float32...
- long_name :
- ** tropopause u-component of wind [m/s]
[125627040 values with dtype=float32]
- ulwrfsfc(time, lat, lon)float32...
- long_name :
- ** surface upward long-wave rad. flux [w/m^2]
[125627040 values with dtype=float32]
- ulwrftoa(time, lat, lon)float32...
- long_name :
- ** top of atmosphere upward long-wave rad. flux [w/m^2]
[125627040 values with dtype=float32]
- ustm6000_0m(time, lat, lon)float32...
- long_name :
- ** 6000-0 m above ground u-component storm motion [m/s]
[125627040 values with dtype=float32]
- uswrfsfc(time, lat, lon)float32...
- long_name :
- ** surface upward short-wave radiation flux [w/m^2]
[125627040 values with dtype=float32]
- uswrftoa(time, lat, lon)float32...
- long_name :
- ** top of atmosphere upward short-wave radiation flux [w/m^2]
[125627040 values with dtype=float32]
- vgwdsfc(time, lat, lon)float32...
- long_name :
- ** surface meridional flux of gravity wave stress [n/m^2]
[125627040 values with dtype=float32]
- vegsfc(time, lat, lon)float32...
- long_name :
- ** surface vegetation [%]
[125627040 values with dtype=float32]
- vflxsfc(time, lat, lon)float32...
- long_name :
- ** surface momentum flux, v-component [n/m^2]
[125627040 values with dtype=float32]
- vgrdprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) v-component of wind [m/s]
[855741344 values with dtype=float32]
- vgrd_1829m(time, lat, lon)float32...
- long_name :
- ** 1829 m above mean sea level v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd_2743m(time, lat, lon)float32...
- long_name :
- ** 2743 m above mean sea level v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd_3658m(time, lat, lon)float32...
- long_name :
- ** 3658 m above mean sea level v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd10m(time, lat, lon)float32...
- long_name :
- ** 10 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd20m(time, lat, lon)float32...
- long_name :
- ** 20 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd30m(time, lat, lon)float32...
- long_name :
- ** 30 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd40m(time, lat, lon)float32...
- long_name :
- ** 40 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd50m(time, lat, lon)float32...
- long_name :
- ** 50 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd80m(time, lat, lon)float32...
- long_name :
- ** 80 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd100m(time, lat, lon)float32...
- long_name :
- ** 100 m above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrdsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd30_0mb(time, lat, lon)float32...
- long_name :
- ** 30-0 mb above ground v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrd2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrdneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrdpbl(time, lat, lon)float32...
- long_name :
- ** planetary boundary layer v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrdmwl(time, lat, lon)float32...
- long_name :
- ** max wind v-component of wind [m/s]
[125627040 values with dtype=float32]
- vgrdtrop(time, lat, lon)float32...
- long_name :
- ** tropopause v-component of wind [m/s]
[125627040 values with dtype=float32]
- vissfc(time, lat, lon)float32...
- long_name :
- ** surface visibility [m]
[125627040 values with dtype=float32]
- vratepbl(time, lat, lon)float32...
- long_name :
- ** planetary boundary layer ventilation rate [m^2/s]
[125627040 values with dtype=float32]
- vstm6000_0m(time, lat, lon)float32...
- long_name :
- ** 6000-0 m above ground v-component storm motion [m/s]
[125627040 values with dtype=float32]
- vvelprs(time, lev, lat, lon)float32...
- long_name :
- ** (1000 975 950 925 900.. 10 7 4 2 1) vertical velocity (pressure) [pa/s]
[855741344 values with dtype=float32]
- vvelsig995(time, lat, lon)float32...
- long_name :
- ** 0.995 sigma level vertical velocity (pressure) [pa/s]
[125627040 values with dtype=float32]
- vwsh2pv(time, lat, lon)float32...
- long_name :
- ** pv=2e-06 (km^2/kg/s) surface vertical speed shear [1/s]
[125627040 values with dtype=float32]
- vwshneg2pv(time, lat, lon)float32...
- long_name :
- ** pv=-2e-06 (km^2/kg/s) surface vertical speed shear [1/s]
[125627040 values with dtype=float32]
- vwshtrop(time, lat, lon)float32...
- long_name :
- ** tropopause vertical speed shear [1/s]
[125627040 values with dtype=float32]
- watrsfc(time, lat, lon)float32...
- long_name :
- ** surface water runoff [kg/m^2]
[125627040 values with dtype=float32]
- weasdsfc(time, lat, lon)float32...
- long_name :
- ** surface water equivalent of accumulated snow depth [kg/m^2]
[125627040 values with dtype=float32]
- wiltsfc(time, lat, lon)float32...
- long_name :
- ** surface wilting point [fraction]
[125627040 values with dtype=float32]
- var00212m(time, lat, lon)float32...
- long_name :
- ** 2 m above ground desc [unit]
[125627040 values with dtype=float32]
- title :
- GFS 0.25 deg starting from 00Z10oct2021, downloaded Oct 10 05:16 UTC
- Conventions :
- COARDS GrADS
- dataType :
- Grid
- history :
- Mon Oct 11 00:38:59 GMT 2021 : imported by GrADS Data Server 2.0
The GFS model provides both hourly
and 3-hourly
forecast of the atmospheric parameters. The former encompasses the first 120 hours forecast range. Given that we retrieved the hourly GFS data using the visjobs tool, it makes sense that our data consists of 121 timesteps (see the time dimension).
Subset the data¶
Considering the fact that we are remotely accessing a large atmospheric data, it is reasonable to get a subset of the data to speed up the calculation processes. Let’s only use the 2 meter temperature
variable, and for the sake of simplicity, we will be ignoring the data for the last 2 days of our forecast period and focusing only on the first 3 days.
We can effectively subset our data using the functions .isel
and .sel
functions of xarray. These functions resemble the .loc
and .iloc
that we use to handle Pandas DataFrames.
# Subset the 2 meter temperature forecast for the first 3 days of the forecast period for Turkey's coordinates
ds_tmp2m = ds['tmp2m'].isel(time=slice(0,72)).sel(lat=slice(35,43), lon=slice(23,48))
ds_tmp2m
<xarray.DataArray 'tmp2m' (time: 72, lat: 33, lon: 101)> [239976 values with dtype=float32] Coordinates: * time (time) datetime64[ns] 2021-10-10 ... 2021-10-12T23:00:00 * lat (lat) float64 35.0 35.25 35.5 35.75 36.0 ... 42.25 42.5 42.75 43.0 * lon (lon) float64 23.0 23.25 23.5 23.75 24.0 ... 47.25 47.5 47.75 48.0 Attributes: long_name: ** 2 m above ground temperature [k]
- time: 72
- lat: 33
- lon: 101
- ...
[239976 values with dtype=float32]
- time(time)datetime64[ns]2021-10-10 ... 2021-10-12T23:00:00
- grads_dim :
- t
- grads_mapping :
- linear
- grads_size :
- 121
- grads_min :
- 00z10oct2021
- grads_step :
- 1hr
- long_name :
- time
- minimum :
- 00z10oct2021
- maximum :
- 00z15oct2021
- resolution :
- 0.041666668
array(['2021-10-10T00:00:00.000000000', '2021-10-10T01:00:00.000000000', '2021-10-10T02:00:00.000000000', '2021-10-10T03:00:00.000000000', '2021-10-10T04:00:00.000000000', '2021-10-10T05:00:00.000000000', '2021-10-10T06:00:00.000000000', '2021-10-10T07:00:00.000000000', '2021-10-10T08:00:00.000000000', '2021-10-10T09:00:00.000000000', '2021-10-10T10:00:00.000000000', '2021-10-10T11:00:00.000000000', '2021-10-10T12:00:00.000000000', '2021-10-10T13:00:00.000000000', '2021-10-10T14:00:00.000000000', '2021-10-10T15:00:00.000000000', '2021-10-10T16:00:00.000000000', '2021-10-10T17:00:00.000000000', '2021-10-10T18:00:00.000000000', '2021-10-10T19:00:00.000000000', '2021-10-10T20:00:00.000000000', '2021-10-10T21:00:00.000000000', '2021-10-10T22:00:00.000000000', '2021-10-10T23:00:00.000000000', '2021-10-11T00:00:00.000000000', '2021-10-11T01:00:00.000000000', '2021-10-11T02:00:00.000000000', '2021-10-11T03:00:00.000000000', '2021-10-11T04:00:00.000000000', '2021-10-11T05:00:00.000000000', '2021-10-11T06:00:00.000000000', '2021-10-11T07:00:00.000000000', '2021-10-11T08:00:00.000000000', '2021-10-11T09:00:00.000000000', '2021-10-11T10:00:00.000000000', '2021-10-11T11:00:00.000000000', '2021-10-11T12:00:00.000000000', '2021-10-11T13:00:00.000000000', '2021-10-11T14:00:00.000000000', '2021-10-11T15:00:00.000000000', '2021-10-11T16:00:00.000000000', '2021-10-11T17:00:00.000000000', '2021-10-11T18:00:00.000000000', '2021-10-11T19:00:00.000000000', '2021-10-11T20:00:00.000000000', '2021-10-11T21:00:00.000000000', '2021-10-11T22:00:00.000000000', '2021-10-11T23:00:00.000000000', '2021-10-12T00:00:00.000000000', '2021-10-12T01:00:00.000000000', '2021-10-12T02:00:00.000000000', '2021-10-12T03:00:00.000000000', '2021-10-12T04:00:00.000000000', '2021-10-12T05:00:00.000000000', '2021-10-12T06:00:00.000000000', '2021-10-12T07:00:00.000000000', '2021-10-12T08:00:00.000000000', '2021-10-12T09:00:00.000000000', '2021-10-12T10:00:00.000000000', '2021-10-12T11:00:00.000000000', '2021-10-12T12:00:00.000000000', '2021-10-12T13:00:00.000000000', '2021-10-12T14:00:00.000000000', '2021-10-12T15:00:00.000000000', '2021-10-12T16:00:00.000000000', '2021-10-12T17:00:00.000000000', '2021-10-12T18:00:00.000000000', '2021-10-12T19:00:00.000000000', '2021-10-12T20:00:00.000000000', '2021-10-12T21:00:00.000000000', '2021-10-12T22:00:00.000000000', '2021-10-12T23:00:00.000000000'], dtype='datetime64[ns]')
- lat(lat)float6435.0 35.25 35.5 ... 42.5 42.75 43.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array([35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. ])
- lon(lon)float6423.0 23.25 23.5 ... 47.5 47.75 48.0
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array([23. , 23.25, 23.5 , 23.75, 24. , 24.25, 24.5 , 24.75, 25. , 25.25, 25.5 , 25.75, 26. , 26.25, 26.5 , 26.75, 27. , 27.25, 27.5 , 27.75, 28. , 28.25, 28.5 , 28.75, 29. , 29.25, 29.5 , 29.75, 30. , 30.25, 30.5 , 30.75, 31. , 31.25, 31.5 , 31.75, 32. , 32.25, 32.5 , 32.75, 33. , 33.25, 33.5 , 33.75, 34. , 34.25, 34.5 , 34.75, 35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. , 43.25, 43.5 , 43.75, 44. , 44.25, 44.5 , 44.75, 45. , 45.25, 45.5 , 45.75, 46. , 46.25, 46.5 , 46.75, 47. , 47.25, 47.5 , 47.75, 48. ])
- long_name :
- ** 2 m above ground temperature [k]
Check out the time dimension of the subsetted data. Do you see a change?
If we’d like to learn more about a particular variable in the dataset, we can find (most of the time) the detailed information in the attributes of that variable.
print(ds_tmp2m.attrs) # See the attributes of t2mp variable
{'long_name': '** 2 m above ground temperature [k] '}
The temperature data is given in Kelvin. But we won’t be bothered with unit conversions for now, since our data is still large.
Time dimension operations¶
Our essential aim is to perform certain time-related calculations and see how convenient it is to use xarray for this. Suppose you are eager to find answers to the problems below:
Analyzing the state of the atmosphere at any given time
Calculating the daily or hourly averages over the
3-days
forecast range
State of the atmosphere at any given time¶
What if we wanted to analyze the atmosphere at a single forecast time? Again, we can exploit the .isel
or .sel
functions of xarray.
tmp2m_subset = ds_tmp2m.isel(time=0) # Get the first forecast time
tmp2m_subset
<xarray.DataArray 'tmp2m' (lat: 33, lon: 101)> array([[296.1547 , 296.10468, 296.17468, ..., 280.39468, 279.66467, 280.41467], [296.25467, 296.10468, 295.91467, ..., 280.63467, 280.8447 , 280.0847 ], [296.25467, 296.1247 , 295.69467, ..., 280.56467, 281.5247 , 280.81467], ..., [279.8647 , 279.0247 , 279.03467, ..., 277.2147 , 282.5947 , 288.07468], [278.97467, 279.79468, 279.60468, ..., 281.73468, 287.4647 , 288.79468], [278.7147 , 277.7147 , 277.75467, ..., 286.39468, 288.48468, 288.38467]], dtype=float32) Coordinates: time datetime64[ns] 2021-10-10 * lat (lat) float64 35.0 35.25 35.5 35.75 36.0 ... 42.25 42.5 42.75 43.0 * lon (lon) float64 23.0 23.25 23.5 23.75 24.0 ... 47.25 47.5 47.75 48.0 Attributes: long_name: ** 2 m above ground temperature [k]
- lat: 33
- lon: 101
- 296.1547 296.10468 296.17468 ... 286.39468 288.48468 288.38467
array([[296.1547 , 296.10468, 296.17468, ..., 280.39468, 279.66467, 280.41467], [296.25467, 296.10468, 295.91467, ..., 280.63467, 280.8447 , 280.0847 ], [296.25467, 296.1247 , 295.69467, ..., 280.56467, 281.5247 , 280.81467], ..., [279.8647 , 279.0247 , 279.03467, ..., 277.2147 , 282.5947 , 288.07468], [278.97467, 279.79468, 279.60468, ..., 281.73468, 287.4647 , 288.79468], [278.7147 , 277.7147 , 277.75467, ..., 286.39468, 288.48468, 288.38467]], dtype=float32)
- time()datetime64[ns]2021-10-10
- grads_dim :
- t
- grads_mapping :
- linear
- grads_size :
- 121
- grads_min :
- 00z10oct2021
- grads_step :
- 1hr
- long_name :
- time
- minimum :
- 00z10oct2021
- maximum :
- 00z15oct2021
- resolution :
- 0.041666668
array('2021-10-10T00:00:00.000000000', dtype='datetime64[ns]')
- lat(lat)float6435.0 35.25 35.5 ... 42.5 42.75 43.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array([35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. ])
- lon(lon)float6423.0 23.25 23.5 ... 47.5 47.75 48.0
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array([23. , 23.25, 23.5 , 23.75, 24. , 24.25, 24.5 , 24.75, 25. , 25.25, 25.5 , 25.75, 26. , 26.25, 26.5 , 26.75, 27. , 27.25, 27.5 , 27.75, 28. , 28.25, 28.5 , 28.75, 29. , 29.25, 29.5 , 29.75, 30. , 30.25, 30.5 , 30.75, 31. , 31.25, 31.5 , 31.75, 32. , 32.25, 32.5 , 32.75, 33. , 33.25, 33.5 , 33.75, 34. , 34.25, 34.5 , 34.75, 35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. , 43.25, 43.5 , 43.75, 44. , 44.25, 44.5 , 44.75, 45. , 45.25, 45.5 , 45.75, 46. , 46.25, 46.5 , 46.75, 47. , 47.25, 47.5 , 47.75, 48. ])
- long_name :
- ** 2 m above ground temperature [k]
Note that the time
dimension has disappeared. How?
Now let’s simply visualize the subsetted dataset.
tmp2m_subset.plot(cmap='gnuplot', vmin=260, vmax=300)
<matplotlib.collections.QuadMesh at 0x2813f3ffcd0>

It is crucial to realize the importance of defining the coordinate reference systems (crs) of the multi-dimensional atmospheric data we are playing with. The ignorance or misuse of the crs might introduce problems later on. But in our analysis, we won’t be dealing with the crs information for the simplicity. If you’ve never heard of the coordinate reference systems, please refer to this documentation.
Hourly averages over the first 3 days¶
Let’s make a graph showing what the average values in each hour will be (Remember that we have a forecast range of three days). For example, we can elaborate on analyzing the 3-days average temperature for 01 UTC. We will utilize the groupby
function, which allows us to group the dimensional properties of data according to certain criteria.
%%time
# Use groupby on the dataset and get the mean
ds_tmp2m.groupby('time.hour').mean()
Wall time: 4min 36s
<xarray.DataArray 'tmp2m' (hour: 24, lat: 33, lon: 101)> array([[[296.0615 , 296.20145, 296.31482, ..., 281.43814, 280.5548 , 280.71146], [295.95145, 296.01813, 296.0048 , ..., 281.64148, 281.77145, 280.7548 ], [295.83813, 295.87814, 295.5748 , ..., 281.47812, 282.18814, 281.34482], ..., [280.73477, 279.52814, 279.5348 , ..., 278.70816, 283.61813, 288.74814], [280.42148, 281.27148, 280.95145, ..., 283.0048 , 288.08145, 289.35147], [280.1648 , 279.38147, 279.39813, ..., 287.12482, 289.1248 , 289.16812]], [[295.87402, 295.92734, 296.104 , ..., 280.93735, 280.08066, 280.224 ], [295.75732, 295.78732, 295.67065, ..., 281.1107 , 281.2507 , 280.314 ], [295.77066, 295.7407 , 295.31067, ..., 281.01733, 281.644 , 280.92398], ... [280.4172 , 278.9839 , 279.2172 , ..., 280.7172 , 284.45053, 289.31717], [280.25052, 281.18387, 280.95053, ..., 284.08386, 288.7172 , 290.0172 ], [279.9172 , 279.55054, 279.78384, ..., 287.85056, 289.8172 , 289.9172 ]], [[295.70114, 295.86783, 295.90115, ..., 283.66782, 282.20114, 282.4678 ], [295.76782, 295.93448, 295.66785, ..., 284.2345 , 283.83447, 282.5678 ], [295.4678 , 295.66782, 295.33447, ..., 283.43448, 283.93448, 283.1345 ], ..., [280.36783, 278.9678 , 279.16782, ..., 280.56784, 284.6345 , 289.36783], [280.26782, 281.16782, 280.9678 , ..., 284.0678 , 288.80115, 290.0012 ], [279.86783, 279.53452, 279.83447, ..., 287.90115, 289.80115, 289.90115]]], dtype=float32) Coordinates: * lat (lat) float64 35.0 35.25 35.5 35.75 36.0 ... 42.25 42.5 42.75 43.0 * lon (lon) float64 23.0 23.25 23.5 23.75 24.0 ... 47.25 47.5 47.75 48.0 * hour (hour) int64 0 1 2 3 4 5 6 7 8 9 ... 14 15 16 17 18 19 20 21 22 23
- hour: 24
- lat: 33
- lon: 101
- 296.0615 296.20145 296.31482 ... 287.90115 289.80115 289.90115
array([[[296.0615 , 296.20145, 296.31482, ..., 281.43814, 280.5548 , 280.71146], [295.95145, 296.01813, 296.0048 , ..., 281.64148, 281.77145, 280.7548 ], [295.83813, 295.87814, 295.5748 , ..., 281.47812, 282.18814, 281.34482], ..., [280.73477, 279.52814, 279.5348 , ..., 278.70816, 283.61813, 288.74814], [280.42148, 281.27148, 280.95145, ..., 283.0048 , 288.08145, 289.35147], [280.1648 , 279.38147, 279.39813, ..., 287.12482, 289.1248 , 289.16812]], [[295.87402, 295.92734, 296.104 , ..., 280.93735, 280.08066, 280.224 ], [295.75732, 295.78732, 295.67065, ..., 281.1107 , 281.2507 , 280.314 ], [295.77066, 295.7407 , 295.31067, ..., 281.01733, 281.644 , 280.92398], ... [280.4172 , 278.9839 , 279.2172 , ..., 280.7172 , 284.45053, 289.31717], [280.25052, 281.18387, 280.95053, ..., 284.08386, 288.7172 , 290.0172 ], [279.9172 , 279.55054, 279.78384, ..., 287.85056, 289.8172 , 289.9172 ]], [[295.70114, 295.86783, 295.90115, ..., 283.66782, 282.20114, 282.4678 ], [295.76782, 295.93448, 295.66785, ..., 284.2345 , 283.83447, 282.5678 ], [295.4678 , 295.66782, 295.33447, ..., 283.43448, 283.93448, 283.1345 ], ..., [280.36783, 278.9678 , 279.16782, ..., 280.56784, 284.6345 , 289.36783], [280.26782, 281.16782, 280.9678 , ..., 284.0678 , 288.80115, 290.0012 ], [279.86783, 279.53452, 279.83447, ..., 287.90115, 289.80115, 289.90115]]], dtype=float32)
- lat(lat)float6435.0 35.25 35.5 ... 42.5 42.75 43.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array([35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. ])
- lon(lon)float6423.0 23.25 23.5 ... 47.5 47.75 48.0
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array([23. , 23.25, 23.5 , 23.75, 24. , 24.25, 24.5 , 24.75, 25. , 25.25, 25.5 , 25.75, 26. , 26.25, 26.5 , 26.75, 27. , 27.25, 27.5 , 27.75, 28. , 28.25, 28.5 , 28.75, 29. , 29.25, 29.5 , 29.75, 30. , 30.25, 30.5 , 30.75, 31. , 31.25, 31.5 , 31.75, 32. , 32.25, 32.5 , 32.75, 33. , 33.25, 33.5 , 33.75, 34. , 34.25, 34.5 , 34.75, 35. , 35.25, 35.5 , 35.75, 36. , 36.25, 36.5 , 36.75, 37. , 37.25, 37.5 , 37.75, 38. , 38.25, 38.5 , 38.75, 39. , 39.25, 39.5 , 39.75, 40. , 40.25, 40.5 , 40.75, 41. , 41.25, 41.5 , 41.75, 42. , 42.25, 42.5 , 42.75, 43. , 43.25, 43.5 , 43.75, 44. , 44.25, 44.5 , 44.75, 45. , 45.25, 45.5 , 45.75, 46. , 46.25, 46.5 , 46.75, 47. , 47.25, 47.5 , 47.75, 48. ])
- hour(hour)int640 1 2 3 4 5 6 ... 18 19 20 21 22 23
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], dtype=int64)
How long do you think it would take the computer to perform the calculation above?
It took almost 5 minutes to run the code cell above, therefore we better select a particular grid point, on which we will perform calculations (e.g. the grid over the Istanbul city).
Once we subset the data on a single latitude and longitude point, the lat
and lon
dimensions will disappear. Can you guess why?
# Subset a grid near Istanbul and convert Kelvin to Celcius
ds_tmp2m_ist = ds_tmp2m.sel(lat=41, lon=29) - 273.15
ds_tmp2m_ist
<xarray.DataArray 'tmp2m' (time: 72)> array([16.9747 , 16.948883, 16.94281 , 16.868683, 16.761108, 16.72232 , 16.78598 , 16.87439 , 17.141907, 17.674194, 17.86615 , 17.84195 , 17.641937, 17.18393 , 16.838959, 16.650024, 16.511108, 16.411102, 16.311096, 16.35202 , 16.392456, 16.359009, 16.401031, 16.467255, 16.512634, 16.469727, 16.457275, 16.445465, 16.377533, 16.507965, 16.812256, 17.273285, 17.963013, 18.88739 , 19.32483 , 19.75 , 20.0542 , 19.766998, 18.85608 , 18.49411 , 17.8526 , 17.608795, 17.456818, 16.888916, 17.006958, 16.975128, 16.764404, 16.62976 , 16.457123, 16.19342 , 16.16211 , 16.1969 , 16.237915, 16.477448, 16.92517 , 17.549744, 18.56668 , 19.533813, 20.025757, 20.157227, 19.67218 , 19.336304, 18.262115, 17.581482, 16.698456, 17.18634 , 17.111084, 16.845367, 16.788483, 17.00241 , 16.836182, 16.75647 ], dtype=float32) Coordinates: * time (time) datetime64[ns] 2021-10-10 ... 2021-10-12T23:00:00 lat float64 41.0 lon float64 29.0
- time: 72
- 16.9747 16.948883 16.94281 16.868683 ... 17.00241 16.836182 16.75647
array([16.9747 , 16.948883, 16.94281 , 16.868683, 16.761108, 16.72232 , 16.78598 , 16.87439 , 17.141907, 17.674194, 17.86615 , 17.84195 , 17.641937, 17.18393 , 16.838959, 16.650024, 16.511108, 16.411102, 16.311096, 16.35202 , 16.392456, 16.359009, 16.401031, 16.467255, 16.512634, 16.469727, 16.457275, 16.445465, 16.377533, 16.507965, 16.812256, 17.273285, 17.963013, 18.88739 , 19.32483 , 19.75 , 20.0542 , 19.766998, 18.85608 , 18.49411 , 17.8526 , 17.608795, 17.456818, 16.888916, 17.006958, 16.975128, 16.764404, 16.62976 , 16.457123, 16.19342 , 16.16211 , 16.1969 , 16.237915, 16.477448, 16.92517 , 17.549744, 18.56668 , 19.533813, 20.025757, 20.157227, 19.67218 , 19.336304, 18.262115, 17.581482, 16.698456, 17.18634 , 17.111084, 16.845367, 16.788483, 17.00241 , 16.836182, 16.75647 ], dtype=float32)
- time(time)datetime64[ns]2021-10-10 ... 2021-10-12T23:00:00
- grads_dim :
- t
- grads_mapping :
- linear
- grads_size :
- 121
- grads_min :
- 00z10oct2021
- grads_step :
- 1hr
- long_name :
- time
- minimum :
- 00z10oct2021
- maximum :
- 00z15oct2021
- resolution :
- 0.041666668
array(['2021-10-10T00:00:00.000000000', '2021-10-10T01:00:00.000000000', '2021-10-10T02:00:00.000000000', '2021-10-10T03:00:00.000000000', '2021-10-10T04:00:00.000000000', '2021-10-10T05:00:00.000000000', '2021-10-10T06:00:00.000000000', '2021-10-10T07:00:00.000000000', '2021-10-10T08:00:00.000000000', '2021-10-10T09:00:00.000000000', '2021-10-10T10:00:00.000000000', '2021-10-10T11:00:00.000000000', '2021-10-10T12:00:00.000000000', '2021-10-10T13:00:00.000000000', '2021-10-10T14:00:00.000000000', '2021-10-10T15:00:00.000000000', '2021-10-10T16:00:00.000000000', '2021-10-10T17:00:00.000000000', '2021-10-10T18:00:00.000000000', '2021-10-10T19:00:00.000000000', '2021-10-10T20:00:00.000000000', '2021-10-10T21:00:00.000000000', '2021-10-10T22:00:00.000000000', '2021-10-10T23:00:00.000000000', '2021-10-11T00:00:00.000000000', '2021-10-11T01:00:00.000000000', '2021-10-11T02:00:00.000000000', '2021-10-11T03:00:00.000000000', '2021-10-11T04:00:00.000000000', '2021-10-11T05:00:00.000000000', '2021-10-11T06:00:00.000000000', '2021-10-11T07:00:00.000000000', '2021-10-11T08:00:00.000000000', '2021-10-11T09:00:00.000000000', '2021-10-11T10:00:00.000000000', '2021-10-11T11:00:00.000000000', '2021-10-11T12:00:00.000000000', '2021-10-11T13:00:00.000000000', '2021-10-11T14:00:00.000000000', '2021-10-11T15:00:00.000000000', '2021-10-11T16:00:00.000000000', '2021-10-11T17:00:00.000000000', '2021-10-11T18:00:00.000000000', '2021-10-11T19:00:00.000000000', '2021-10-11T20:00:00.000000000', '2021-10-11T21:00:00.000000000', '2021-10-11T22:00:00.000000000', '2021-10-11T23:00:00.000000000', '2021-10-12T00:00:00.000000000', '2021-10-12T01:00:00.000000000', '2021-10-12T02:00:00.000000000', '2021-10-12T03:00:00.000000000', '2021-10-12T04:00:00.000000000', '2021-10-12T05:00:00.000000000', '2021-10-12T06:00:00.000000000', '2021-10-12T07:00:00.000000000', '2021-10-12T08:00:00.000000000', '2021-10-12T09:00:00.000000000', '2021-10-12T10:00:00.000000000', '2021-10-12T11:00:00.000000000', '2021-10-12T12:00:00.000000000', '2021-10-12T13:00:00.000000000', '2021-10-12T14:00:00.000000000', '2021-10-12T15:00:00.000000000', '2021-10-12T16:00:00.000000000', '2021-10-12T17:00:00.000000000', '2021-10-12T18:00:00.000000000', '2021-10-12T19:00:00.000000000', '2021-10-12T20:00:00.000000000', '2021-10-12T21:00:00.000000000', '2021-10-12T22:00:00.000000000', '2021-10-12T23:00:00.000000000'], dtype='datetime64[ns]')
- lat()float6441.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array(41.)
- lon()float6429.0
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array(29.)
Now let’s get the hourly averages for the clipped dataset, which is a 1-dimensional array defined with a time dimension.
%%time
ds_tmp2m_ist.groupby('time.hour').mean().plot()
Wall time: 30.9 ms
[<matplotlib.lines.Line2D at 0x2813fb2ef70>]

We can also find the maximum temperature values at each hour over the forecast period instead of the averages.
%%time
ds_tmp2m_ist.groupby('time.hour').max().plot()
Wall time: 21.9 ms
[<matplotlib.lines.Line2D at 0x2813fb8e790>]

Daily averages for the first 3 days¶
Do you think that we can calculate the daily averages instead of hourly ones?
If your answer was yes
, you’re perfect!
All you have to do is use time.day
instead of time.hour
in the groupby function.
ds_tmp2m_ist.groupby('time.day').mean()
<xarray.DataArray 'tmp2m' (day: 3)> array([15.44429 , 15.773591, 16.52334 ], dtype=float32) Coordinates: lat float64 41.0 lon float64 30.0 * day (day) int64 10 11 12
- day: 3
- 15.44429 15.773591 16.52334
array([15.44429 , 15.773591, 16.52334 ], dtype=float32)
- lat()float6441.0
- grads_dim :
- y
- grads_mapping :
- linear
- grads_size :
- 721
- units :
- degrees_north
- long_name :
- latitude
- minimum :
- -90.0
- maximum :
- 90.0
- resolution :
- 0.25
array(41.)
- lon()float6430.0
- grads_dim :
- x
- grads_mapping :
- linear
- grads_size :
- 1440
- units :
- degrees_east
- long_name :
- longitude
- minimum :
- 0.0
- maximum :
- 359.75
- resolution :
- 0.25
array(30.)
- day(day)int6410 11 12
array([10, 11, 12], dtype=int64)
Check out the new dimensions above! What do you think about it?
Further Discussion¶
We realize how easy it is to process the time dimension of a netCDF data using xarray. See other documentations on Climaturk
to become more familiar with handling the atmospheric data.
Elaborate on the questions below:
Question 1: Is it possible to calculate the monthly averages using the dataset we have retrieved above
Question 2: Can we make use of the
groupby
feature for anomaly calculations?
See you until the next time!
Blog by:
Berkay DÖNMEZ :
Linkedin | Github | Twitter | Instagram
Kutay DÖNMEZ :
LinkedIn | Github | Twitter | Instagram