#Metview Macro

#Read ODB
db = read("AMSUA.odb")

#Define binning
bin_100 = binning(
		binning_x_count	:	100,
		binning_y_count	:	100
		)

#Define plot
scatter_plot = odb_visualiser(
		odb_plot_type	:	"xy_points",
		odb_x_variable	:	"fg_depar@body",
		odb_y_variable	:	"an_depar@body",
		odb_value_variable	:	"",
		odb_where	:	"vertco_reference_1@body =5 ",
		odb_data	:	db
		)

#Define symbol plotting
scatter_symbol = msymb(
		symbol_type	:	"marker",
		symbol_colour	:	"orange",
		symbol_height	:	0.3,
		symbol_marker_index	:	3
		)

#Define title
title = mtext(
		text_line_count	:	3,
		text_line_1	:	"Date: 2010-12-22 Time: 00",
		text_line_2	:	"Sat: METOP-A  Sensor: AMSU-A  Channel: 5 Param: Tb [K]",
		text_line_3	:	"Type: MFB"
		)

#Define horizontal axis
hor_axis = maxis(
		axis_position	:	"left",
		axis_title_text	:	"fg_depar (K)",
		axis_tick_interval	:	0.5,
		axis_minor_tick	:	"on",
		axis_minor_tick_count	:	4,
		axis_grid	:	"on",
		axis_grid_colour	:	"black",
		axis_grid_line_style	:	"dot"
		)

#Define vertical axis 
ver_axis = maxis(
		axis_orientation	:	"vertical",
		axis_title_text	:	"an_depar (K)",
		axis_tick_interval	:	0.5,
		axis_minor_tick	:	"on",
		axis_minor_tick_count	:	4,
		axis_grid	:	"on",
		axis_grid_colour	:	"black",
		axis_grid_line_style	:	"dot"
		)

#Define Catresian view
scatter_view = cartesianview(
		x_min	:	-1,
		x_max	:	1,
		y_min	:	-1,
		y_max	:	1,
		subpage_y_position	:	12.5,
		subpage_y_length	:	75,
		horizontal_axis	:	hor_axis,
		vertical_axis	:	ver_axis
		)

#Plot
plot(scatter_view,scatter_plot,scatter_symbol,title)