Interactive maps¶
In this notebook, we will explore other capabilities of the hvPlot ecosystem. The associated functions allow to create plots with many interactive tools and features, including linked panning and brushing, and hover inspectors.
In particular, we will look at the VectorField
method, 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
xarray
holoviews
geoviews
import os
import numpy as np
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 holoviews as hv
from holoviews import opts, dim
import geoviews as gv
import geoviews.feature as gf
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 1 month:
month_st = 1 # Starting month
month_ed = 1 # Ending month
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-01.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: 31) Coordinates: zc (k) float64 dask.array<chunksize=(17,), meta=np.ndarray> * time (time) datetime64[ns] 2017-12-31T14:00:00 ... 2018-01-30T14:... * 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/19) Conventions: CF-1.0 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T12:50:07+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... aims_ncaggregate_firstDate: 2018-01-01T00:00:00+10:00 ... ... 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: 31
- zc(k)float64dask.array<chunksize=(17,), meta=np.ndarray>
- positive :
- up
- coordinate_type :
- Z
- units :
- m
- long_name :
- Z coordinate
- axis :
- Z
- _CoordinateAxisType :
- Height
- _CoordinateZisPositive :
- up
Array Chunk Bytes 136 B 136 B Shape (17,) (17,) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - time(time)datetime64[ns]2017-12-31T14:00:00 ... 2018-01-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2017-12-31T14:00:00.000000000', '2018-01-01T14:00:00.000000000', '2018-01-02T14:00:00.000000000', '2018-01-03T14:00:00.000000000', '2018-01-04T14:00:00.000000000', '2018-01-05T14:00:00.000000000', '2018-01-06T14:00:00.000000000', '2018-01-07T14:00:00.000000000', '2018-01-08T14:00:00.000000000', '2018-01-09T14:00:00.000000000', '2018-01-10T14:00:00.000000000', '2018-01-11T14:00:00.000000000', '2018-01-12T14:00:00.000000000', '2018-01-13T14:00:00.000000000', '2018-01-14T14:00:00.000000000', '2018-01-15T14:00:00.000000000', '2018-01-16T14:00:00.000000000', '2018-01-17T14:00:00.000000000', '2018-01-18T14:00:00.000000000', '2018-01-19T14:00:00.000000000', '2018-01-20T14:00:00.000000000', '2018-01-21T14:00:00.000000000', '2018-01-22T14:00:00.000000000', '2018-01-23T14:00:00.000000000', '2018-01-24T14:00:00.000000000', '2018-01-25T14:00:00.000000000', '2018-01-26T14:00:00.000000000', '2018-01-27T14:00:00.000000000', '2018-01-28T14:00:00.000000000', '2018-01-29T14:00:00.000000000', '2018-01-30T14:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-28.7 -28.67 ... -7.066 -7.036
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
- 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
- standard_name :
- longitude
- long_name :
- Longitude
- units :
- degrees_east
- 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 748.33 MB 748.33 MB Shape (31, 17, 723, 491) (31, 17, 723, 491) Count 2 Tasks 1 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 748.33 MB 748.33 MB Shape (31, 17, 723, 491) (31, 17, 723, 491) Count 2 Tasks 1 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 748.33 MB 748.33 MB Shape (31, 17, 723, 491) (31, 17, 723, 491) Count 2 Tasks 1 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 748.33 MB 748.33 MB Shape (31, 17, 723, 491) (31, 17, 723, 491) Count 2 Tasks 1 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 748.33 MB 748.33 MB Shape (31, 17, 723, 491) (31, 17, 723, 491) Count 2 Tasks 1 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 44.02 MB 44.02 MB Shape (31, 723, 491) (31, 723, 491) Count 2 Tasks 1 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 44.02 MB 44.02 MB Shape (31, 723, 491) (31, 723, 491) Count 2 Tasks 1 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 44.02 MB 44.02 MB Shape (31, 723, 491) (31, 723, 491) Count 2 Tasks 1 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 44.02 MB 44.02 MB Shape (31, 723, 491) (31, 723, 491) Count 2 Tasks 1 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T12:50:07+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-01
- aims_ncaggregate_firstDate :
- 2018-01-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-01::MD5:f3d285e0aaa945e64825e628387ac6d0]
- aims_ncaggregate_lastDate :
- 2018-01-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 :
- 2020-08-20T12:56:06+10:00: vendor: AIMS; processing: None summaries 2020-08-21T12:50:07+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- 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 # lower left longitude
min_lat = -21 # lower left latitude
max_lon = 150 # upper right longitude
max_lat = -16 # 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: 167, longitude: 134, time: 31) Coordinates: zc (k) float64 dask.array<chunksize=(17,), meta=np.ndarray> * time (time) datetime64[ns] 2017-12-31T14:00:00 ... 2018-01-30T14:... * latitude (latitude) float64 -20.99 -20.96 -20.93 ... -16.04 -16.01 * longitude (longitude) float64 146.0 146.0 146.1 ... 149.9 150.0 150.0 Dimensions without coordinates: k Data variables: mean_cur (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 167, 134), meta=np.ndarray> salt (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 167, 134), meta=np.ndarray> temp (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 167, 134), meta=np.ndarray> u (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 167, 134), meta=np.ndarray> v (time, k, latitude, longitude) float32 dask.array<chunksize=(31, 17, 167, 134), meta=np.ndarray> mean_wspeed (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> eta (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> wspeed_u (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> wspeed_v (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> Attributes: (12/19) Conventions: CF-1.0 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T12:50:07+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... aims_ncaggregate_firstDate: 2018-01-01T00:00:00+10:00 ... ... 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: 167
- longitude: 134
- time: 31
- zc(k)float64dask.array<chunksize=(17,), meta=np.ndarray>
- positive :
- up
- coordinate_type :
- Z
- units :
- m
- long_name :
- Z coordinate
- axis :
- Z
- _CoordinateAxisType :
- Height
- _CoordinateZisPositive :
- up
Array Chunk Bytes 136 B 136 B Shape (17,) (17,) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - time(time)datetime64[ns]2017-12-31T14:00:00 ... 2018-01-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2017-12-31T14:00:00.000000000', '2018-01-01T14:00:00.000000000', '2018-01-02T14:00:00.000000000', '2018-01-03T14:00:00.000000000', '2018-01-04T14:00:00.000000000', '2018-01-05T14:00:00.000000000', '2018-01-06T14:00:00.000000000', '2018-01-07T14:00:00.000000000', '2018-01-08T14:00:00.000000000', '2018-01-09T14:00:00.000000000', '2018-01-10T14:00:00.000000000', '2018-01-11T14:00:00.000000000', '2018-01-12T14:00:00.000000000', '2018-01-13T14:00:00.000000000', '2018-01-14T14:00:00.000000000', '2018-01-15T14:00:00.000000000', '2018-01-16T14:00:00.000000000', '2018-01-17T14:00:00.000000000', '2018-01-18T14:00:00.000000000', '2018-01-19T14:00:00.000000000', '2018-01-20T14:00:00.000000000', '2018-01-21T14:00:00.000000000', '2018-01-22T14:00:00.000000000', '2018-01-23T14:00:00.000000000', '2018-01-24T14:00:00.000000000', '2018-01-25T14:00:00.000000000', '2018-01-26T14:00:00.000000000', '2018-01-27T14:00:00.000000000', '2018-01-28T14:00:00.000000000', '2018-01-29T14:00:00.000000000', '2018-01-30T14:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.99 -20.96 ... -16.04 -16.01
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-20.986022, -20.956022, -20.926022, -20.896022, -20.866022, -20.836022, -20.806022, -20.776022, -20.746022, -20.716022, -20.686022, -20.656022, -20.626022, -20.596022, -20.566022, -20.536022, -20.506022, -20.476022, -20.446022, -20.416022, -20.386022, -20.356022, -20.326022, -20.296022, -20.266022, -20.236022, -20.206022, -20.176022, -20.146022, -20.116022, -20.086022, -20.056022, -20.026022, -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, -16.996022, -16.966022, -16.936022, -16.906022, -16.876022, -16.846022, -16.816022, -16.786022, -16.756022, -16.726022, -16.696022, -16.666022, -16.636022, -16.606022, -16.576022, -16.546022, -16.516022, -16.486022, -16.456022, -16.426022, -16.396022, -16.366022, -16.336022, -16.306022, -16.276022, -16.246022, -16.216022, -16.186022, -16.156022, -16.126022, -16.096022, -16.066022, -16.036022, -16.006022])
- longitude(longitude)float64146.0 146.0 146.1 ... 150.0 150.0
- standard_name :
- longitude
- long_name :
- Longitude
- units :
- degrees_east
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.008788, 146.038788, 146.068788, 146.098788, 146.128788, 146.158788, 146.188788, 146.218788, 146.248788, 146.278788, 146.308788, 146.338788, 146.368788, 146.398788, 146.428788, 146.458788, 146.488788, 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, 148.018788, 148.048788, 148.078788, 148.108788, 148.138788, 148.168788, 148.198788, 148.228788, 148.258788, 148.288788, 148.318788, 148.348788, 148.378788, 148.408788, 148.438788, 148.468788, 148.498788, 148.528788, 148.558788, 148.588788, 148.618788, 148.648788, 148.678788, 148.708788, 148.738788, 148.768788, 148.798788, 148.828788, 148.858788, 148.888788, 148.918788, 148.948788, 148.978788, 149.008788, 149.038788, 149.068788, 149.098788, 149.128788, 149.158788, 149.188788, 149.218788, 149.248788, 149.278788, 149.308788, 149.338788, 149.368788, 149.398788, 149.428788, 149.458788, 149.488788, 149.518788, 149.548788, 149.578788, 149.608788, 149.638788, 149.668788, 149.698788, 149.728788, 149.758788, 149.788788, 149.818788, 149.848788, 149.878788, 149.908788, 149.938788, 149.968788, 149.998788])
- mean_cur(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 167, 134), 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 47.17 MB 47.17 MB Shape (31, 17, 167, 134) (31, 17, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - salt(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 167, 134), 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 47.17 MB 47.17 MB Shape (31, 17, 167, 134) (31, 17, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - temp(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 167, 134), 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 47.17 MB 47.17 MB Shape (31, 17, 167, 134) (31, 17, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - u(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 167, 134), 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 47.17 MB 47.17 MB Shape (31, 17, 167, 134) (31, 17, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - v(time, k, latitude, longitude)float32dask.array<chunksize=(31, 17, 167, 134), 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 47.17 MB 47.17 MB Shape (31, 17, 167, 134) (31, 17, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - mean_wspeed(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - eta(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - wspeed_u(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), meta=np.ndarray>
- short_name :
- wspeed_u
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- eastward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - wspeed_v(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), meta=np.ndarray>
- short_name :
- wspeed_v
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- northward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T12:50:07+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-01
- aims_ncaggregate_firstDate :
- 2018-01-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-01::MD5:f3d285e0aaa945e64825e628387ac6d0]
- aims_ncaggregate_lastDate :
- 2018-01-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 :
- 2020-08-20T12:56:06+10:00: vendor: AIMS; processing: None summaries 2020-08-21T12:50:07+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- 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
We will use for this example the surface values (i.e. the last z-coordinate at -0.5 m), this is done by using isel
function on the Xarray
Dataset:
zcvar = -1 # last z-coordinate at 0.5 m
new_ds = ds_hydro_clip.isel(k=zcvar)
new_ds
<xarray.Dataset> Dimensions: (latitude: 167, longitude: 134, time: 31) Coordinates: zc float64 dask.array<chunksize=(), meta=np.ndarray> * time (time) datetime64[ns] 2017-12-31T14:00:00 ... 2018-01-30T14:... * latitude (latitude) float64 -20.99 -20.96 -20.93 ... -16.04 -16.01 * longitude (longitude) float64 146.0 146.0 146.1 ... 149.9 150.0 150.0 Data variables: mean_cur (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> salt (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> temp (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> u (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> v (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> mean_wspeed (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> eta (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> wspeed_u (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> wspeed_v (time, latitude, longitude) float32 dask.array<chunksize=(31, 167, 134), meta=np.ndarray> Attributes: (12/19) Conventions: CF-1.0 Run_ID: 2 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention aims_ncaggregate_buildDate: 2020-08-21T12:50:07+10:00 aims_ncaggregate_datasetId: products__ncaggregate__ereefs__gbr4_v2__... aims_ncaggregate_firstDate: 2018-01-01T00:00:00+10:00 ... ... 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
- latitude: 167
- longitude: 134
- time: 31
- zc()float64dask.array<chunksize=(), meta=np.ndarray>
- positive :
- up
- coordinate_type :
- Z
- units :
- m
- long_name :
- Z coordinate
- axis :
- Z
- _CoordinateAxisType :
- Height
- _CoordinateZisPositive :
- up
Array Chunk Bytes 8 B 8 B Shape () () Count 3 Tasks 1 Chunks Type float64 numpy.ndarray - time(time)datetime64[ns]2017-12-31T14:00:00 ... 2018-01-...
- long_name :
- Time
- standard_name :
- time
- coordinate_type :
- time
- _CoordinateAxisType :
- Time
- _ChunkSizes :
- 1024
array(['2017-12-31T14:00:00.000000000', '2018-01-01T14:00:00.000000000', '2018-01-02T14:00:00.000000000', '2018-01-03T14:00:00.000000000', '2018-01-04T14:00:00.000000000', '2018-01-05T14:00:00.000000000', '2018-01-06T14:00:00.000000000', '2018-01-07T14:00:00.000000000', '2018-01-08T14:00:00.000000000', '2018-01-09T14:00:00.000000000', '2018-01-10T14:00:00.000000000', '2018-01-11T14:00:00.000000000', '2018-01-12T14:00:00.000000000', '2018-01-13T14:00:00.000000000', '2018-01-14T14:00:00.000000000', '2018-01-15T14:00:00.000000000', '2018-01-16T14:00:00.000000000', '2018-01-17T14:00:00.000000000', '2018-01-18T14:00:00.000000000', '2018-01-19T14:00:00.000000000', '2018-01-20T14:00:00.000000000', '2018-01-21T14:00:00.000000000', '2018-01-22T14:00:00.000000000', '2018-01-23T14:00:00.000000000', '2018-01-24T14:00:00.000000000', '2018-01-25T14:00:00.000000000', '2018-01-26T14:00:00.000000000', '2018-01-27T14:00:00.000000000', '2018-01-28T14:00:00.000000000', '2018-01-29T14:00:00.000000000', '2018-01-30T14:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.99 -20.96 ... -16.04 -16.01
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-20.986022, -20.956022, -20.926022, -20.896022, -20.866022, -20.836022, -20.806022, -20.776022, -20.746022, -20.716022, -20.686022, -20.656022, -20.626022, -20.596022, -20.566022, -20.536022, -20.506022, -20.476022, -20.446022, -20.416022, -20.386022, -20.356022, -20.326022, -20.296022, -20.266022, -20.236022, -20.206022, -20.176022, -20.146022, -20.116022, -20.086022, -20.056022, -20.026022, -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, -16.996022, -16.966022, -16.936022, -16.906022, -16.876022, -16.846022, -16.816022, -16.786022, -16.756022, -16.726022, -16.696022, -16.666022, -16.636022, -16.606022, -16.576022, -16.546022, -16.516022, -16.486022, -16.456022, -16.426022, -16.396022, -16.366022, -16.336022, -16.306022, -16.276022, -16.246022, -16.216022, -16.186022, -16.156022, -16.126022, -16.096022, -16.066022, -16.036022, -16.006022])
- longitude(longitude)float64146.0 146.0 146.1 ... 150.0 150.0
- standard_name :
- longitude
- long_name :
- Longitude
- units :
- degrees_east
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.008788, 146.038788, 146.068788, 146.098788, 146.128788, 146.158788, 146.188788, 146.218788, 146.248788, 146.278788, 146.308788, 146.338788, 146.368788, 146.398788, 146.428788, 146.458788, 146.488788, 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, 148.018788, 148.048788, 148.078788, 148.108788, 148.138788, 148.168788, 148.198788, 148.228788, 148.258788, 148.288788, 148.318788, 148.348788, 148.378788, 148.408788, 148.438788, 148.468788, 148.498788, 148.528788, 148.558788, 148.588788, 148.618788, 148.648788, 148.678788, 148.708788, 148.738788, 148.768788, 148.798788, 148.828788, 148.858788, 148.888788, 148.918788, 148.948788, 148.978788, 149.008788, 149.038788, 149.068788, 149.098788, 149.128788, 149.158788, 149.188788, 149.218788, 149.248788, 149.278788, 149.308788, 149.338788, 149.368788, 149.398788, 149.428788, 149.458788, 149.488788, 149.518788, 149.548788, 149.578788, 149.608788, 149.638788, 149.668788, 149.698788, 149.728788, 149.758788, 149.788788, 149.818788, 149.848788, 149.878788, 149.908788, 149.938788, 149.968788, 149.998788])
- mean_cur(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 4 Tasks 1 Chunks Type float32 numpy.ndarray - salt(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 4 Tasks 1 Chunks Type float32 numpy.ndarray - temp(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 4 Tasks 1 Chunks Type float32 numpy.ndarray - u(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 4 Tasks 1 Chunks Type float32 numpy.ndarray - v(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 4 Tasks 1 Chunks Type float32 numpy.ndarray - mean_wspeed(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - eta(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), 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 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - wspeed_u(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), meta=np.ndarray>
- short_name :
- wspeed_u
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- eastward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray - wspeed_v(time, latitude, longitude)float32dask.array<chunksize=(31, 167, 134), meta=np.ndarray>
- short_name :
- wspeed_v
- aggregation :
- Daily
- units :
- ms-1
- long_name :
- northward_wind
- _ChunkSizes :
- [ 1 133 491]
Array Chunk Bytes 2.77 MB 2.77 MB Shape (31, 167, 134) (31, 167, 134) Count 3 Tasks 1 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.0
- Run_ID :
- 2
- _CoordSysBuilder :
- ucar.nc2.dataset.conv.CF1Convention
- aims_ncaggregate_buildDate :
- 2020-08-21T12:50:07+10:00
- aims_ncaggregate_datasetId :
- products__ncaggregate__ereefs__gbr4_v2__daily-monthly/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_daily-monthly-2018-01
- aims_ncaggregate_firstDate :
- 2018-01-01T00:00:00+10:00
- aims_ncaggregate_inputs :
- [products__ncaggregate__ereefs__gbr4_v2__raw/EREEFS_AIMS-CSIRO_gbr4_v2_hydro_raw_2018-01::MD5:f3d285e0aaa945e64825e628387ac6d0]
- aims_ncaggregate_lastDate :
- 2018-01-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 :
- 2020-08-20T12:56:06+10:00: vendor: AIMS; processing: None summaries 2020-08-21T12:50:07+10:00: vendor: AIMS; processing: Daily summaries
- metadata_link :
- https://eatlas.org.au/data/uuid/350aed53-ae0f-436e-9866-d34db7f04d2e
- 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
Groupby function¶
Using groupby
with time
coordinates, we take the maximum of each Data variables over a 2 weeks timeframe (‘2W’). We also reduce the Dataset to the following variables:
‘mean_cur’,
‘u’, and
‘v’
week_ds = new_ds.resample(time='2W').max(dim='time').drop('zc')[['mean_cur','u','v']]
week_ds
<xarray.Dataset> Dimensions: (latitude: 167, longitude: 134, time: 4) Coordinates: * time (time) datetime64[ns] 2017-12-31 2018-01-14 2018-01-28 2018-02-11 * latitude (latitude) float64 -20.99 -20.96 -20.93 ... -16.07 -16.04 -16.01 * longitude (longitude) float64 146.0 146.0 146.1 146.1 ... 149.9 150.0 150.0 Data variables: mean_cur (time, latitude, longitude) float32 dask.array<chunksize=(1, 167, 134), meta=np.ndarray> u (time, latitude, longitude) float32 dask.array<chunksize=(1, 167, 134), meta=np.ndarray> v (time, latitude, longitude) float32 dask.array<chunksize=(1, 167, 134), meta=np.ndarray>
- latitude: 167
- longitude: 134
- time: 4
- time(time)datetime64[ns]2017-12-31 ... 2018-02-11
array(['2017-12-31T00:00:00.000000000', '2018-01-14T00:00:00.000000000', '2018-01-28T00:00:00.000000000', '2018-02-11T00:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.99 -20.96 ... -16.04 -16.01
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-20.986022, -20.956022, -20.926022, -20.896022, -20.866022, -20.836022, -20.806022, -20.776022, -20.746022, -20.716022, -20.686022, -20.656022, -20.626022, -20.596022, -20.566022, -20.536022, -20.506022, -20.476022, -20.446022, -20.416022, -20.386022, -20.356022, -20.326022, -20.296022, -20.266022, -20.236022, -20.206022, -20.176022, -20.146022, -20.116022, -20.086022, -20.056022, -20.026022, -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, -16.996022, -16.966022, -16.936022, -16.906022, -16.876022, -16.846022, -16.816022, -16.786022, -16.756022, -16.726022, -16.696022, -16.666022, -16.636022, -16.606022, -16.576022, -16.546022, -16.516022, -16.486022, -16.456022, -16.426022, -16.396022, -16.366022, -16.336022, -16.306022, -16.276022, -16.246022, -16.216022, -16.186022, -16.156022, -16.126022, -16.096022, -16.066022, -16.036022, -16.006022])
- longitude(longitude)float64146.0 146.0 146.1 ... 150.0 150.0
- standard_name :
- longitude
- long_name :
- Longitude
- units :
- degrees_east
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.008788, 146.038788, 146.068788, 146.098788, 146.128788, 146.158788, 146.188788, 146.218788, 146.248788, 146.278788, 146.308788, 146.338788, 146.368788, 146.398788, 146.428788, 146.458788, 146.488788, 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, 148.018788, 148.048788, 148.078788, 148.108788, 148.138788, 148.168788, 148.198788, 148.228788, 148.258788, 148.288788, 148.318788, 148.348788, 148.378788, 148.408788, 148.438788, 148.468788, 148.498788, 148.528788, 148.558788, 148.588788, 148.618788, 148.648788, 148.678788, 148.708788, 148.738788, 148.768788, 148.798788, 148.828788, 148.858788, 148.888788, 148.918788, 148.948788, 148.978788, 149.008788, 149.038788, 149.068788, 149.098788, 149.128788, 149.158788, 149.188788, 149.218788, 149.248788, 149.278788, 149.308788, 149.338788, 149.368788, 149.398788, 149.428788, 149.458788, 149.488788, 149.518788, 149.548788, 149.578788, 149.608788, 149.638788, 149.668788, 149.698788, 149.728788, 149.758788, 149.788788, 149.818788, 149.848788, 149.878788, 149.908788, 149.938788, 149.968788, 149.998788])
- mean_cur(time, latitude, longitude)float32dask.array<chunksize=(1, 167, 134), meta=np.ndarray>
Array Chunk Bytes 358.05 kB 89.51 kB Shape (4, 167, 134) (1, 167, 134) Count 24 Tasks 4 Chunks Type float32 numpy.ndarray - u(time, latitude, longitude)float32dask.array<chunksize=(1, 167, 134), meta=np.ndarray>
Array Chunk Bytes 358.05 kB 89.51 kB Shape (4, 167, 134) (1, 167, 134) Count 24 Tasks 4 Chunks Type float32 numpy.ndarray - v(time, latitude, longitude)float32dask.array<chunksize=(1, 167, 134), meta=np.ndarray>
Array Chunk Bytes 358.05 kB 89.51 kB Shape (4, 167, 134) (1, 167, 134) Count 24 Tasks 4 Chunks Type float32 numpy.ndarray
We then load the newly created Xarray Dataset
in memory:
load_week = week_ds.load()
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-8-e657c306f6eb> in <module>
----> 1 load_week = week_ds.load()
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/xarray/core/dataset.py in load(self, **kwargs)
796
797 # evaluate all the dask arrays simultaneously
--> 798 evaluated_data = da.compute(*lazy_data.values(), **kwargs)
799
800 for k, data in zip(lazy_data, evaluated_data):
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/dask/base.py in compute(*args, **kwargs)
563 postcomputes.append(x.__dask_postcompute__())
564
--> 565 results = schedule(dsk, keys, **kwargs)
566 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
567
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, pool, **kwargs)
74 pools[thread][num_workers] = pool
75
---> 76 results = get_async(
77 pool.apply_async,
78 len(pool._pool),
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/dask/local.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, **kwargs)
474 # Main loop, wait on tasks to finish, insert new ones
475 while state["waiting"] or state["ready"] or state["running"]:
--> 476 key, res_info, failed = queue_get(queue)
477 if failed:
478 exc, tb = loads(res_info)
/usr/share/miniconda/envs/envireef/lib/python3.8/site-packages/dask/local.py in queue_get(q)
131
132 def queue_get(q):
--> 133 return q.get()
134
135
/usr/share/miniconda/envs/envireef/lib/python3.8/queue.py in get(self, block, timeout)
168 elif timeout is None:
169 while not self._qsize():
--> 170 self.not_empty.wait()
171 elif timeout < 0:
172 raise ValueError("'timeout' must be a non-negative number")
/usr/share/miniconda/envs/envireef/lib/python3.8/threading.py in wait(self, timeout)
300 try: # restore state no matter what (e.g., KeyboardInterrupt)
301 if timeout is None:
--> 302 waiter.acquire()
303 gotit = True
304 else:
KeyboardInterrupt:
Magnitude and angle¶
HvPlot vectorfield
accepts 2d arrays of magnitude and angle on a grid and produces an array of vectors.
See also
A GeoViews example of VectorField
declaration.
We will create these variables by taking advantage of Xarray
DataArrays and Datasets arithmetic operators and numpy array functions:
# Convert current u and v to magnitude and angle
mag = np.sqrt(load_week.u**2 + load_week.v**2)
angle = (np.pi/2.) - np.arctan2(load_week.u/mag, load_week.v/mag)
We now add these 2 variables to our Xarray
Datasets:
load_week["mag"] = (['time', 'latitude', 'longitude'], mag)
load_week["angle"] = (['time', 'latitude', 'longitude'], angle)
load_week
<xarray.Dataset> Dimensions: (latitude: 167, longitude: 134, time: 4) Coordinates: * time (time) datetime64[ns] 2017-12-31 2018-01-14 2018-01-28 2018-02-11 * latitude (latitude) float64 -20.99 -20.96 -20.93 ... -16.07 -16.04 -16.01 * longitude (longitude) float64 146.0 146.0 146.1 146.1 ... 149.9 150.0 150.0 Data variables: mean_cur (time, latitude, longitude) float32 nan nan nan ... 0.2468 0.2474 u (time, latitude, longitude) float32 nan nan ... -0.08577 -0.07427 v (time, latitude, longitude) float32 nan nan ... 0.09289 0.08283 mag (time, latitude, longitude) float32 nan nan nan ... 0.1264 0.1113 angle (time, latitude, longitude) float32 nan nan nan ... 2.316 2.302
- latitude: 167
- longitude: 134
- time: 4
- time(time)datetime64[ns]2017-12-31 ... 2018-02-11
array(['2017-12-31T00:00:00.000000000', '2018-01-14T00:00:00.000000000', '2018-01-28T00:00:00.000000000', '2018-02-11T00:00:00.000000000'], dtype='datetime64[ns]')
- latitude(latitude)float64-20.99 -20.96 ... -16.04 -16.01
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
- coordinate_type :
- latitude
- projection :
- geographic
- _CoordinateAxisType :
- Lat
array([-20.986022, -20.956022, -20.926022, -20.896022, -20.866022, -20.836022, -20.806022, -20.776022, -20.746022, -20.716022, -20.686022, -20.656022, -20.626022, -20.596022, -20.566022, -20.536022, -20.506022, -20.476022, -20.446022, -20.416022, -20.386022, -20.356022, -20.326022, -20.296022, -20.266022, -20.236022, -20.206022, -20.176022, -20.146022, -20.116022, -20.086022, -20.056022, -20.026022, -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, -16.996022, -16.966022, -16.936022, -16.906022, -16.876022, -16.846022, -16.816022, -16.786022, -16.756022, -16.726022, -16.696022, -16.666022, -16.636022, -16.606022, -16.576022, -16.546022, -16.516022, -16.486022, -16.456022, -16.426022, -16.396022, -16.366022, -16.336022, -16.306022, -16.276022, -16.246022, -16.216022, -16.186022, -16.156022, -16.126022, -16.096022, -16.066022, -16.036022, -16.006022])
- longitude(longitude)float64146.0 146.0 146.1 ... 150.0 150.0
- standard_name :
- longitude
- long_name :
- Longitude
- units :
- degrees_east
- coordinate_type :
- longitude
- projection :
- geographic
- _CoordinateAxisType :
- Lon
array([146.008788, 146.038788, 146.068788, 146.098788, 146.128788, 146.158788, 146.188788, 146.218788, 146.248788, 146.278788, 146.308788, 146.338788, 146.368788, 146.398788, 146.428788, 146.458788, 146.488788, 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, 148.018788, 148.048788, 148.078788, 148.108788, 148.138788, 148.168788, 148.198788, 148.228788, 148.258788, 148.288788, 148.318788, 148.348788, 148.378788, 148.408788, 148.438788, 148.468788, 148.498788, 148.528788, 148.558788, 148.588788, 148.618788, 148.648788, 148.678788, 148.708788, 148.738788, 148.768788, 148.798788, 148.828788, 148.858788, 148.888788, 148.918788, 148.948788, 148.978788, 149.008788, 149.038788, 149.068788, 149.098788, 149.128788, 149.158788, 149.188788, 149.218788, 149.248788, 149.278788, 149.308788, 149.338788, 149.368788, 149.398788, 149.428788, 149.458788, 149.488788, 149.518788, 149.548788, 149.578788, 149.608788, 149.638788, 149.668788, 149.698788, 149.728788, 149.758788, 149.788788, 149.818788, 149.848788, 149.878788, 149.908788, 149.938788, 149.968788, 149.998788])
- mean_cur(time, latitude, longitude)float32nan nan nan ... 0.2468 0.2474
array([[[ nan, nan, nan, ..., 0.4634282 , 0.46968427, 0.49233517], [ nan, nan, nan, ..., 0.4644585 , 0.48129857, 0.51322573], [ nan, nan, nan, ..., 0.48895648, 0.50567627, 0.5370368 ], ..., [0.7861784 , 0.8591742 , 0.8943465 , ..., 0.17263387, 0.13843583, 0.12978652], [0.8154668 , 0.87681013, 0.8863847 , ..., 0.17002185, 0.13975053, 0.11683349], [0.8355274 , 0.876768 , 0.8789471 , ..., 0.16916089, 0.13755523, 0.11235519]], [[ nan, nan, nan, ..., 0.4749473 , 0.45320886, 0.45032144], [ nan, nan, nan, ..., 0.46796873, 0.4746721 , 0.4892066 ], [ nan, nan, nan, ..., 0.4843022 , 0.49718878, 0.5205815 ], ... [0.41028556, 0.4310906 , 0.4315806 , ..., 0.46277016, 0.46677172, 0.48055476], [0.41546142, 0.43104717, 0.42280003, ..., 0.4672839 , 0.47412732, 0.4880753 ], [0.4235171 , 0.42299566, 0.41290042, ..., 0.49412116, 0.4924523 , 0.50179636]], [[ nan, nan, nan, ..., 0.46363178, 0.446824 , 0.4409898 ], [ nan, nan, nan, ..., 0.44179997, 0.4454954 , 0.4631149 ], [ nan, nan, nan, ..., 0.44657648, 0.45790872, 0.48995432], ..., [0.15054722, 0.1395527 , 0.14844653, ..., 0.19364543, 0.20501566, 0.20558295], [0.1605174 , 0.15287273, 0.16006424, ..., 0.20986286, 0.23173682, 0.23961471], [0.1758618 , 0.17561924, 0.18081206, ..., 0.23022288, 0.24680026, 0.24744835]]], dtype=float32)
- u(time, latitude, longitude)float32nan nan nan ... -0.08577 -0.07427
array([[[ nan, nan, nan, ..., 0.11423142, 0.1266708 , 0.17245938], [ nan, nan, nan, ..., 0.19222638, 0.20052929, 0.21039933], [ nan, nan, nan, ..., 0.22384474, 0.22848003, 0.22888744], ..., [ 0.16379479, 0.19777918, 0.2181298 , ..., 0.06030899, 0.0374292 , -0.00952825], [ 0.15464637, 0.18257195, 0.20758499, ..., 0.08267868, 0.07302135, 0.04478937], [ 0.14281559, 0.16458642, 0.17445257, ..., 0.09147534, 0.07143288, 0.04751104]], [[ nan, nan, nan, ..., 0.12893355, 0.13295245, 0.16017008], [ nan, nan, nan, ..., 0.18529204, 0.19382657, 0.1951046 ], [ nan, nan, nan, ..., 0.19706692, 0.20694138, 0.20219138], ... [-0.0028988 , 0.00647128, 0.00864775, ..., 0.08297583, 0.08660094, 0.08956234], [-0.00585993, -0.00080048, 0.00289488, ..., 0.07021709, 0.07469519, 0.07388732], [-0.00801331, -0.00960033, -0.01083327, ..., 0.06167536, 0.07516257, 0.0765791 ]], [[ nan, nan, nan, ..., 0.01517368, 0.01935198, 0.04008111], [ nan, nan, nan, ..., 0.01728081, 0.00378853, -0.00982237], [ nan, nan, nan, ..., 0.03324418, 0.01581921, -0.00483583], ..., [-0.0617284 , -0.07268014, -0.08054384, ..., -0.09234461, -0.08840704, -0.08983514], [-0.07057677, -0.07272919, -0.08072968, ..., -0.09411097, -0.08682495, -0.08131769], [-0.06976578, -0.08606773, -0.0893801 , ..., -0.09574707, -0.08576895, -0.07426573]]], dtype=float32)
- v(time, latitude, longitude)float32nan nan nan ... 0.09289 0.08283
array([[[ nan, nan, nan, ..., -0.13734305, -0.17512415, -0.2181052 ], [ nan, nan, nan, ..., -0.15571964, -0.17643008, -0.2136419 ], [ nan, nan, nan, ..., -0.17138134, -0.18705167, -0.18835248], ..., [-0.76732767, -0.8347777 , -0.8661826 , ..., -0.08839713, -0.08630551, -0.06658989], [-0.79948366, -0.85641617, -0.8604491 , ..., -0.08640948, -0.07393473, -0.06404421], [-0.822066 , -0.8596617 , -0.8597343 , ..., -0.07091576, -0.06962479, -0.06670736]], [[ nan, nan, nan, ..., -0.03726722, -0.01478427, -0.01331457], [ nan, nan, nan, ..., -0.03520741, -0.02919367, -0.03415882], [ nan, nan, nan, ..., -0.03870706, -0.04126144, -0.03373257], ... [ 0.17573796, 0.16500142, 0.15075657, ..., 0.04494429, 0.04542811, 0.05514891], [ 0.17542395, 0.16093779, 0.1509299 , ..., 0.0317532 , 0.04166163, 0.05434271], [ 0.17308433, 0.16231707, 0.16093199, ..., 0.03632738, 0.03961851, 0.04652447]], [[ nan, nan, nan, ..., -0.07024752, -0.02208211, 0.02037012], [ nan, nan, nan, ..., -0.04624046, -0.03029361, -0.01445149], [ nan, nan, nan, ..., -0.03115813, -0.02805894, -0.01637595], ..., [ 0.00214106, 0.01074451, 0.03022425, ..., 0.06670408, 0.06174932, 0.07469093], [ 0.02104499, 0.03286714, 0.04158859, ..., 0.08458132, 0.07883716, 0.07930212], [ 0.04615395, 0.05403224, 0.06011659, ..., 0.09876332, 0.0928949 , 0.08283269]]], dtype=float32)
- mag(time, latitude, longitude)float32nan nan nan ... 0.1264 0.1113
array([[[ nan, nan, nan, ..., 0.17863911, 0.21613413, 0.27805054], [ nan, nan, nan, ..., 0.2473855 , 0.26709467, 0.29985118], [ nan, nan, nan, ..., 0.28191847, 0.29528198, 0.29642218], ..., [0.78461486, 0.8578872 , 0.89322615, ..., 0.10701041, 0.09407224, 0.06726813], [0.81430316, 0.8756604 , 0.8851351 , ..., 0.11959248, 0.10391565, 0.07815208], [0.8343793 , 0.8752754 , 0.87725526, ..., 0.11574447, 0.09975103, 0.08189731]], [[ nan, nan, nan, ..., 0.13421142, 0.13377193, 0.16072252], [ nan, nan, nan, ..., 0.18860726, 0.19601278, 0.19807228], [ nan, nan, nan, ..., 0.20083228, 0.21101479, 0.20498595], ... [0.17576186, 0.16512828, 0.15100439, ..., 0.09436619, 0.09779282, 0.10517992], [0.17552179, 0.16093978, 0.15095766, ..., 0.07706299, 0.08552814, 0.09171949], [0.17326973, 0.16260073, 0.1612962 , ..., 0.07157883, 0.08496492, 0.08960405]], [[ nan, nan, nan, ..., 0.07186761, 0.02936186, 0.0449604 ], [ nan, nan, nan, ..., 0.04936402, 0.03052959, 0.01747354], [ nan, nan, nan, ..., 0.04556319, 0.03221105, 0.01707504], ..., [0.06176552, 0.07347004, 0.08602799, ..., 0.11391646, 0.10783684, 0.11682931], [0.07364762, 0.07981093, 0.09081239, ..., 0.12653407, 0.11727689, 0.11358429], [0.08365077, 0.10162253, 0.10771632, ..., 0.13755615, 0.12643486, 0.11125041]]], dtype=float32)
- angle(time, latitude, longitude)float32nan nan nan ... 2.341 2.316 2.302
array([[[ nan, nan, nan, ..., -0.87700903, -0.9445902 , -0.9017416 ], [ nan, nan, nan, ..., -0.6808599 , -0.7215544 , -0.7930449 ], [ nan, nan, nan, ..., -0.653427 , -0.68602693, -0.6885518 ], ..., [-1.3604912 , -1.3381613 , -1.324097 , ..., -0.97208226, -1.1615945 , 4.5702653 ], [-1.3797232 , -1.3607591 , -1.334068 , ..., -0.80745876, -0.7916132 , -0.9605061 ], [-1.3987855 , -1.3816305 , -1.3705999 , ..., -0.6594628 , -0.77258074, -0.9519087 ]], [[ nan, nan, nan, ..., -0.2813735 , -0.1107446 , -0.082937 ], [ nan, nan, nan, ..., -0.18777192, -0.14949381, -0.1733228 ], [ nan, nan, nan, ..., -0.19394684, -0.19680607, -0.16531229], ... [ 1.5872899 , 1.5315969 , 1.5134968 , ..., 0.49641395, 0.48310864, 0.5519272 ], [ 1.6041883 , 1.5757701 , 1.5516185 , ..., 0.42469418, 0.50877786, 0.63414395], [ 1.6170604 , 1.629873 , 1.6380107 , ..., 0.5322993 , 0.48509514, 0.54594135]], [[ nan, nan, nan, ..., -1.3580617 , -0.851194 , 0.470204 ], [ nan, nan, nan, ..., -1.2131516 , -1.4463817 , 4.115432 ], [ nan, nan, nan, ..., -0.7530185 , -1.0574313 , 4.425249 ], ..., [ 3.1069214 , 2.994823 , 2.7826009 , ..., 2.5160313 , 2.5318968 , 2.4479835 ], [ 2.8518012 , 2.7171507 , 2.665892 , ..., 2.409474 , 2.4043746 , 2.3687425 ], [ 2.5571368 , 2.5809913 , 2.5494971 , ..., 2.340689 , 2.316331 , 2.301716 ]]], dtype=float32)
Dataset temporal visualisation¶
Using GeoViews
we visualise the weekly max surface magnitude:
# Specify the dataset, its coordinates and requested variable
dataset = gv.Dataset(load_week, ['longitude', 'latitude', 'time'],
'mag', crs=crs.PlateCarree())
images = dataset.to(gv.Image,dynamic=True)
# Loading coastlines from Cartopy
coastline = gf.coastline(line_width=2,line_color='k').opts(projection=ccrs.PlateCarree(),scale='10m')
# Loading land mask from Cartopy
land = gf.land.options(scale='10m', fill_color='lightgray')
# Slider location
hv.output(widget_location='bottom')
# Create stack of images grouped by time
images.opts(active_tools=['wheel_zoom', 'pan'], cmap=cmocean.cm.speed,
colorbar=True, width=500, height=500, clim=(0.1,1.0)) * coastline * land