%matplotlib inline
import xarray as xr
url_hsds = 'http://149.165.156.174:5101/home/john/tmp2m_2months.nc'
ds_hsds = xr.open_dataset(url_hsds, engine='h5netcdf')
loc_hsds = ds_hsds.sel(longitude=-72.6+360, latitude=41.55, method='nearest')
%time loc_hsds['TMP_2maboveground'].plot();
/notebooks/rsignell/my-conda-envs/h5pyd/lib/python3.6/site-packages/xarray/plot/utils.py:51: FutureWarning: 'pandas.tseries.converter.register' has been moved and renamed to 'pandas.plotting.register_matplotlib_converters'. converter.register()
CPU times: user 92 ms, sys: 8 ms, total: 100 ms Wall time: 2.25 s
[<matplotlib.lines.Line2D at 0x7f8f1dd07780>]
url_dap = 'http://js-170-55.jetstream-cloud.org/thredds/dodsC/data/CFSR/2017/tmp2m_2months.nc'
ds_dap = xr.open_dataset(url_dap)
loc_dap = ds_dap.sel(longitude=-72.6+360, latitude=41.55, method='nearest')
%time loc_dap['TMP_2maboveground'].plot();
CPU times: user 76 ms, sys: 0 ns, total: 76 ms Wall time: 14.6 s
[<matplotlib.lines.Line2D at 0x7f8f10333ef0>]
url_nc = '/notebooks/rsignell/data/CFSR/tmp2m_2months.nc'
ds_nc = xr.open_dataset(url_nc)
loc_nc = ds_nc.sel(longitude=-72.6+360, latitude=41.55, method='nearest')
%time loc_nc['TMP_2maboveground'].plot();
CPU times: user 17.2 s, sys: 148 ms, total: 17.4 s Wall time: 17.4 s
[<matplotlib.lines.Line2D at 0x7f8f0f3ef908>]
loc_hsds['TMP_2maboveground']
<xarray.DataArray 'TMP_2maboveground' (time: 1416)> array([ 276.492188, 276.21875 , 275.921875, ..., 282.929688, 282.132812, 281.851562]) Coordinates: latitude float64 41.6 longitude float64 287.4 * time (time) float64 1.483e+09 1.483e+09 1.483e+09 1.483e+09 ... Attributes: least_significant_digit: [2]
loc_dap['TMP_2maboveground']
<xarray.DataArray 'TMP_2maboveground' (time: 1416)> array([ 276.492188, 276.21875 , 275.921875, ..., 282.929688, 282.132812, 281.851562]) Coordinates: latitude float64 41.6 * time (time) datetime64[ns] 2017-01-01T01:00:00 2017-01-01T02:00:00 ... longitude float64 287.4 Attributes: short_name: TMP_2maboveground long_name: Temperature level: 2 m above ground units: K _ChunkSizes: [ 1 440 880]
loc_nc['TMP_2maboveground']
<xarray.DataArray 'TMP_2maboveground' (time: 1416)> array([ 276.492188, 276.21875 , 275.921875, ..., 282.929688, 282.132812, 281.851562]) Coordinates: latitude float64 41.6 longitude float64 287.4 * time (time) datetime64[ns] 2017-01-01T01:00:00 2017-01-01T02:00:00 ... Attributes: short_name: TMP_2maboveground long_name: Temperature level: 2 m above ground units: K
import pandas as pd
url = 'https://js-170-55.jetstream-cloud.org/thredds/ncss/grib/CFSr_v2/tmp2m?latitude=24.&longitude=24.&time_start=2017-01-01T01%3A00%3A00Z&time_end=2017-12-01T00%3A00%3A00Z&vertCoord=&accept=csv'
df = pd.read_csv(url)
dap_url = 'http://js-170-55.jetstream-cloud.org/thredds/dodsC/grib/CFSr_v2/tmp2m'
ds2 = xr.open_dataset(dap_url)