#Metview Macro

#Read ODB
ccma = read("CCMA.obs")

#Define plot
wind_plot = odb_visualiser(
		odb_plot_type	:	"geo_vectors",
		odb_value_variable	:	"",
		odb_from	:	"hdr, body",
		odb_where	:	"obstype@hdr = 2 and " &
					"varno@body = 3 and " &
					"varno@body#1 = 4 and " &
					"vertco_reference_1@body < 25000 ",
		odb_coordinates_unit	:	"radians",
		odb_data	:	ccma
		)

#Wind plotting
fixed_wind = mwind(
		wind_advanced_method	:	"on",
		wind_arrow_unit_velocity	:	50.0,
		wind_thinning_factor	:	1.0,
		wind_advanced_colour_selection_type	:	"interval",
		wind_advanced_colour_max_value	:	90,
		wind_advanced_colour_min_value	:	0,
		wind_advanced_colour_level_interval	:	5,
		wind_advanced_colour_max_level_colour	:	"red",
		wind_advanced_colour_min_level_colour	:	"blue",
		wind_advanced_colour_direction	:	"clockwise"
		)
#Title
title = mtext(
		text_line_count	:	3,
		text_line_1	:	"Date: 2011-02-19 Time: 00",
		text_line_2	:	"Aircraft wind over 250 hPa",
		text_line_3	:	"Type: CCMA.obs"
		)

#Plot
plot(wind_plot,fixed_wind,title)