Versions Compared

Key

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

...

Section
Column
width50%
Info
titleParameters to check

 
Useful subpage parameters

 

subpage_lower_left_longitude

subpage_lower_left_latitude
subpage_upper_right_longitude
subpage_upper_right_latitude
Code Block
themeConfluence
languagepython
titlePython - Setting a projection
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step1",
                output_name_first_page_number = "off"
        )
#settings of the geographical area 
area = mmap(subpage_map_projection="cylindrical",
        subpage_lower_left_longitude=-110.,
        subpage_lower_left_latitude=20.,
        subpage_upper_right_longitude=-30.,
        subpage_upper_right_latitude=70.,
    )    
#Using a default coastlines to see the result
plot(output, area, mcoast())
Column
width200px

...

Section
Column
width50%
Info
titleParameters to check

 

 
Useful Coastlines parameters

map_coastline_land_shade

map_coastline_land_shade_colour
map_coastline_colour
map_grid_colour
map_grid_line_style
Code Block
themeConfluence
languagepython
titlePython - Coastlines
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step2",
                output_name_first_page_number = "off"
        )
#settings of the geographical area 
area = mmap(subpage_map_projection="cylindrical",
        subpage_lower_left_longitude=-110.,
        subpage_lower_left_latitude=20.,
        subpage_upper_right_longitude=-30.,
        subpage_upper_right_latitude=70.,
    )     
 #settings of the caostlines
coast = mcoast(map_coastline_land_shade = "on",
      map_coastline_land_shade_colour = "cream",
      map_grid_line_style = "dash",
      map_grid_colour = "grey",
      map_label = "on",
      map_coastline_colour = "grey")
plot(output, area, coast)
Column
width200px

 

 

...

Section
Column
width50%

 

 
Info
titleParameters to check

mgrib action to load the data

grib_input_file_name
mcont action to define a contouring
contour_line_colour
contour_line_thickness
contour_highlight_colour
contour_highlight_thickness
contour_hilo
contour_level_selection_type
contour_interval
legend
contour_legend_text
Code Block
themeConfluence
languagepython
titlePython - Msl Visualisation
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step3",
                output_name_first_page_number = "off"
        )
#settings of the geographical area 
area = mmap(subpage_map_projection="cylindrical",
        subpage_lower_left_longitude=-110.,
        subpage_lower_left_latitude=20.,
        subpage_upper_right_longitude=-30.,
        subpage_upper_right_latitude=70.,
    )     
 #settings of the caostlines
coast = mcoast(map_coastline_land_shade = "on",
      map_coastline_land_shade_colour = "cream",
      map_grid_line_style = "dash",
      map_grid_colour = "grey",
      map_label = "on",
      map_coastline_colour = "grey")
#Loading the msl Grib data
msl = mgrib(grib_input_file_name="msl.grib")
#Defining the controur
contour = mcont(contour_highlight_colour= "black",
                contour_highlight_thickness= 4,
                contour_hilo= "off",
                contour_interval= 5.,
                contour_label= "on",
                contour_label_frequency= 2,
                contour_label_height= 0.4,
                contour_level_selection_type= "interval",
                contour_line_colour= "black",
                contour_line_thickness= 2, 
                legend='on',
                contour_legend_text= "Mean Sea Level Pressure",
            )
plot(output, area, coast, msl, contour)
Column
width200px

 

 

...

Section
Column
width50%
 
Info
titleParameters to check

 

mgrib action to load the data

grib_input_file_name
grib_automatic_scaling
grib_scaling_factor
mcont action to define a contouring
contour_level_selection_type
contour_level_list
contour_shade
contour_shade_method
contour_shade_colour_method
contour_level_selection_type
contour_shade_colour_list
legend
Code Block
themeConfluence
languagepython
titlePython - Use of Shading
collapsetrue
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step4",
                output_name_first_page_number = "off"
        )
#settings of the geographical area 
area = mmap(subpage_map_projection="cylindrical",
        subpage_lower_left_longitude=-110.,
        subpage_lower_left_latitude=20.,
        subpage_upper_right_longitude=-30.,
        subpage_upper_right_latitude=70.,
    )     
 #settings of the caostlines
coast = mcoast(map_coastline_land_shade = "on",
      map_coastline_land_shade_colour = "cream",
      map_grid_line_style = "dash",
      map_grid_colour = "grey",
      map_label = "on",
      map_coastline_colour = "grey")
#definition of the input data
precip = mgrib(grib_input_file_name="precip.grib", 
    grib_automatic_scaling='off', 
    grib_scaling_factor=1000.)
shading = mcont( contour_highlight= "off",
    contour_hilo= "off",
    contour_label="off",
    contour_level_list=[0.5, 2., 4., 10., 25., 50., 100., 250.],
    contour_level_selection_type= "level_list",
    contour_shade= "on",
    contour_shade_method= "area_fill",
    contour_shade_colour_method= "list",
    contour_shade_colour_list= ["cyan", "greenish_blue", "blue", "bluish_purple", "magenta", "orange", "red", "charcoal"],
    legend="on")
    
plot(output, area, coast, precip, shading)
Column
width200px

 

 

...

Section
Column
width50%
Info
titleParameters to check

 

 

Useful legend parameters

legend

legend_display_type
legend_text_colour
legend_text_font_size
Code Block
themeConfluence
languagepython
titlePython - Overlay
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step5",
                output_name_first_page_number = "off"
        )
#settings of the geographical area 
area = mmap(subpage_map_projection="cylindrical",
        subpage_lower_left_longitude=-110.,
        subpage_lower_left_latitude=20.,
        subpage_upper_right_longitude=-30.,
        subpage_upper_right_latitude=70.,
    )     
 #settings of the caostlines
coast = mcoast(map_coastline_land_shade = "on",
      map_coastline_land_shade_colour = "cream",
      map_grid_line_style = "dash",
      map_grid_colour = "grey",
      map_label = "on",
      map_coastline_colour = "grey")
#definition of the input data
precip = mgrib(grib_input_file_name="precip.grib", 
    grib_automatic_scaling='off', 
    grib_scaling_factor=1000.)
#definition of shading
shading = mcont( contour_highlight= "off",
    contour_hilo= "off",
    contour_label="off",
    contour_level_list=[0.5, 2., 4., 10., 25., 50., 100., 250.],
    contour_level_selection_type= "level_list",
    contour_shade= "on",
    contour_shade_method= "area_fill",
    contour_shade_colour_method= "list",
    contour_shade_colour_list= ["cyan", "greenish_blue", "blue", "bluish_purple", "magenta", "orange", "red", "charcoal"],
    legend="on")
#definition of msl
msl = mgrib(grib_input_file_name="msl.grib")
#Definition of the black contouring
contour = mcont( contour_highlight_colour= "black",
                contour_highlight_thickness= 4,
                contour_hilo= "off",
                contour_interval= 5.,
                contour_label= "on",
                contour_label_frequency= 2,
                contour_label_height= 0.4,
                contour_legend_text= "Mean Sea Level Pressure",
                contour_level_selection_type= "interval",
                contour_line_colour= "black",
                contour_line_thickness= 2,
                legend='on'
            )
#Definition of the legend
legend = mlegend(legend='on', 
            legend_display_type='continuous', 
            legend_text_colour='charcoal', 
            legend_text_font_size=0.4,
            )    
plot(output, area, coast, precip, shading, msl, contour, legend)
Column
width200px

 

 

...

Section
Column
width50%
 
Info
titleParameters to check

 

Useful input parameters

input_x_values

input_y_values
Useful Symbol parameters
symbol_colour
symbol_marker_index
symbol_height

symbol_type

symbol_text_list
symbol_text_font_size
symbol_text_font_colour
symbol_text_font_style
symbol_text_position
Code Block
themeConfluence
languagepython
titlePython - Adding New-York City
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step6",
                output_name_first_page_number = "off"
        )

             
#---------------------------------------
# definition of the previsous layers 
# ...
# ...
#---------------------------------------
#definition of New-York city
new_york = minput(
            input_x_values    =    [-74.],
            input_y_values    =    [41.]
            )
#definition of the symbol
point = msymb(
            symbol_type    =    "both",
            symbol_text_list    =    ["NYC"],
            symbol_marker_index    =    28,
            symbol_colour    =    "red",
            symbol_height    =    0.5,
            symbol_text_font_size = 0.40,
            symbol_text_font_colour = "black",
            symbol_text_position = "top",
            symbol_text_font_style = "bold ", 
            )
plot(output, area, coast, precip, shading, msl, contour, new_york, point, legend)
Column
width200px

 

 

...

Section
Column
width50%

 

 
Info
titleParameters to check

Useful input parameters

input_x_values

input_y_values
Useful Graph parameters
graph_line
graph_line_colour
Code Block
themeConfluence
languagepython
titlePython - Adding a line
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step7",
                output_name_first_page_number = "off"
        )

             
#---------------------------------------
# definition of the previous layers 
# ...
# ...
#---------------------------------------
#definition of the Xsection Line
xsection = minput(
            input_x_values    =    [-74.],
            input_y_values    =    [41.]
            )
#definition of the graph
line = mgraph( 
            graph_line_colour    =    "black",
            graph_line_thickness    =    4
            )
plot(output, area, coast, precip, shading, msl, contour, new_york, point, xsection, line, legend)
Column
width200px

 

 

...

Section
Column
width50%
Info
titleParameters to check

 


 

Useful Text parameters

text_lines

text_font_size
text_colour
text_font_style

 

 

Code Block
themeConfluence
languagepython
titlePython - Adding a text
collapsetrue
from Magics.macro import *
#setting the output 
output = output(    
                output_formats = ['png'],
                output_name = "map_step8",
                output_name_first_page_number = "off"
        )

             
#---------------------------------------
# definition of the previous layers 
# ...
# ...
#---------------------------------------
#definition of the text
title = mtext(text_lines=['Sandy', '30th of October 2012'],
            text_font_size = 0.8,
            text_colour= "charcoal",
            text_font_style='bold',
        )
plot(output, area, coast, precip, shading, msl, contour, new_york, point, xsection, line, legend, title)
Column
width200px