Box streaming¶
In this notebook, we will explore other capabilities of the hvPlot ecosystem.
In particular, we will look at the hist
and BoxDraw stream
methods, using the AIMS eReefs database.
See also
For other inspirational functionalities, you might be interested in the examples from the HoloViews and GeoViews gallery.
Load the required Python libraries¶
First of all, load the necessary libraries. These are the ones we discussed previously:
numpy
matplotlib
cartopy
pandas
xarray
holoviews
geoviews
import os
import numpy as np
import pandas as pd
import xarray as xr
import cartopy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
cartopy.config['data_dir'] = os.getenv('CARTOPY_DIR', cartopy.config.get('data_dir'))
import cmocean
import hvplot.xarray
import holoviews as hv
from holoviews import opts, dim
import geoviews as gv
import geoviews.feature as gf
from geoviews import tile_sources as gvts
from cartopy import crs
gv.extension('bokeh')
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
Build a multi-file dataset¶
We will use the open_mfdataset
function from xArray
to open multiple netCDF files into a single xarray Dataset.
We will query load the GBR4km dataset from the AIMS server, so let’s first define the base URL:
base_url = "http://thredds.ereefs.aims.gov.au/thredds/dodsC/s3://aims-ereefs-public-prod/derived/ncaggregate/ereefs/gbr4_v2/daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-"
For the sake of the demonstration, we will only use 2 months:
month_st = 3 # Starting month (March)
month_ed = 4 # Ending month (April)
year = 2018 # Year
# Based on the server the file naming convention
hydrofiles = [f"{base_url}{year}-{month:02}.nc" for month in range(month_st, month_ed+1)]
hydrofiles
['http://thredds.ereefs.aims.gov.au/thredds/dodsC/s3://aims-ereefs-public-prod/derived/ncaggregate/ereefs/gbr4_v2/daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-03.nc',
'http://thredds.ereefs.aims.gov.au/thredds/dodsC/s3://aims-ereefs-public-prod/derived/ncaggregate/ereefs/gbr4_v2/daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-04.nc']
Loading the dataset into xArray¶
Using xArray
, we open these files into a Dataset
:
ds_hydro = xr.open_mfdataset(hydrofiles)
ds_hydro
<xarray.Dataset> Dimensions: (k: 17, latitude: 723, longitude: 491, time: 61) Coordinates: * time (time) datetime64[ns] 2018-02-28T14:00:00 ... 2018-04-29T14:... zc (k) float64 dask.array<chunksize=(17,), meta=np.ndarray> * latitude (latitude) float64 -28.7 -28.67 -28.64 ... -7.096 -7.066 -7.036 * longitude (longitude) float64 142.2 142.2 142.2 ... 156.8 156.8 156.9 Dimensions without coordinates: k Data variables: mean_cur (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray> salt (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray> temp (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray> u (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray> v (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray> mean_wspeed (time, latitude, longitude) float32 dask.array<chunksize=(31, 723, 491), meta=np.ndarray> eta (time, latitude, longitude) float32 dask.array<chunksize=(31, 723, 491), meta=np.ndarray> wspeed_u (time, latitude, longitude) float32 dask.array<chunksize=(31, 723, 491), meta=np.ndarray> wspeed_v (time, latitude, longitude) float32 dask.array<chunksize=(31, 723, 491), meta=np.ndarray> Attributes: (12/21) Conventions: CF-1.0 NCO: 4.4.4 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T14:27:56+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... ... ... paramhead: GBR 4km resolution grid shoc_version: v1.1 rev(5620) technical_guide_link: https://eatlas.org.au/pydio/public/aims-... technical_guide_publish_date: 2020-08-18 title: eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 d... DODS_EXTRA.Unlimited_Dimension: time
- k: 17
- latitude: 723
- longitude: 491
- time: 61
- time(time)datetime64[ns]2018-02-28T14:00:00 ... 2018-04-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2018-02-28T14:00:00.000000000', '2018-03-01T14:00:00.000000000', '2018-03-02T14:00:00.000000000', '2018-03-03T14:00:00.000000000', '2018-03-04T14:00:00.000000000', '2018-03-05T14:00:00.000000000', '2018-03-06T14:00:00.000000000', '2018-03-07T14:00:00.000000000', '2018-03-08T14:00:00.000000000', '2018-03-09T14:00:00.000000000', '2018-03-10T14:00:00.000000000', '2018-03-11T14:00:00.000000000', '2018-03-12T14:00:00.000000000', '2018-03-13T14:00:00.000000000', '2018-03-14T14:00:00.000000000', '2018-03-15T14:00:00.000000000', '2018-03-16T14:00:00.000000000', '2018-03-17T14:00:00.000000000', '2018-03-18T14:00:00.000000000', '2018-03-19T14:00:00.000000000', '2018-03-20T14:00:00.000000000', '2018-03-21T14:00:00.000000000', '2018-03-22T14:00:00.000000000', '2018-03-23T14:00:00.000000000', '2018-03-24T14:00:00.000000000', '2018-03-25T14:00:00.000000000', '2018-03-26T14:00:00.000000000', '2018-03-27T14:00:00.000000000', '2018-03-28T14:00:00.000000000', '2018-03-29T14:00:00.000000000', '2018-03-30T14:00:00.000000000', '2018-03-31T14:00:00.000000000', '2018-04-01T14:00:00.000000000', '2018-04-02T14:00:00.000000000', '2018-04-03T14:00:00.000000000', '2018-04-04T14:00:00.000000000', '2018-04-05T14:00:00.000000000', '2018-04-06T14:00:00.000000000', '2018-04-07T14:00:00.000000000', '2018-04-08T14:00:00.000000000', '2018-04-09T14:00:00.000000000', '2018-04-10T14:00:00.000000000', '2018-04-11T14:00:00.000000000', '2018-04-12T14:00:00.000000000', '2018-04-13T14:00:00.000000000', '2018-04-14T14:00:00.000000000', '2018-04-15T14:00:00.000000000', '2018-04-16T14:00:00.000000000', '2018-04-17T14:00:00.000000000', '2018-04-18T14:00:00.000000000', '2018-04-19T14:00:00.000000000', '2018-04-20T14:00:00.000000000', '2018-04-21T14:00:00.000000000', '2018-04-22T14:00:00.000000000', '2018-04-23T14:00:00.000000000', '2018-04-24T14:00:00.000000000', '2018-04-25T14:00:00.000000000', '2018-04-26T14:00:00.000000000', '2018-04-27T14:00:00.000000000', '2018-04-28T14:00:00.000000000', '2018-04-29T14:00:00.000000000'], dtype='datetime64[ns]')
- zc(k)float64dask.array<chunksize=(17,), meta=np.ndarray>
- units :
- m
- positive :
- up
- long_name :
- Z coordinate
- axis :
- Z
- coordinate_type :
- Z
- _CoordinateAxisType :
- Height
- _CoordinateZisPositive :
- up
Array Chunk Bytes 136 B 136 B Shape (17,) (17,) Count 5 Tasks 1 Chunks Type float64 numpy.ndarray - latitude(latitude)float64-28.7 -28.67 ... -7.066 -7.036
- units :
- degrees_north
- long_name :
- Latitude
- standard_name :
- latitude
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-28.696022, -28.666022, -28.636022, ..., -7.096022, -7.066022, -7.036022])
- longitude(longitude)float64142.2 142.2 142.2 ... 156.8 156.9
- units :
- degrees_east
- long_name :
- Longitude
- standard_name :
- longitude
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([142.168788, 142.198788, 142.228788, ..., 156.808788, 156.838788, 156.868788])
- mean_cur(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- short_name :
- mean_cur
- aggregation :
- mean_speed
- standard_name :
- mean_current_speed
- long_name :
- mean_current_speed
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 1.47 GB 748.33 MB Shape (61, 17, 723, 491) (31, 17, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - salt(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/practical_salinity
- short_name :
- salt
- aggregation :
- Daily
- units :
- PSU
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://environment.data.gov.au/water/quality/def/unit/PSU
- long_name :
- Salinity
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 1.47 GB 748.33 MB Shape (61, 17, 723, 491) (31, 17, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - temp(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_temperature
- short_name :
- temp
- aggregation :
- Daily
- units :
- degrees C
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#DegreeCelsius
- long_name :
- Temperature
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 1.47 GB 748.33 MB Shape (61, 17, 723, 491) (31, 17, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - u(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_eastward
- short_name :
- u
- vector_name :
- Currents
- standard_name :
- eastward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Eastward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 1.47 GB 748.33 MB Shape (61, 17, 723, 491) (31, 17, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - v(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 723, 491), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_northward
- short_name :
- v
- vector_name :
- Currents
- standard_name :
- northward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Northward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 1.47 GB 748.33 MB Shape (61, 17, 723, 491) (31, 17, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - mean_wspeed(time, latitude, longitude)float32dask.array<chunksize=(31, 723, 491), meta=np.ndarray>
- units :
- ms-1
- short_name :
- mean_wspeed
- aggregation :
- mean_speed
- standard_name :
- mean_wind_speed
- long_name :
- mean_wind_speed
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 86.62 MB 44.02 MB Shape (61, 723, 491) (31, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - eta(time, latitude, longitude)float32dask.array<chunksize=(31, 723, 491), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_near_surface
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_surface_elevation
- short_name :
- eta
- standard_name :
- sea_surface_height_above_sea_level
- aggregation :
- Daily
- units :
- metre
- positive :
- up
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#Meter
- long_name :
- Surface elevation
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 86.62 MB 44.02 MB Shape (61, 723, 491) (31, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_u(time, latitude, longitude)float32dask.array<chunksize=(31, 723, 491), meta=np.ndarray>
- short_name :
- wspeed_u
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- eastward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 86.62 MB 44.02 MB Shape (61, 723, 491) (31, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_v(time, latitude, longitude)float32dask.array<chunksize=(31, 723, 491), meta=np.ndarray>
- short_name :
- wspeed_v
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- northward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 86.62 MB 44.02 MB Shape (61, 723, 491) (31, 723, 491) Count 6 Tasks 2 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- NCO :
- 4.4.4
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T14:27:56+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-03
- aims_ncaggregate_firstDate :
- 2018-03-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-03::MD5:d38e2cde5a55d183aa98d84609b3636a]
- aims_ncaggregate_lastDate :
- 2018-03-31T00:00:00+10:00
- description :
- Aggregation of raw hourly input data (from eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 subset) to daily means. Also calculates mean magnitude of wind and ocean current speeds. Data is regridded from curvilinear (per input data) to rectilinear via inverse weighted distance from up to 4 closest cells.
- hasVocab :
- 1
- history :
- Fri Nov 15 11:29:35 2019: ncrcat -o ../gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc gbr4_simple_2018-03-1.nc Thu Nov 14 17:41:17 2019: ncks -4 -L 3 -d time,0,624 gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc 2020-08-20T14:55:54+10:00: vendor: AIMS; processing: None summaries 2020-08-21T14:27:56+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- nco_openmp_thread_number :
- 1
- paramfile :
- in.prm
- paramhead :
- GBR 4km resolution grid
- shoc_version :
- v1.1 rev(5620)
- technical_guide_link :
- https://eatlas.org.au/pydio/public/aims-ereefs-platform-technical-guide-to-derived-products-from-csiro-ereefs-models-pdf
- technical_guide_publish_date :
- 2020-08-18
- title :
- eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 daily aggregation
- DODS_EXTRA.Unlimited_Dimension :
- time
Clip the Dataset¶
To reduce the Dataset
size we will clip the spatial extent based on longitudinal and latitudinal values.
As we already saw this is easely done using the sel
function with the slice
method.
min_lon = 146.5 # lower left longitude
min_lat = -20 # lower left latitude
max_lon = 148 # upper right longitude
max_lat = -17 # upper right latitude
# Defining the boundaries
lon_bnds = [min_lon, max_lon]
lat_bnds = [min_lat, max_lat]
# Performing the reduction
ds_hydro_clip = ds_hydro.sel(latitude=slice(*lat_bnds), longitude=slice(*lon_bnds))
ds_hydro_clip
<xarray.Dataset> Dimensions: (k: 17, latitude: 100, longitude: 50, time: 61) Coordinates: * time (time) datetime64[ns] 2018-02-28T14:00:00 ... 2018-04-29T14:... zc (k) float64 dask.array<chunksize=(17,), meta=np.ndarray> * latitude (latitude) float64 -20.0 -19.97 -19.94 ... -17.09 -17.06 -17.03 * longitude (longitude) float64 146.5 146.5 146.6 ... 147.9 148.0 148.0 Dimensions without coordinates: k Data variables: mean_cur (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> salt (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> temp (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> u (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> v (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> mean_wspeed (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> eta (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> wspeed_u (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> wspeed_v (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> Attributes: (12/21) Conventions: CF-1.0 NCO: 4.4.4 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T14:27:56+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... ... ... paramhead: GBR 4km resolution grid shoc_version: v1.1 rev(5620) technical_guide_link: https://eatlas.org.au/pydio/public/aims-... technical_guide_publish_date: 2020-08-18 title: eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 d... DODS_EXTRA.Unlimited_Dimension: time
- k: 17
- latitude: 100
- longitude: 50
- time: 61
- time(time)datetime64[ns]2018-02-28T14:00:00 ... 2018-04-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2018-02-28T14:00:00.000000000', '2018-03-01T14:00:00.000000000', '2018-03-02T14:00:00.000000000', '2018-03-03T14:00:00.000000000', '2018-03-04T14:00:00.000000000', '2018-03-05T14:00:00.000000000', '2018-03-06T14:00:00.000000000', '2018-03-07T14:00:00.000000000', '2018-03-08T14:00:00.000000000', '2018-03-09T14:00:00.000000000', '2018-03-10T14:00:00.000000000', '2018-03-11T14:00:00.000000000', '2018-03-12T14:00:00.000000000', '2018-03-13T14:00:00.000000000', '2018-03-14T14:00:00.000000000', '2018-03-15T14:00:00.000000000', '2018-03-16T14:00:00.000000000', '2018-03-17T14:00:00.000000000', '2018-03-18T14:00:00.000000000', '2018-03-19T14:00:00.000000000', '2018-03-20T14:00:00.000000000', '2018-03-21T14:00:00.000000000', '2018-03-22T14:00:00.000000000', '2018-03-23T14:00:00.000000000', '2018-03-24T14:00:00.000000000', '2018-03-25T14:00:00.000000000', '2018-03-26T14:00:00.000000000', '2018-03-27T14:00:00.000000000', '2018-03-28T14:00:00.000000000', '2018-03-29T14:00:00.000000000', '2018-03-30T14:00:00.000000000', '2018-03-31T14:00:00.000000000', '2018-04-01T14:00:00.000000000', '2018-04-02T14:00:00.000000000', '2018-04-03T14:00:00.000000000', '2018-04-04T14:00:00.000000000', '2018-04-05T14:00:00.000000000', '2018-04-06T14:00:00.000000000', '2018-04-07T14:00:00.000000000', '2018-04-08T14:00:00.000000000', '2018-04-09T14:00:00.000000000', '2018-04-10T14:00:00.000000000', '2018-04-11T14:00:00.000000000', '2018-04-12T14:00:00.000000000', '2018-04-13T14:00:00.000000000', '2018-04-14T14:00:00.000000000', '2018-04-15T14:00:00.000000000', '2018-04-16T14:00:00.000000000', '2018-04-17T14:00:00.000000000', '2018-04-18T14:00:00.000000000', '2018-04-19T14:00:00.000000000', '2018-04-20T14:00:00.000000000', '2018-04-21T14:00:00.000000000', '2018-04-22T14:00:00.000000000', '2018-04-23T14:00:00.000000000', '2018-04-24T14:00:00.000000000', '2018-04-25T14:00:00.000000000', '2018-04-26T14:00:00.000000000', '2018-04-27T14:00:00.000000000', '2018-04-28T14:00:00.000000000', '2018-04-29T14:00:00.000000000'], dtype='datetime64[ns]')
- zc(k)float64dask.array<chunksize=(17,), meta=np.ndarray>
- units :
- m
- positive :
- up
- long_name :
- Z coordinate
- axis :
- Z
- coordinate_type :
- Z
- _CoordinateAxisType :
- Height
- _CoordinateZisPositive :
- up
Array Chunk Bytes 136 B 136 B Shape (17,) (17,) Count 5 Tasks 1 Chunks Type float64 numpy.ndarray - latitude(latitude)float64-20.0 -19.97 ... -17.06 -17.03
- units :
- degrees_north
- long_name :
- Latitude
- standard_name :
- latitude
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-19.996022, -19.966022, -19.936022, -19.906022, -19.876022, -19.846022, -19.816022, -19.786022, -19.756022, -19.726022, -19.696022, -19.666022, -19.636022, -19.606022, -19.576022, -19.546022, -19.516022, -19.486022, -19.456022, -19.426022, -19.396022, -19.366022, -19.336022, -19.306022, -19.276022, -19.246022, -19.216022, -19.186022, -19.156022, -19.126022, -19.096022, -19.066022, -19.036022, -19.006022, -18.976022, -18.946022, -18.916022, -18.886022, -18.856022, -18.826022, -18.796022, -18.766022, -18.736022, -18.706022, -18.676022, -18.646022, -18.616022, -18.586022, -18.556022, -18.526022, -18.496022, -18.466022, -18.436022, -18.406022, -18.376022, -18.346022, -18.316022, -18.286022, -18.256022, -18.226022, -18.196022, -18.166022, -18.136022, -18.106022, -18.076022, -18.046022, -18.016022, -17.986022, -17.956022, -17.926022, -17.896022, -17.866022, -17.836022, -17.806022, -17.776022, -17.746022, -17.716022, -17.686022, -17.656022, -17.626022, -17.596022, -17.566022, -17.536022, -17.506022, -17.476022, -17.446022, -17.416022, -17.386022, -17.356022, -17.326022, -17.296022, -17.266022, -17.236022, -17.206022, -17.176022, -17.146022, -17.116022, -17.086022, -17.056022, -17.026022])
- longitude(longitude)float64146.5 146.5 146.6 ... 148.0 148.0
- units :
- degrees_east
- long_name :
- Longitude
- standard_name :
- longitude
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.518788, 146.548788, 146.578788, 146.608788, 146.638788, 146.668788, 146.698788, 146.728788, 146.758788, 146.788788, 146.818788, 146.848788, 146.878788, 146.908788, 146.938788, 146.968788, 146.998788, 147.028788, 147.058788, 147.088788, 147.118788, 147.148788, 147.178788, 147.208788, 147.238788, 147.268788, 147.298788, 147.328788, 147.358788, 147.388788, 147.418788, 147.448788, 147.478788, 147.508788, 147.538788, 147.568788, 147.598788, 147.628788, 147.658788, 147.688788, 147.718788, 147.748788, 147.778788, 147.808788, 147.838788, 147.868788, 147.898788, 147.928788, 147.958788, 147.988788])
- mean_cur(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- short_name :
- mean_cur
- aggregation :
- mean_speed
- standard_name :
- mean_current_speed
- long_name :
- mean_current_speed
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - salt(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/practical_salinity
- short_name :
- salt
- aggregation :
- Daily
- units :
- PSU
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://environment.data.gov.au/water/quality/def/unit/PSU
- long_name :
- Salinity
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - temp(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_temperature
- short_name :
- temp
- aggregation :
- Daily
- units :
- degrees C
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#DegreeCelsius
- long_name :
- Temperature
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - u(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_eastward
- short_name :
- u
- vector_name :
- Currents
- standard_name :
- eastward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Eastward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - v(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_northward
- short_name :
- v
- vector_name :
- Currents
- standard_name :
- northward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Northward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - mean_wspeed(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- units :
- ms-1
- short_name :
- mean_wspeed
- aggregation :
- mean_speed
- standard_name :
- mean_wind_speed
- long_name :
- mean_wind_speed
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - eta(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_near_surface
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_surface_elevation
- short_name :
- eta
- standard_name :
- sea_surface_height_above_sea_level
- aggregation :
- Daily
- units :
- metre
- positive :
- up
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#Meter
- long_name :
- Surface elevation
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_u(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- short_name :
- wspeed_u
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- eastward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_v(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- short_name :
- wspeed_v
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- northward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- NCO :
- 4.4.4
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T14:27:56+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-03
- aims_ncaggregate_firstDate :
- 2018-03-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-03::MD5:d38e2cde5a55d183aa98d84609b3636a]
- aims_ncaggregate_lastDate :
- 2018-03-31T00:00:00+10:00
- description :
- Aggregation of raw hourly input data (from eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 subset) to daily means. Also calculates mean magnitude of wind and ocean current speeds. Data is regridded from curvilinear (per input data) to rectilinear via inverse weighted distance from up to 4 closest cells.
- hasVocab :
- 1
- history :
- Fri Nov 15 11:29:35 2019: ncrcat -o ../gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc gbr4_simple_2018-03-1.nc Thu Nov 14 17:41:17 2019: ncks -4 -L 3 -d time,0,624 gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc 2020-08-20T14:55:54+10:00: vendor: AIMS; processing: None summaries 2020-08-21T14:27:56+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- nco_openmp_thread_number :
- 1
- paramfile :
- in.prm
- paramhead :
- GBR 4km resolution grid
- shoc_version :
- v1.1 rev(5620)
- technical_guide_link :
- https://eatlas.org.au/pydio/public/aims-ereefs-platform-technical-guide-to-derived-products-from-csiro-ereefs-models-pdf
- technical_guide_publish_date :
- 2020-08-18
- title :
- eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 daily aggregation
- DODS_EXTRA.Unlimited_Dimension :
- time
Change coordinate name¶
To make it easier to process the xArray
dataset, we change the zc
coordinate to the same name as its dimension (i.e. k
).
This is done like this:
# Creation of a new coordinate k with the same array as zc
ds_hydro_clip.coords['k'] = ('zc',ds_hydro_clip.zc)
# Swapping `zc` with `k`
ds_hydro_clip = ds_hydro_clip.swap_dims({'zc':'k'})
# Ok we can now safely remove `zc`
ds_hydro_clip = ds_hydro_clip.drop(['zc'])
ds_hydro_clip
<xarray.Dataset> Dimensions: (k: 17, latitude: 100, longitude: 50, time: 61) Coordinates: * time (time) datetime64[ns] 2018-02-28T14:00:00 ... 2018-04-29T14:... * latitude (latitude) float64 -20.0 -19.97 -19.94 ... -17.09 -17.06 -17.03 * longitude (longitude) float64 146.5 146.5 146.6 ... 147.9 148.0 148.0 * k (k) float64 -145.0 -120.0 -103.0 -88.0 ... -5.55 -3.0 -1.5 -0.5 Data variables: mean_cur (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> salt (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> temp (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> u (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> v (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray> mean_wspeed (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> eta (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> wspeed_u (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> wspeed_v (time, latitude, longitude) float32 dask.array<chunksize=(31, 100, 50), meta=np.ndarray> Attributes: (12/21) Conventions: CF-1.0 NCO: 4.4.4 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T14:27:56+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... ... ... paramhead: GBR 4km resolution grid shoc_version: v1.1 rev(5620) technical_guide_link: https://eatlas.org.au/pydio/public/aims-... technical_guide_publish_date: 2020-08-18 title: eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 d... DODS_EXTRA.Unlimited_Dimension: time
- k: 17
- latitude: 100
- longitude: 50
- time: 61
- time(time)datetime64[ns]2018-02-28T14:00:00 ... 2018-04-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2018-02-28T14:00:00.000000000', '2018-03-01T14:00:00.000000000', '2018-03-02T14:00:00.000000000', '2018-03-03T14:00:00.000000000', '2018-03-04T14:00:00.000000000', '2018-03-05T14:00:00.000000000', '2018-03-06T14:00:00.000000000', '2018-03-07T14:00:00.000000000', '2018-03-08T14:00:00.000000000', '2018-03-09T14:00:00.000000000', '2018-03-10T14:00:00.000000000', '2018-03-11T14:00:00.000000000', '2018-03-12T14:00:00.000000000', '2018-03-13T14:00:00.000000000', '2018-03-14T14:00:00.000000000', '2018-03-15T14:00:00.000000000', '2018-03-16T14:00:00.000000000', '2018-03-17T14:00:00.000000000', '2018-03-18T14:00:00.000000000', '2018-03-19T14:00:00.000000000', '2018-03-20T14:00:00.000000000', '2018-03-21T14:00:00.000000000', '2018-03-22T14:00:00.000000000', '2018-03-23T14:00:00.000000000', '2018-03-24T14:00:00.000000000', '2018-03-25T14:00:00.000000000', '2018-03-26T14:00:00.000000000', '2018-03-27T14:00:00.000000000', '2018-03-28T14:00:00.000000000', '2018-03-29T14:00:00.000000000', '2018-03-30T14:00:00.000000000', '2018-03-31T14:00:00.000000000', '2018-04-01T14:00:00.000000000', '2018-04-02T14:00:00.000000000', '2018-04-03T14:00:00.000000000', '2018-04-04T14:00:00.000000000', '2018-04-05T14:00:00.000000000', '2018-04-06T14:00:00.000000000', '2018-04-07T14:00:00.000000000', '2018-04-08T14:00:00.000000000', '2018-04-09T14:00:00.000000000', '2018-04-10T14:00:00.000000000', '2018-04-11T14:00:00.000000000', '2018-04-12T14:00:00.000000000', '2018-04-13T14:00:00.000000000', '2018-04-14T14:00:00.000000000', '2018-04-15T14:00:00.000000000', '2018-04-16T14:00:00.000000000', '2018-04-17T14:00:00.000000000', '2018-04-18T14:00:00.000000000', '2018-04-19T14:00:00.000000000', '2018-04-20T14:00:00.000000000', '2018-04-21T14:00:00.000000000', '2018-04-22T14:00:00.000000000', '2018-04-23T14:00:00.000000000', '2018-04-24T14:00:00.000000000', '2018-04-25T14:00:00.000000000', '2018-04-26T14:00:00.000000000', '2018-04-27T14:00:00.000000000', '2018-04-28T14:00:00.000000000', '2018-04-29T14:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.0 -19.97 ... -17.06 -17.03
- units :
- degrees_north
- long_name :
- Latitude
- standard_name :
- latitude
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-19.996022, -19.966022, -19.936022, -19.906022, -19.876022, -19.846022, -19.816022, -19.786022, -19.756022, -19.726022, -19.696022, -19.666022, -19.636022, -19.606022, -19.576022, -19.546022, -19.516022, -19.486022, -19.456022, -19.426022, -19.396022, -19.366022, -19.336022, -19.306022, -19.276022, -19.246022, -19.216022, -19.186022, -19.156022, -19.126022, -19.096022, -19.066022, -19.036022, -19.006022, -18.976022, -18.946022, -18.916022, -18.886022, -18.856022, -18.826022, -18.796022, -18.766022, -18.736022, -18.706022, -18.676022, -18.646022, -18.616022, -18.586022, -18.556022, -18.526022, -18.496022, -18.466022, -18.436022, -18.406022, -18.376022, -18.346022, -18.316022, -18.286022, -18.256022, -18.226022, -18.196022, -18.166022, -18.136022, -18.106022, -18.076022, -18.046022, -18.016022, -17.986022, -17.956022, -17.926022, -17.896022, -17.866022, -17.836022, -17.806022, -17.776022, -17.746022, -17.716022, -17.686022, -17.656022, -17.626022, -17.596022, -17.566022, -17.536022, -17.506022, -17.476022, -17.446022, -17.416022, -17.386022, -17.356022, -17.326022, -17.296022, -17.266022, -17.236022, -17.206022, -17.176022, -17.146022, -17.116022, -17.086022, -17.056022, -17.026022])
- longitude(longitude)float64146.5 146.5 146.6 ... 148.0 148.0
- units :
- degrees_east
- long_name :
- Longitude
- standard_name :
- longitude
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.518788, 146.548788, 146.578788, 146.608788, 146.638788, 146.668788, 146.698788, 146.728788, 146.758788, 146.788788, 146.818788, 146.848788, 146.878788, 146.908788, 146.938788, 146.968788, 146.998788, 147.028788, 147.058788, 147.088788, 147.118788, 147.148788, 147.178788, 147.208788, 147.238788, 147.268788, 147.298788, 147.328788, 147.358788, 147.388788, 147.418788, 147.448788, 147.478788, 147.508788, 147.538788, 147.568788, 147.598788, 147.628788, 147.658788, 147.688788, 147.718788, 147.748788, 147.778788, 147.808788, 147.838788, 147.868788, 147.898788, 147.928788, 147.958788, 147.988788])
- k(k)float64-145.0 -120.0 -103.0 ... -1.5 -0.5
array([-145. , -120. , -103. , -88. , -73. , -60. , -49. , -39.5 , -31. , -23.75, -17.75, -12.75, -8.8 , -5.55, -3. , -1.5 , -0.5 ])
- mean_cur(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- short_name :
- mean_cur
- aggregation :
- mean_speed
- standard_name :
- mean_current_speed
- long_name :
- mean_current_speed
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - salt(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/practical_salinity
- short_name :
- salt
- aggregation :
- Daily
- units :
- PSU
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://environment.data.gov.au/water/quality/def/unit/PSU
- long_name :
- Salinity
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - temp(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_temperature
- short_name :
- temp
- aggregation :
- Daily
- units :
- degrees C
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#DegreeCelsius
- long_name :
- Temperature
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - u(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_eastward
- short_name :
- u
- vector_name :
- Currents
- standard_name :
- eastward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Eastward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - v(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 100, 50), meta=np.ndarray>
- vector_components :
- u v
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_velocity_northward
- short_name :
- v
- vector_name :
- Currents
- standard_name :
- northward_sea_water_velocity
- aggregation :
- Daily
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- long_name :
- Northward current
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 20.74 MB 10.54 MB Shape (61, 17, 100, 50) (31, 17, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - mean_wspeed(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- units :
- ms-1
- short_name :
- mean_wspeed
- aggregation :
- mean_speed
- standard_name :
- mean_wind_speed
- long_name :
- mean_wind_speed
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - eta(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_near_surface
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_surface_elevation
- short_name :
- eta
- standard_name :
- sea_surface_height_above_sea_level
- aggregation :
- Daily
- units :
- metre
- positive :
- up
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#Meter
- long_name :
- Surface elevation
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_u(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- short_name :
- wspeed_u
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- eastward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray - wspeed_v(time, latitude, longitude)float32dask.array<chunksize=(31, 100, 50), meta=np.ndarray>
- short_name :
- wspeed_v
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- northward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 1.22 MB 620.00 kB Shape (61, 100, 50) (31, 100, 50) Count 8 Tasks 2 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- NCO :
- 4.4.4
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T14:27:56+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-03
- aims_ncaggregate_firstDate :
- 2018-03-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-03::MD5:d38e2cde5a55d183aa98d84609b3636a]
- aims_ncaggregate_lastDate :
- 2018-03-31T00:00:00+10:00
- description :
- Aggregation of raw hourly input data (from eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 subset) to daily means. Also calculates mean magnitude of wind and ocean current speeds. Data is regridded from curvilinear (per input data) to rectilinear via inverse weighted distance from up to 4 closest cells.
- hasVocab :
- 1
- history :
- Fri Nov 15 11:29:35 2019: ncrcat -o ../gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc gbr4_simple_2018-03-1.nc Thu Nov 14 17:41:17 2019: ncks -4 -L 3 -d time,0,624 gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc 2020-08-20T14:55:54+10:00: vendor: AIMS; processing: None summaries 2020-08-21T14:27:56+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- nco_openmp_thread_number :
- 1
- paramfile :
- in.prm
- paramhead :
- GBR 4km resolution grid
- shoc_version :
- v1.1 rev(5620)
- technical_guide_link :
- https://eatlas.org.au/pydio/public/aims-ereefs-platform-technical-guide-to-derived-products-from-csiro-ereefs-models-pdf
- technical_guide_publish_date :
- 2020-08-18
- title :
- eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 daily aggregation
- DODS_EXTRA.Unlimited_Dimension :
- time
Here we want to evaluate the surface salinity evolution over the temporal interval.
To proceed, we will only select the top 10 m of the dataset based on the z-coordinates definition.
z-coordinates position from the eReefs hydrodynamic model
Index (k) |
Hydrodynamic 1km model |
Hydrodynamic and BioGeoChemical 4km model |
---|---|---|
0 |
-140.00 m |
-145.00 m |
1 |
-120.00 m |
-120.00 m |
2 |
-103.00 m |
-103.00 m |
3 |
-88.00 m |
-88.00 m |
4 |
-73.00 m |
-73.00 m |
5 |
-60.00 m |
-60.00 m |
6 |
-49.00 m |
-49.00 m |
7 |
-39.50 m |
-39.50 m |
8 |
-31.00 m |
-31.00 m |
9 |
-24.00 m |
-23.75 m |
10 |
-18.00 m |
-17.75 m |
11 |
-13.00 m |
-12.75 m |
12 |
-9.00 m |
-8.80 m |
13 |
-5.25 m |
-5.55 m |
14 |
-2.35 m |
-3.00 m |
15 |
-0.50 m |
-1.50 m |
16 |
n/a |
-0.50 m |
# Take the top 10 m based on the z-coordinate (k dimension)
slice_ds = ds_hydro_clip.sel(k=slice(-10, 0)).drop(['u','v','eta',
'mean_wspeed',
'wspeed_u',
'wspeed_v'])
slice_ds
<xarray.Dataset> Dimensions: (k: 5, latitude: 100, longitude: 50, time: 61) Coordinates: * time (time) datetime64[ns] 2018-02-28T14:00:00 ... 2018-04-29T14:00:00 * latitude (latitude) float64 -20.0 -19.97 -19.94 ... -17.09 -17.06 -17.03 * longitude (longitude) float64 146.5 146.5 146.6 146.6 ... 147.9 148.0 148.0 * k (k) float64 -8.8 -5.55 -3.0 -1.5 -0.5 Data variables: mean_cur (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray> salt (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray> temp (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray> Attributes: (12/21) Conventions: CF-1.0 NCO: 4.4.4 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T14:27:56+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... ... ... paramhead: GBR 4km resolution grid shoc_version: v1.1 rev(5620) technical_guide_link: https://eatlas.org.au/pydio/public/aims-... technical_guide_publish_date: 2020-08-18 title: eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 d... DODS_EXTRA.Unlimited_Dimension: time
- k: 5
- latitude: 100
- longitude: 50
- time: 61
- time(time)datetime64[ns]2018-02-28T14:00:00 ... 2018-04-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2018-02-28T14:00:00.000000000', '2018-03-01T14:00:00.000000000', '2018-03-02T14:00:00.000000000', '2018-03-03T14:00:00.000000000', '2018-03-04T14:00:00.000000000', '2018-03-05T14:00:00.000000000', '2018-03-06T14:00:00.000000000', '2018-03-07T14:00:00.000000000', '2018-03-08T14:00:00.000000000', '2018-03-09T14:00:00.000000000', '2018-03-10T14:00:00.000000000', '2018-03-11T14:00:00.000000000', '2018-03-12T14:00:00.000000000', '2018-03-13T14:00:00.000000000', '2018-03-14T14:00:00.000000000', '2018-03-15T14:00:00.000000000', '2018-03-16T14:00:00.000000000', '2018-03-17T14:00:00.000000000', '2018-03-18T14:00:00.000000000', '2018-03-19T14:00:00.000000000', '2018-03-20T14:00:00.000000000', '2018-03-21T14:00:00.000000000', '2018-03-22T14:00:00.000000000', '2018-03-23T14:00:00.000000000', '2018-03-24T14:00:00.000000000', '2018-03-25T14:00:00.000000000', '2018-03-26T14:00:00.000000000', '2018-03-27T14:00:00.000000000', '2018-03-28T14:00:00.000000000', '2018-03-29T14:00:00.000000000', '2018-03-30T14:00:00.000000000', '2018-03-31T14:00:00.000000000', '2018-04-01T14:00:00.000000000', '2018-04-02T14:00:00.000000000', '2018-04-03T14:00:00.000000000', '2018-04-04T14:00:00.000000000', '2018-04-05T14:00:00.000000000', '2018-04-06T14:00:00.000000000', '2018-04-07T14:00:00.000000000', '2018-04-08T14:00:00.000000000', '2018-04-09T14:00:00.000000000', '2018-04-10T14:00:00.000000000', '2018-04-11T14:00:00.000000000', '2018-04-12T14:00:00.000000000', '2018-04-13T14:00:00.000000000', '2018-04-14T14:00:00.000000000', '2018-04-15T14:00:00.000000000', '2018-04-16T14:00:00.000000000', '2018-04-17T14:00:00.000000000', '2018-04-18T14:00:00.000000000', '2018-04-19T14:00:00.000000000', '2018-04-20T14:00:00.000000000', '2018-04-21T14:00:00.000000000', '2018-04-22T14:00:00.000000000', '2018-04-23T14:00:00.000000000', '2018-04-24T14:00:00.000000000', '2018-04-25T14:00:00.000000000', '2018-04-26T14:00:00.000000000', '2018-04-27T14:00:00.000000000', '2018-04-28T14:00:00.000000000', '2018-04-29T14:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.0 -19.97 ... -17.06 -17.03
- units :
- degrees_north
- long_name :
- Latitude
- standard_name :
- latitude
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-19.996022, -19.966022, -19.936022, -19.906022, -19.876022, -19.846022, -19.816022, -19.786022, -19.756022, -19.726022, -19.696022, -19.666022, -19.636022, -19.606022, -19.576022, -19.546022, -19.516022, -19.486022, -19.456022, -19.426022, -19.396022, -19.366022, -19.336022, -19.306022, -19.276022, -19.246022, -19.216022, -19.186022, -19.156022, -19.126022, -19.096022, -19.066022, -19.036022, -19.006022, -18.976022, -18.946022, -18.916022, -18.886022, -18.856022, -18.826022, -18.796022, -18.766022, -18.736022, -18.706022, -18.676022, -18.646022, -18.616022, -18.586022, -18.556022, -18.526022, -18.496022, -18.466022, -18.436022, -18.406022, -18.376022, -18.346022, -18.316022, -18.286022, -18.256022, -18.226022, -18.196022, -18.166022, -18.136022, -18.106022, -18.076022, -18.046022, -18.016022, -17.986022, -17.956022, -17.926022, -17.896022, -17.866022, -17.836022, -17.806022, -17.776022, -17.746022, -17.716022, -17.686022, -17.656022, -17.626022, -17.596022, -17.566022, -17.536022, -17.506022, -17.476022, -17.446022, -17.416022, -17.386022, -17.356022, -17.326022, -17.296022, -17.266022, -17.236022, -17.206022, -17.176022, -17.146022, -17.116022, -17.086022, -17.056022, -17.026022])
- longitude(longitude)float64146.5 146.5 146.6 ... 148.0 148.0
- units :
- degrees_east
- long_name :
- Longitude
- standard_name :
- longitude
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.518788, 146.548788, 146.578788, 146.608788, 146.638788, 146.668788, 146.698788, 146.728788, 146.758788, 146.788788, 146.818788, 146.848788, 146.878788, 146.908788, 146.938788, 146.968788, 146.998788, 147.028788, 147.058788, 147.088788, 147.118788, 147.148788, 147.178788, 147.208788, 147.238788, 147.268788, 147.298788, 147.328788, 147.358788, 147.388788, 147.418788, 147.448788, 147.478788, 147.508788, 147.538788, 147.568788, 147.598788, 147.628788, 147.658788, 147.688788, 147.718788, 147.748788, 147.778788, 147.808788, 147.838788, 147.868788, 147.898788, 147.928788, 147.958788, 147.988788])
- k(k)float64-8.8 -5.55 -3.0 -1.5 -0.5
array([-8.8 , -5.55, -3. , -1.5 , -0.5 ])
- mean_cur(time, k, latitude, longitude)float32dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://environment.data.gov.au/def/feature/ocean_current
- units :
- ms-1
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#MeterPerSecond
- short_name :
- mean_cur
- aggregation :
- mean_speed
- standard_name :
- mean_current_speed
- long_name :
- mean_current_speed
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 6.10 MB 3.10 MB Shape (61, 5, 100, 50) (31, 5, 100, 50) Count 10 Tasks 2 Chunks Type float32 numpy.ndarray - salt(time, k, latitude, longitude)float32dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/practical_salinity
- short_name :
- salt
- aggregation :
- Daily
- units :
- PSU
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://environment.data.gov.au/water/quality/def/unit/PSU
- long_name :
- Salinity
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 6.10 MB 3.10 MB Shape (61, 5, 100, 50) (31, 5, 100, 50) Count 10 Tasks 2 Chunks Type float32 numpy.ndarray - temp(time, k, latitude, longitude)float32dask.array<chunksize=(31, 5, 100, 50), meta=np.ndarray>
- substanceOrTaxon_id :
- http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater
- scaledQuantityKind_id :
- http://environment.data.gov.au/def/property/sea_water_temperature
- short_name :
- temp
- aggregation :
- Daily
- units :
- degrees C
- medium_id :
- http://environment.data.gov.au/def/feature/ocean
- unit_id :
- http://qudt.org/vocab/unit#DegreeCelsius
- long_name :
- Temperature
- _ChunkSizes :
- [ 1 1 133 491]
Array Chunk Bytes 6.10 MB 3.10 MB Shape (61, 5, 100, 50) (31, 5, 100, 50) Count 10 Tasks 2 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- NCO :
- 4.4.4
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T14:27:56+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-03
- aims_ncaggregate_firstDate :
- 2018-03-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-03::MD5:d38e2cde5a55d183aa98d84609b3636a]
- aims_ncaggregate_lastDate :
- 2018-03-31T00:00:00+10:00
- description :
- Aggregation of raw hourly input data (from eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 subset) to daily means. Also calculates mean magnitude of wind and ocean current speeds. Data is regridded from curvilinear (per input data) to rectilinear via inverse weighted distance from up to 4 closest cells.
- hasVocab :
- 1
- history :
- Fri Nov 15 11:29:35 2019: ncrcat -o ../gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc gbr4_simple_2018-03-1.nc Thu Nov 14 17:41:17 2019: ncks -4 -L 3 -d time,0,624 gbr4_simple_2018-03.nc gbr4_simple_2018-03-0.nc 2020-08-20T14:55:54+10:00: vendor: AIMS; processing: None summaries 2020-08-21T14:27:56+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- nco_openmp_thread_number :
- 1
- paramfile :
- in.prm
- paramhead :
- GBR 4km resolution grid
- shoc_version :
- v1.1 rev(5620)
- technical_guide_link :
- https://eatlas.org.au/pydio/public/aims-ereefs-platform-technical-guide-to-derived-products-from-csiro-ereefs-models-pdf
- technical_guide_publish_date :
- 2020-08-18
- title :
- eReefs AIMS-CSIRO GBR4 Hydrodynamic v2 daily aggregation
- DODS_EXTRA.Unlimited_Dimension :
- time
Now we will average the value along the k
coordinate using the mean
function and then load the Xarray Dataset
in memory:
vards = slice_ds.mean(dim='k').salt.load()
Visualise temporal changes¶
We first load data using both Cartopy
and GeoViews
to check what we have…
# Loading coastlines from Cartopy
coastline = gf.coastline(line_width=3, line_color='k').opts(projection=ccrs.PlateCarree(), scale='10m')
# Loading land mask from Cartopy
land = gf.land.options(scale='10m', fill_color='lightgray')
# Let's put the Xarray dataset into a GeoViews object
var_mask = gv.Dataset(vards, crs=crs.PlateCarree())
# Print salinity range:
minvar = vards.min().item()
maxvar = vards.max().item()
print('Salinity range: ',minvar,maxvar)
# Create stack of images grouped by time
im_mask = var_mask.to(gv.Image, ['longitude', 'latitude'], dynamic=True)
Salinity range: 6.842176914215088 35.55593490600586
GeoViews
interactive plot…
# Positioning the slider at the bottom
hv.output(widget_location='bottom')
# Figure title name
titleName = slice_ds.salt.long_name+' '+slice_ds.salt.units
# Plotting the interactive view
im_mask.opts(active_tools=['wheel_zoom', 'pan'], cmap=cmocean.cm.curl,
colorbar=True, width=450, height=400, clim=(34,36),
title=titleName) * coastline * land
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/cartopy/io/__init__.py:260: DownloadWarning: Downloading: https://naciscdn.org/naturalearth/110m/physical/ne_110m_land.zip
warnings.warn('Downloading: {}'.format(url), DownloadWarning)