Debian Codegraph @

regression/symbol/symbol_ww.py

raw symbols SCIP
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 # importing Magics module
10
11 from Magics.macro import *
12
13 ref = 'symbol_ww'
14
15 # Setting of the output file name
16
17 output = output(output_formats=['png', "ps"],
18 output_name_first_page_number='off',
19 output_name=ref)
20
21 # Setting the coordinates of the geographical area
22 # Here we use Europe
23
24 area = mmap(subpage_map_projection='cartesian',
25 subpage_frame='off',
26 subpage_x_max=100.,
27 subpage_x_min=0.,
28 subpage_y_max=120.,
29 subpage_y_min=0.,
30 page_y_length= 21.,
31 subpage_y_length= 21.)
32
33 lines = ['Symbol List', "<font size='0.5'> Present Weather symbols</font>", ""]
34
35 text = mtext(text_lines= lines,
36 text_html= 'true',
37 text_justification= 'centre',
38 text_font_size= 1.,
39 text_colour= 'charcoal',
40 )
41
42 lines2 = ['Symbol List', "<font size='0.5'> Cloud symbols</font>", ""]
43
44 text2 = mtext(text_lines= lines2,
45 text_html= 'true',
46 text_justification= 'centre',
47 text_font_size= 1.,
48 text_colour= 'charcoal',
49 )
50
51 out = []
52
53 for p in range(0,9,2) :
54 out.append(area)
55 #list.append(title)
56 y = 100.
57 x = 30.
58 sizes = [1.,]
59
60 for i in range(0,20) :
61
62 if (i % 10) == 0:
63 y = 100.
64 x += 45.
65
66 if (i % 20) == 0:
67 y = 100.
68 x = 30.
69 out.append(page())
70 out.append(area)
71 out.append(text)
72
73
74 name = "ww_%02d" % ( i + p*10)
75 #print name
76 #symbol = "symbol = %s"% name
77
78 xx = x
79 for size in sizes:
80 title = "symbol = %s"% name
81 # Import the input data
82 out.append(minput(input_x_values=[xx],
83 input_y_values=[y],
84 ))
85
86 # Define the symbol plotting
87 out.append(msymb(
88 legend='off',
89 symbol_type='marker',
90 symbol_colour='evergreen',
91 symbol_height=size,
92 symbol_marker_mode = "name",
93 symbol_marker_name = name,
94 symbol_text_position='left',
95 symbol_text_font_size=0.5,
96 symbol_text_font_colour='black',
97 symbol_text_list=[title],
98 symbol_outline="off",
99 symbol_outline_colour="navy",
100 symbol_outline_thickness=3,
101 ))
102 xx+=15
103 y -= 10.
104 out.append(page())
105
106 #
107 #
108 # C L O U D S ...
109 #
110 out.append(page())
111 out.append(area)
112 out.append(text2)
113
114 xxx=15.
115 clouds = ['N','W','CL','CM','CH','C','a','DS']
116 for c in clouds:
117 for i in range(0,10):
118 name = c+"_%d" % i
119
120 out.append(minput(input_x_values=[xxx],
121 input_y_values=[115.-(i*10.)],
122 ))
123 # Define the symbol plotting
124 out.append(msymb(
125 legend='off',
126 symbol_type='marker',
127 symbol_colour='evergreen',
128 symbol_height=size,
129 symbol_marker_mode = "name",
130 symbol_marker_name = name,
131 symbol_text_position='left',
132 symbol_text_font_size=0.5,
133 symbol_text_font_colour='black',
134 symbol_text_list=[name],
135 symbol_outline="off",
136 symbol_outline_colour="navy",
137 symbol_outline_thickness=3,
138 ))
139 xxx+=10.
140
141
142 # To the plot
143
144 plot( output, out)
145