Satellite tile analysis

In this first notebook, we illustrate the use of RADWave to extract wave conditions based on altimeter data for a specific geographical region.

We will be querying data already downloaded from the obtained from Australian Ocean Data Network portal AODN.

We recomend to look at RADWave documentation and the embeded video that explain how to select both a spatial bounding box and a temporal extent from the portal and how to export the file containing the List of URLs. This TXT file contains a list of NETCDF files for each available satellites.

from IPython.display import IFrame
IFrame(src='https://bit.ly/2ROFoLY', width=900, height=600)

Loading RADWave library and initialisation

We first start by importing RADwave library into our working space.

import RADWave as rwave

%matplotlib inline
%config InlineBackend.figure_format = 'svg'

Once the list of NETCDF data file has been saved on disk, you will be able to load it by initialising RADWave main Python class called waveAnalysis.

For a detail overview of the options available in this class, you can have a look at the waveAnalysis API.

Here, we will use the following parameters:

  • altimeterURL (str): list of NetCDF URLs downloaded from the wave data portal containing the radar altimeter data [‘…/dataset/IMOSURLs.txt’]

  • bbox (list): bounding box specifying the geographical extent of the uploaded dataset following the convention [lon min,lon max,lat min,lat max] [here we use a region located offshore sydney]

  • stime (list): starting time of wave climate analysis following the convention [year, month, day] [we chose the 1st of January 1985]

  • etime (list): ending time of wave climate analysis following the convention [year, month, day] [we chose the 31st of December 2018]

For this example, we don’t specify a list of particular satellites to use (satNames keyword) so all of them will be queried. In other words we will look at all the records from the 10 altimeters:

JASON-2 - JASON-3 - SARAL - SENTINEL-3A - CRYOSAT-2 - ENVISAT - GEOSAT - ERS-2 - GFO - TOPEX.

wa = rwave.waveAnalysis(altimeterURL='../pracenv/dataset/IMOSURLs.txt', bbox=[152.0,155.0,-36.0,-34.0], 
                  stime=[1985,1,1], etime=[2018,12,31])

Processing altimeters data

After class initialisation querying the actual dataset is realised by calling the processAltimeterData function. The description of this function is available from the API.

The function can take some times to execute depending on the number of NETCDF files to load and the size of the dataset to query (here it should not take more than 30 s).

RADWave uses the uploaded file containing the list of URLs to query via THREDDS the remote data. This operation can take several minutes and when looking at a large region it is recommended to divide the analyse in smaller regions and download a series of URLs text file instead of the entire domain directly.

wa.processAltimeterData(max_qc=1, altimeter_pick='all', saveCSV = 'altimeterData.csv')
Processing Altimeter Dataset 

   +  name JASON-2     / number of tracks                               6   
   +  name JASON-3     / number of tracks                               4   
   +  name SARAL       / number of tracks                               6   
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-4-a77cf9e50a80> in <module>
----> 1 wa.processAltimeterData(max_qc=1, altimeter_pick='all', saveCSV = 'altimeterData.csv')

/usr/share/miniconda/envs/coast/lib/python3.6/site-packages/RADWave/altiwave.py in processAltimeterData(self, max_qc, altimeter_pick, saveCSV)
    306 
    307                     # Get desired bounding box
--> 308                     lats = ncs.variables["LATITUDE"][:]
    309                     lons = ncs.variables["LONGITUDE"][:]
    310                     latbound = np.where(

src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.__getitem__()

src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable._toma()

/usr/share/miniconda/envs/coast/lib/python3.6/site-packages/numpy/core/_methods.py in _any(a, axis, dtype, out, keepdims)
     51     return umr_prod(a, axis, dtype, out, keepdims, initial, where)
     52 
---> 53 def _any(a, axis=None, dtype=None, out=None, keepdims=False):
     54     return umr_any(a, axis, dtype, out, keepdims)
     55 

KeyboardInterrupt: 

In case where the processAltimeterData function has already been executed, one can load directly the processed data from the created CSV file in a more efficient way by running the readAltimeterData function as follow:

wa.readAltimeterData(saveCSV = 'altimeterData.csv')
Reading Processed Altimeter Dataset 

Once the dataset has been queried, we can plot the altimeter data points on a map using the visualiseData function.

This function plots and saves in a figure the geographical coordinates of processed altimeter data.

wa.visualiseData(title="Altimeter data tracks", extent=[149.,158.,-38.,-32.], 
                 addcity=['Sydney', 151.2093, -33.8688], markersize=40, zoom=8,
                 fsize=(8, 7), fsave=None)
/Users/getafix/anaconda3/envs/coast/lib/python3.6/site-packages/cartopy/mpl/gridliner.py:307: UserWarning: The .xlabels_top attribute is deprecated. Please use .top_labels to toggle visibility instead.
  warnings.warn('The .xlabels_top attribute is deprecated. Please '
/Users/getafix/anaconda3/envs/coast/lib/python3.6/site-packages/cartopy/mpl/gridliner.py:331: UserWarning: The .ylabels_left attribute is deprecated. Please use .left_labels to toggle visibility instead.
  warnings.warn('The .ylabels_left attribute is deprecated. Please '
../_images/tileanalysis_11_1.svg

Computing wave regime for specified location

To perform wave analysis and compute the wave parameters discussed in the documentation, we run the generateTimeSeries function.

This function computes time series of wave characteristics from available altimeter data namely the significant wave height and the wind speed.

It computes both instantaneous and monthly wave variables:

  • significant wave height (m) - wh & wh_rolling

  • wave period (s) - period & period_rolling

  • wave energy flux (kW/m) - power & power_rolling

  • wave average energy density (J/m2) - energy & energy_rolling

  • wave group velocity (m/s) - speed & speed_rolling

timeseries = wa.generateTimeSeries()

The class waveAnalysis stores a Pandas dataframe (called timeseries) of computed wave parameters that can be subsequently used to perform additional analysis.

To visualise this dataframe, one can do:

display(wa.timeseries)
date wh wh_rolling period period_rolling power power_rolling energy energy_rolling speed speed_rolling lat lon day month year
0 1985-04-13 08:22:39.835939 3.3380 3.338000 6.820216 6.820216 149.027418 149.027418 13999.974159 13999.974159 10.644835 10.644835 -34.356148 152.339462 13 4 1985
1 1985-04-16 08:31:20.722658 3.2370 3.287500 7.593262 7.206739 156.030379 152.528898 13165.578585 13582.776372 11.851388 11.248112 -34.494278 153.307892 16 4 1985
2 1985-04-16 08:31:30.031252 3.2520 3.275667 8.068064 7.493847 167.326903 157.461566 13287.878634 13484.477126 12.592447 11.696223 -35.012566 153.013702 16 4 1985
3 1985-04-16 08:31:38.363283 3.1695 3.249125 8.171444 7.663247 160.981438 158.341534 12622.232117 13268.915873 12.753801 11.960618 -35.475792 152.747742 16 4 1985
4 1985-04-22 08:48:59.253906 2.2560 3.050500 7.566001 7.643798 75.516172 141.776462 6394.885322 11894.109763 11.808839 11.930262 -35.719948 154.700333 22 4 1985
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
13594 2018-12-29 07:19:51.140629 2.9610 2.257066 6.217100 5.785322 106.895658 70.598167 11016.190276 7335.068674 9.703505 9.029597 -34.503365 153.593140 29 12 2018
13595 2018-12-29 07:20:08.464846 2.8450 2.263982 6.698641 5.796067 106.327768 71.018515 10169.958412 7368.420317 10.455084 9.046367 -35.520107 153.293304 29 12 2018
13596 2018-12-29 22:55:26.296871 3.4490 2.282417 6.597829 5.800757 153.915668 72.428915 14946.550471 7501.722134 10.297738 9.053686 -34.364624 152.803726 29 12 2018
13597 2018-12-29 22:55:36.484374 3.3310 2.294753 6.288747 5.806498 136.838655 73.186677 13941.318296 7577.482089 9.815331 9.062647 -34.838604 153.085678 29 12 2018
13598 2018-12-29 22:55:50.749998 3.3900 2.307488 6.315870 5.812421 142.340333 73.990789 14439.560584 7657.273699 9.857664 9.071891 -35.500633 153.486710 29 12 2018

13599 rows × 16 columns

and to list the header names:

list(wa.timeseries)
['date',
 'wh',
 'wh_rolling',
 'period',
 'period_rolling',
 'power',
 'power_rolling',
 'energy',
 'energy_rolling',
 'speed',
 'speed_rolling',
 'lat',
 'lon',
 'day',
 'month',
 'year']

Plotting time series

We can now plot time series of RADWave calculated wave parameters. This is done by calling the plotTimeSeries function.

Amongst the available option one can choose to (complete list of options is available in the API :

  • specify a specific temporal extent with the keyword time that provide the extent of years for the time series.

  • define the wave parameter to visualise using the keyword series that takes the following choices: ‘H’, ‘T’, ‘P’, ‘E’ and ‘Cg’.

In addition to the time series, the function provides additional information:

  • Maximum parameter value

  • Mean parameter value

  • Median parameter value

  • 95th percentile parameter value

# Significant wave height
wa.plotTimeSeries(series='H', fsize=(12, 5), fsave='seriesH')

# Wave period
wa.plotTimeSeries(time=[1995,2016], series='T', fsize=(10, 5), fsave=None)

# Wave power
wa.plotTimeSeries(time=[1995,2016], series='P', fsize=(10, 5), fsave=None)

# Wave energy
wa.plotTimeSeries(time=[1995,2016], series='E', fsize=(10, 5), fsave=None)

# Wave group velocity
wa.plotTimeSeries(time=[1995,2016], series='Cg', fsize=(10, 5), fsave=None)
Max wave height: 9.015 m
Mean wave height: 2.386 m
Median wave height: 2.157 m
95th percentile wave height: 4.328 m
../_images/tileanalysis_19_1.svg
Figure saved:  seriesH
Max wave period: 12.169 s
Mean wave period: 6.328 s
Median wave period: 6.205 s
95th percentile wave period: 8.004 s
../_images/tileanalysis_19_3.svg
Max wave power: 1922.153 kW/m
Mean wave power: 89.942 kW/m
Median wave power: 58.435 kW/m
95th percentile wave power: 274.046 kW/m
../_images/tileanalysis_19_5.svg
Max wave energy: 102114.179 J/m2
Mean wave energy: 8366.740 J/m2
Median wave energy: 6064.775 J/m2
95th percentile wave energy: 23373.495 J/m2
../_images/tileanalysis_19_7.svg
Max wave celerity: 18.993 m/s
Mean wave celerity: 9.876 m/s
Median wave celerity: 9.684 m/s
95th percentile wave celerity: 12.493 m/s
../_images/tileanalysis_19_9.svg