Debian Codegraph @

docs/confluence/contour/contour2.py

raw
1 # (C) Copyright 1996-2016 ECMWF.
2 #
3 # This software is licensed under the terms of the Apache Licence Version 2.0
4 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 # In applying this licence, ECMWF does not waive the privileges and immunities
6 # granted to it by virtue of its status as an intergovernmental organisation nor
7 # does it submit to any jurisdiction.
8
9
10 #importing Magics module
11 from Magics.macro import *
12
13
14 ref = 'contour2'
15 #Setting of the output file name
16 output = output(output_formats = ['png'],
17 output_name_first_page_number = "off",
18 output_name = ref)
19
20 #Setting the coordinates of the geographical area
21 projection = mmap(subpage_map_projection = 'cylindrical')
22
23
24 #Coastlines setting
25 coast = mcoast( map_grid = "on",
26 map_grid_colour = "tan",
27 map_coastline_land_shade = 'on',
28 map_coastline_land_shade_colour = 'cream',
29 map_coastline_colour = "tan")
30
31
32 #Import the z500 data
33 z500 = mgrib(grib_input_file_name = "z500.grb",
34 grib_id = "z500")
35
36
37 #Define the simple contouring for z500
38 z500_contour = mcont( legend = "off",
39 contour_level_selection_type = "interval",
40 contour_interval=4.,
41 contour_line_colour = "evergreen",
42 contour_line_style = "dash",
43 contour_line_thickness = 2,
44 contour_label = "on",
45 contour_label_colour = "navy",
46 contour_label_height = 0.5,
47 contour_highlight_frequency=5,
48 contour_highlight_colour = "navy",
49 contour_highlight_thickness = 2 )
50
51
52
53
54
55 title = mtext(
56 text_lines = ["<font size='1'>More line options...</font>",
57 "<font colour='evergreen'>contour_level_selection_type = interval</font> ",
58 " uses a given contour interval using the <font colour='evergreen'>contour_reference_level</font> as reference"],
59 text_justification = "left",
60 text_font_size = 0.8,
61 text_colour = "charcoal")
62
63
64 #To the plot
65 plot(output, projection, coast, z500, z500_contour, title)
66
67 #For documentation only
68 tofortran(ref, output, projection, coast, z500, z500_contour, title)
69 tomv4(ref, z500_contour)
70 tohtml(ref, z500, z500_contour)
71
72
73
74
75
76
77
78
79
80
81
82
83
84