Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

Always use the eof.mv first for a given parameter, step and ensemble forecast (e.g. ens_oper or ens_2016) to create the cluster file.

Otherwise cluster_to_an.mv and other plots with clustering enabled will fail or plot with the wrong clustering of ensemble members.

If you change step or ensemble, recompute the EOFS and cluster definitions using eof.mv. Note however, that once a cluster has been computed, it can be used for all steps with any parameter.

Note that the EOF analyses is run over the smaller domain over France. This may produce a different clustering to your manual cluster if you used a larger domain.

Warning

TODO: allow the students to choose 2,3 or 4 clusters from the EOFs. Pass a new variable from the user level to the base_* functions.


Panel
titleCompute EOFs and clusters

Edit 'eof.mv'

Set the parameter to use, choice of ensemble and forecast step required for the EOF computation:

Code Block
param="z500"
expId="ens_oper"
steps=[2012-09-24 00:00]

Run the macro.

The above example will compute the EOFs of geopotential height anomaly at 500hPa using the 2012 operational ensemble at forecast step 00Z on 24/09/2012.

A plot will appear showing the first two EOFs.

The geographical area for the EOF computation is: 35-55N, 10W-20E (same as in Pantillon et al). If desired it can be changed in eof.mv.

...

Panel
borderColorred

Q. How similar is the PCA computed clusters to your manual clustering?
Q. Which cluster best represents the analysis?
Q. How useful is the cluster analysis as an aid to forecasting for HyMEX?
Q. Change the date/time used to compute the clusters. How does the variance explained by the first two clusters change?  Is geopotential the best parameter to use?


Panel
titleChanging the number of clusters

To change the number of clusters created by the EOF analysis, find the file in the folder 'base' called base_eof.mv.

Edit this file and near the top, change:

Code Block
  clusterNum=2

to

Code Block
  clusterNum=3

then select 'File' and 'Save' to save the changes.

Now if you run the eof.mv macro, it will generate a text file, such as ens_oper.eof.txt with 3 lines, one for each cluster. It will also show the 3 clusters as different colours.

You can use the 3 clusters in the cluster_to_an.mv macro, for example:

Code Block
param="z500.s"
expId="ens_oper"
members_1=["cl.eof.1"]
members_2=["cl.eof.3"]

would plot the mean of the members in the first and the third clusters (it's not possible to plot all three clusters together).

You can have as many clusters as you like but it does not make sense to go beyond 3 or 4 clusters.


Panel
titleCluster method code

For those interested:

The code that computes the clusters can be found in the Python script: aux/cluster.py.

This uses the 'ward' cluster method from SciPy. Other cluster algorithms are available. See http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html#scipy.cluster.hierarchy.linkage

The python code can be changed to a different algorithm or the more adventurous can write their own cluster algorithm!

...