<jupyter_start><jupyter_text>Magics 4.11.0 ( Released 03/03/2022)<jupyter_code>from Magics import macro as magics<jupyter_output><empty_output><jupyter_text>User defined coastlinesIn Magics there is a possibility for the user to use her own set of shapefiles as coastlines. In this version, we added a parameter **map_user_layer_land_colour**(*Default:NONE*). If given a colour , the user coastlines will be filled.<jupyter_code>map = magics.mmap(
subpage_map_projection = 'cylindrical',
subpage_lower_left_longitude = -61.4,
subpage_lower_left_latitude = -63.25,
subpage_upper_right_longitude = -59.6,
subpage_upper_right_latitude = -62.0,
)

coast = magics.mcoast(
map_coastline = "off",
map_user_layer = 'on',
map_user_layer_name = 'data/user-coastlines/GSHHS_f_L5',
map_user_layer_land_colour = 'grey',
map_user_layer_colour = 'charcoal',
map_user_layer_thickness = 5
)

magics.plot(map,coast)<jupyter_output><empty_output><jupyter_text>Observations Templating Magics allows users to define a XML template to display observations-like information.The template describes how to position the information. Users is able to pass a json object as observation, and Magics will use the template to position the different items of the observation.<jupyter_code>with open("data/obs-template/obs.template") as f:
    template = f.readlines()
for l in template:
    print(l)
import json

projection = magics.mmap(
    subpage_x_length=24.0,
    subpage_upper_right_longitude=50.00,
    subpage_upper_right_latitude=65.00,
    subpage_lower_left_latitude=25.00,
    subpage_lower_left_longitude=-20.0,
    subpage_map_projection="cylindrical",
)

coastlines = magics.mcoast()

observations = {"type": "guan_plot",
        "identifier": "station1",
        "freq00": 4.,
        "gross00": 6.,
        "freq06": 6.,
        "gross06":0.,
        "freq12": 12.,
        "gross12": 12.,
        "freq18": 18.,
        "gross18": 18.,
        "longitude": 20,
        "latitude": 50}

obs = magics.mobs(
    obsjson_info_list=[
       json.dumps(observations)
    ],
    obs_template_file_name="data/obs-template/obs.template",
    obs_size=0.6,
    obs_ring_size=0.2,
    obs_distance_apart=0.0,
)
title = magics.mtext(
    text_lines=["Observation plotting using template ..."],
    text_justification="left",
    text_font_size=1.5,
    text_colour="charcoal",
)

magics.plot(projection, coastlines, obs, title)<jupyter_output><empty_output><jupyter_text>LineString in GeoJSon Magics is now supporting the feature **Linestring** from the [GeoJSON](https://geojson.org/) format.<jupyter_code>background = magics.mcoast( map_coastline_sea_shade_colour= 'white',
                     map_coastline_land_shade_colour= 'grey',
                     map_grid= 'off',
                     map_coastline_land_shade= 'on',
                     map_coastline_sea_shade= 'on',
                     map_label= 'off',
                     map_coastline_colour= 'charcoal')

fronts =  magics.mgeojson( geojson_input_filename = 'data/linestring.geojson',)
red = magics.mline(polyline_line_colour = "red", polyline_line_thickness = 4)


title = magics.mtext(text_lines = ["<font size='1'>GeoJSon LineString</font>",],
	      text_justification = 'left',
	      text_font_size = 0.8,
	      text_colour = 'charcoal')

magics.plot(background, fronts, red, title)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11236623067776456, 'fraction_numerical': 0.0267538644470868, 'mean_word_length': 3.9851851851851854, 'pattern_counts': {'":': 12, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '347867', 'license': 'Apache-2.0', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1157, 'n_words': 235, 'path': 'visualisation/releases/magics-4.11.0.ipynb', 'repo_name': 'ecmwf/notebooks', 'size': '3364'}