Versions Compared

Key

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

...

Part 3: ensemble members

We will create stamp plots

 

 

Plotting the observations

Now a stamp plot for a selected timestep i.e. we will plot the observations into the last map of the layout. The observations are stored in the Geopoints file called prec_24.gpt. Simply add this piece of code to the end of the Macro to read and plot the observations: 

Code Block
gpt=read("prec_24.gpt")

plot(dw[4],gpt)

Now run the Macro to check if the observations were correctly plotted.

Customising the forecast plots

The forecast plots need some customisation. Use the Contouring icon supplied in the folder to apply the contour shading as seen in the target plots. Just drag it into the forecast plots.

Now we will add these settings to the Macro. Drag the Contouring icon into the Macro editor just below the Display Window definition, then add it to the plot command like this (supposing it is named as cont).

Code Block
plot(dw[i],f,cont)

The titles also need to be changed. Within the loop define a custom title with

Code Block
txt=" your title goes here "

title=mtext(text_line_1: txt)

all the 50 ENS members.

Create a new Macro and edit it. Drop your Geographical View and the Coastlines icons into the Macro editor. Once the code is generated and tidied up define a 6x9 layout so that each plot should contain your view:

Code Block
dw=plot_super_page(pages: mxn_layout(my_view,9,6))

 Next, read the GRIB file with the perturbed forecasts in:

Code Block
g=read("fc_pf.grib")

Since this GRIB contains several time steps we need to write a loop to compute the probability for each time step individually. First, define the fieldset that will contain the resulting probabilities:

Code Block
e_prob=nil

Next, we define the timestep we want to plot. We will store it in a variable:

Code Block
val=90

Now we will

Code Block
for i=1 to 50 do

    ...your code will go here ...

end for

Within the loop, simply read all the members for the given timestep

Code Block
f=read(data: g,
		step: step,
		number: i
 )	

then compute their mean with the mean() macro function

Code Block
title = mtext(
		text_line_1	: "member: " &i,
		text_font_size: 0.2 
	)

and add it to the resulting fieldsetthen add it to the plot command:

Code Block
plot(dw[i],title,f,cont,title)wgust_shade)	

We finish the macro by returning the resulting fieldsetYour title should include the model run date and time, the forecast timestep and the name of the field. E.g. for the second forecast you should get something like this in the plot:

Code Block
20140821 0 UTC 24h total precipitation T+72

Customising the observation plot

The observation also needs some customisation. Use the Contouring icon supplied in the folder to apply the contour shading as seen in the target plots.  Use the Symbol Plotting icon supplied in the folder to apply the colour settings to the observations as used for the forecast. Just drag it into the observation plot.

Now we will add these settings to the Macro. Drag the Symbol Plotting icon into the Macro editor just above the last plot command for the Geopoints data, then add it to the plot command like this (supposing it is named as sym)

Code Block
plot(dw[4],gpt,sym)

You can also add a custom title to the observation plot. Now you surely know how to do it.

return e_mean

By using the return statement our Macro behaves as if it were a fieldset (GRIB file). Drag it into the bottom left map and customise it with the wgust_shade Contouring icon and the title_mean Text Plotting icon. You will see that the ensemble mean hints that high wind speed can happen.