Cyclone track

In this last example, we showcases how RADWave can be used to query wave conditions from altimeter database along a specified cyclone track.

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'

First we will use already downloaded dataset of track of cyclone YASI. The data was obtained from the Australian Bureau of Meteorology (BOM cyclone tracks).

To load this file in the waveAnalysis class, the cyclone track needs to be a CSV file with in the header having the following keyword names lon, lat & datetime.

To only visualise the tracks on a map, a minimal number of options have to be set as shown in the cell below:

cyc = rwave.waveAnalysis(cycloneCSV='../pracenv/dataset/2010-YASI.csv')

Plotting the tracks is done by using the following function:

cyc.plotCycloneTracks(title="Cyclone YASI Track", markersize=100, zoom=4, 
                     extent=[138, 180, -30, -10], fsize=(12, 10))
/usr/share/miniconda/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 '
/usr/share/miniconda/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 '
/usr/share/miniconda/envs/coast/lib/python3.6/site-packages/cartopy/io/__init__.py:260: DownloadWarning: Downloading: https://naciscdn.org/naturalearth/10m/physical/ne_10m_coastline.zip
  warnings.warn('Downloading: {}'.format(url), DownloadWarning)
../_images/cycloneyasi_5_2.svg

The geographical extent of the cyclone path and the associated time frame can be infered from the figure above.

This was used to specify the altimeter data record location and temporal extent when using the Australian Ocean Data Network portal AODN.

As for the other examples, 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.

We will now create 2 new RADWave classes names (wa_east and wa_west) that will, in addition to the cyclone track, set the list of altimeter NETCDF URLs files to query for the analyse in 2 different regions.

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

We also call the processAltimeterData function to query the actual dataset and store the altimeter data in each class. The description of this function is available from the API.

For the eastern region

wa_east = rwave.waveAnalysis(altimeterURL='../pracenv/dataset/IMOS_YASI_east.txt', bbox=[170, 175, -17, -12], 
                  stime=[2011,1,27], etime=[2011,2,4], cycloneCSV='../pracenv/dataset/2010-YASI.csv')

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

   +  name JASON-2     / number of tracks                               19  
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-4-fa97d545e912> in <module>
      2                   stime=[2011,1,27], etime=[2011,2,4], cycloneCSV='../pracenv/dataset/2010-YASI.csv')
      3 
----> 4 wa_east.processAltimeterData(max_qc=1, altimeter_pick='all', saveCSV = 'altimeterDataE.csv')

/usr/share/miniconda/envs/coast/lib/python3.6/site-packages/RADWave/altiwave.py in processAltimeterData(self, max_qc, altimeter_pick, saveCSV)
    296                 for k in range(len(picked_url)):
    297 
--> 298                     ncs = NetCDFFile(picked_url[k])
    299                     if k == 0:
    300                         print(

src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__()

src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4._get_vars()

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

/usr/share/miniconda/envs/coast/lib/python3.6/site-packages/netCDF4/utils.py in _find_dim(grp, dimname)
     39     return [A[i] for i in sorted(range(len(A)), key=B.__getitem__)]
     40 
---> 41 def _find_dim(grp, dimname):
     42     # find Dimension instance given group and name.
     43     # look in current group, and parents.

KeyboardInterrupt: 

For the western region

wa_west = rwave.waveAnalysis(altimeterURL='../pracenv/dataset/IMOS_YASI_west.txt', bbox=[156, 161, -16, -12], 
                  stime=[2011,1,27], etime=[2011,2,4], cycloneCSV='../pracenv/dataset/2010-YASI.csv')

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

   +  name JASON-2     / number of tracks                               16  
   +  name CRYOSAT-2   / number of tracks                               20  
   +  name ENVISAT     / number of tracks                               20  
 
Processing altimeter dataset took:  2 s

In the case where a cyclone track is given when initialising the waveAnalysis class, the visualiseData plots not only the extent of the altimeter dataset but also the associated path.

wa_east.visualiseData(title="Altimeter data east side", extent=[138, 180, -30, -10.0], 
                 markersize=35, zoom=4, fsize=(12, 10), fsave=None)

wa_west.visualiseData(title="Altimeter data west side", extent=[138, 180, -30, -10.0], 
                 markersize=35, zoom=4, fsize=(12, 10), fsave=None)
../_images/cycloneyasi_11_0.svg../_images/cycloneyasi_11_1.svg

Extracting relevant wave dataset

Once the data has been loaded, the following step consist in computing the wave parameters by running the generateTimeSeries function.

This function 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

east_ts = wa_east.generateTimeSeries()

west_ts = wa_west.generateTimeSeries()

From the cyclone track, we find the closest processed altimeter geographical locations that have been recorded in the database (based on a KDTree search).

In addition to their coordinates, the altimeter dataset has to be recorded during a user defined time lapse close enough to the cyclone path time at each position.

This is done using the close2Track function that takes the following arguments:

  • radius, the maximum radius distance in degree between cyclone position and altimeter data coordinates [here set to 2.]

  • dtmax, the maximum difference in time between recorded cyclone date and picked altimeter data (hours) [here set to 6]

This function stores a Pandas dataframe in the waveAnalysis class called cyclone_data that contains the following variables:

  • altimeter significant wave height (m) - wH

  • altimeter wave period (s) - period

  • altimeter wave energy flux (kW/m) - power

  • altimeter wave average energy density (J/m2) - energy

  • altimeter wave group velocity (m/s) - speed

  • distance between altimeter coordinates and cyclone path (km) - dist

  • cyclone date (datetime) - cdate

  • difference in time between recorded cyclone date and altimeter data for specific position (hours) - hours

  • cyclone latitude position - clat

  • cyclone longitude position - clon

  • altimeter data latitude position - lat

  • altimeter data longitude position - lon

Depending of the available altimeters dataset and the chosen radius and dtmax parameters, the Pandas dataframe cyclone_data will contain different number of values (or can potentially be empty).

east_track = wa_east.close2Track(radius=2.,dtmax=6.)
display(wa_east.cyclone_data)

west_track = wa_west.close2Track(radius=2.,dtmax=6.)
display(wa_west.cyclone_data)
period speed power energy dist date wH lon lat clon clat hours
0 5.440683 8.491691 27.794308 8.491691 113.604 2011-01-28 18:00:00+00:00 1.614 174.444580 -13.529891 174.1 -14.5 -2.284
1 5.749904 8.974317 29.812409 8.974317 33.699 2011-01-28 18:00:00+00:00 1.626 174.359543 -14.330362 174.1 -14.5 -2.280
2 5.903791 9.214501 41.094925 9.214501 102.590 2011-01-28 18:00:00+00:00 1.884 174.243790 -15.416570 174.1 -14.5 -2.275
3 5.893205 9.197977 27.622688 9.197977 213.351 2011-01-29 06:00:00+00:00 1.546 170.924179 -14.505723 172.9 -14.4 -2.008
period speed power energy dist date wH lon lat clon clat hours
0 6.756970 10.546121 265.003090 10.546121 213.219 2011-01-31 12:00:00+00:00 4.4720 159.141006 -14.474576 160.9 -13.6 -0.424
1 6.294248 9.823916 197.842215 9.823916 207.053 2011-01-31 12:00:00+00:00 4.0035 159.012177 -13.911661 160.9 -13.6 -0.421
2 5.388097 8.409617 215.400314 8.409617 121.468 2011-01-31 12:00:00+00:00 4.5150 160.805725 -12.505943 160.9 -13.6 4.477
3 6.742534 10.523590 645.875203 10.523590 26.814 2011-01-31 12:00:00+00:00 6.9890 160.705750 -13.449617 160.9 -13.6 4.482
4 8.084588 12.618237 917.565692 12.618237 121.311 2011-01-31 12:00:00+00:00 7.6075 160.578125 -14.650486 160.9 -13.6 4.487
5 9.622043 15.017862 1129.556402 15.017862 218.935 2011-01-31 12:00:00+00:00 7.7370 160.483597 -15.536715 160.9 -13.6 4.491
6 6.898052 10.766320 272.597023 10.766320 207.058 2011-01-31 14:00:00+00:00 4.4890 159.369446 -15.467758 160.0 -13.7 -2.428
7 6.756970 10.546121 265.003090 10.546121 126.292 2011-01-31 14:00:00+00:00 4.4720 159.141006 -14.474576 160.0 -13.7 -2.424
8 6.294248 9.823916 197.842215 9.823916 109.344 2011-01-31 14:00:00+00:00 4.0035 159.012177 -13.911661 160.0 -13.7 -2.421
9 6.351562 9.913371 182.333266 9.913371 123.287 2011-01-31 14:00:00+00:00 3.8260 158.898865 -13.414909 160.0 -13.7 -2.419
10 6.061618 9.460833 114.016157 9.460833 195.525 2011-01-31 14:00:00+00:00 3.0970 158.688202 -12.487484 160.0 -13.7 -2.414
11 5.388097 8.409617 215.400314 8.409617 158.380 2011-01-31 14:00:00+00:00 4.5150 160.805725 -12.505943 160.0 -13.7 2.477
12 6.742534 10.523590 645.875203 10.523590 81.251 2011-01-31 14:00:00+00:00 6.9890 160.705750 -13.449617 160.0 -13.7 2.482
13 8.084588 12.618237 917.565692 12.618237 122.287 2011-01-31 14:00:00+00:00 7.6075 160.578125 -14.650486 160.0 -13.7 2.487
14 9.622043 15.017862 1129.556402 15.017862 209.795 2011-01-31 14:00:00+00:00 7.7370 160.483597 -15.536715 160.0 -13.7 2.491
15 10.164666 15.864775 1659.794099 15.864775 166.122 2011-02-01 00:00:00+00:00 9.1250 157.284393 -15.489555 156.7 -14.1 4.754
16 7.840593 12.237417 866.401715 12.237417 62.471 2011-02-01 00:00:00+00:00 7.5065 157.171509 -14.427608 156.7 -14.1 4.759
17 6.531067 10.193538 340.226704 10.193538 79.440 2011-02-01 00:00:00+00:00 5.1540 157.071121 -13.480325 156.7 -14.1 4.763
18 6.970117 10.878797 301.690431 10.878797 136.290 2011-02-01 00:00:00+00:00 4.6980 157.010422 -12.906148 156.7 -14.1 4.765
19 6.307313 9.844308 297.468306 9.844308 185.091 2011-02-01 00:00:00+00:00 4.9040 156.961929 -12.446772 156.7 -14.1 4.768

Visualising the relevant altimeters date

RADWave provides a plotting function to visualise the processed wave data called plotCycloneAltiPoint that can be used to also provide information about wave parameters for each data point (by turning the showinfo flag to True as explained in the API.

An example of how to call this function is presented below:

wa_west.plotCycloneAltiPoint(showinfo=False, extent=[138, 180, -18, -10], 
                 markersize=35, zoom=4, fsize=(12, 5))
/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/cycloneyasi_17_1.svg../_images/cycloneyasi_17_2.svg../_images/cycloneyasi_17_3.svg
wa_west.plotCycloneAltiPoint(showinfo=True, extent=[138, 180, -18, -10], 
                 markersize=35, zoom=4, fsize=(12, 5))
 
++++++++++++++++++++++++++++++++++++++++++++

Considered cyclone path point (160.9,-13.6) at 2011-01-31 12:00:00+00:00
../_images/cycloneyasi_18_1.svg
Altimeter point (159.1,-14.5) records dt: -0.42h
    +    Power  265.0 kW/m
    +   Energy  10.55 J/m2
    + Celerity  10.55 m/s
    +   Period  6.76 s
    +   Height  4.47 m
 
Altimeter point (159.0,-13.9) records dt: -0.42h
    +    Power  197.84 kW/m
    +   Energy  9.82 J/m2
    + Celerity  9.82 m/s
    +   Period  6.29 s
    +   Height  4.0 m
 
Altimeter point (160.8,-12.5) records dt: 4.48h
    +    Power  215.4 kW/m
    +   Energy  8.41 J/m2
    + Celerity  8.41 m/s
    +   Period  5.39 s
    +   Height  4.52 m
 
Altimeter point (160.7,-13.4) records dt: 4.48h
    +    Power  645.88 kW/m
    +   Energy  10.52 J/m2
    + Celerity  10.52 m/s
    +   Period  6.74 s
    +   Height  6.99 m
 
Altimeter point (160.6,-14.7) records dt: 4.49h
    +    Power  917.57 kW/m
    +   Energy  12.62 J/m2
    + Celerity  12.62 m/s
    +   Period  8.08 s
    +   Height  7.61 m
 
Altimeter point (160.5,-15.5) records dt: 4.49h
    +    Power  1129.56 kW/m
    +   Energy  15.02 J/m2
    + Celerity  15.02 m/s
    +   Period  9.62 s
    +   Height  7.74 m
 
 
++++++++++++++++++++++++++++++++++++++++++++

Considered cyclone path point (160.0,-13.7) at 2011-01-31 14:00:00+00:00
../_images/cycloneyasi_18_3.svg
Altimeter point (159.4,-15.5) records dt: -2.43h
    +    Power  272.6 kW/m
    +   Energy  10.77 J/m2
    + Celerity  10.77 m/s
    +   Period  6.9 s
    +   Height  4.49 m
 
Altimeter point (159.1,-14.5) records dt: -2.42h
    +    Power  265.0 kW/m
    +   Energy  10.55 J/m2
    + Celerity  10.55 m/s
    +   Period  6.76 s
    +   Height  4.47 m
 
Altimeter point (159.0,-13.9) records dt: -2.42h
    +    Power  197.84 kW/m
    +   Energy  9.82 J/m2
    + Celerity  9.82 m/s
    +   Period  6.29 s
    +   Height  4.0 m
 
Altimeter point (158.9,-13.4) records dt: -2.42h
    +    Power  182.33 kW/m
    +   Energy  9.91 J/m2
    + Celerity  9.91 m/s
    +   Period  6.35 s
    +   Height  3.83 m
 
Altimeter point (158.7,-12.5) records dt: -2.41h
    +    Power  114.02 kW/m
    +   Energy  9.46 J/m2
    + Celerity  9.46 m/s
    +   Period  6.06 s
    +   Height  3.1 m
 
Altimeter point (160.8,-12.5) records dt: 2.48h
    +    Power  215.4 kW/m
    +   Energy  8.41 J/m2
    + Celerity  8.41 m/s
    +   Period  5.39 s
    +   Height  4.52 m
 
Altimeter point (160.7,-13.4) records dt: 2.48h
    +    Power  645.88 kW/m
    +   Energy  10.52 J/m2
    + Celerity  10.52 m/s
    +   Period  6.74 s
    +   Height  6.99 m
 
Altimeter point (160.6,-14.7) records dt: 2.49h
    +    Power  917.57 kW/m
    +   Energy  12.62 J/m2
    + Celerity  12.62 m/s
    +   Period  8.08 s
    +   Height  7.61 m
 
Altimeter point (160.5,-15.5) records dt: 2.49h
    +    Power  1129.56 kW/m
    +   Energy  15.02 J/m2
    + Celerity  15.02 m/s
    +   Period  9.62 s
    +   Height  7.74 m
 
 
++++++++++++++++++++++++++++++++++++++++++++

Considered cyclone path point (156.7,-14.1) at 2011-02-01 00:00:00+00:00
../_images/cycloneyasi_18_5.svg
Altimeter point (157.3,-15.5) records dt: 4.75h
    +    Power  1659.79 kW/m
    +   Energy  15.86 J/m2
    + Celerity  15.86 m/s
    +   Period  10.16 s
    +   Height  9.12 m
 
Altimeter point (157.2,-14.4) records dt: 4.76h
    +    Power  866.4 kW/m
    +   Energy  12.24 J/m2
    + Celerity  12.24 m/s
    +   Period  7.84 s
    +   Height  7.51 m
 
Altimeter point (157.1,-13.5) records dt: 4.76h
    +    Power  340.23 kW/m
    +   Energy  10.19 J/m2
    + Celerity  10.19 m/s
    +   Period  6.53 s
    +   Height  5.15 m
 
Altimeter point (157.0,-12.9) records dt: 4.76h
    +    Power  301.69 kW/m
    +   Energy  10.88 J/m2
    + Celerity  10.88 m/s
    +   Period  6.97 s
    +   Height  4.7 m
 
Altimeter point (157.0,-12.4) records dt: 4.77h
    +    Power  297.47 kW/m
    +   Energy  9.84 J/m2
    + Celerity  9.84 m/s
    +   Period  6.31 s
    +   Height  4.9 m
 

As already mentioned in the different examples, the class waveAnalysis() saves most of the processed wave data as Pandas dataframe (such as timeseries or cyclone_data) that can be used for further analysis.