ecmwf / magics-python

Python interface to Magics meteorological plotting package
Apache License 2.0
49 stars 12 forks source link

mcont using U/V wind component #32

Closed HugoDerave closed 3 years ago

HugoDerave commented 3 years ago

Hey, I'm trying to make a wind speed map using the U and V wind components coming from the same grib file. I had no problem making one using mwind, but If I'm not mistaken I can only plot flags/streamlines/arrows using this one. I tried the same kind of code replacing mwind with mcont, but the output only seems to either take the U component or the V component.

I'm using this to open the grib file: uv = mgrib(grib_input_file_name = "SP1.grib2", grib_wind_mode = "uv", grib_wind_position_1 = 97, grib_wind_position_2 = 98, grib_automatic_scaling='off', grib_scaling_factor=3.6, )

Plotting using mwind: wgust_shade = mwind(wind_arrow_unit_system= "automatic", wind_arrow_unit_velocity= 10.0, wind_field_type= "Flags", wind_flag_colour= "black", wind_flag_length= 0.3, wind_flag_origin_marker= "dot", wind_flag_origin_marker_size= 0.1, wind_legend_text= "Black wind flags (in knots)", wind_thinning_factor= 1., wind_thinning_method= "automatic", contour_hilo= "off", legend = "on", wind_advanced_method = "on", wind_advanced_colour_parameter = "speed", wind_advanced_colour_selection_type = "count", wind_advanced_colour_table_colour_method = "calculate" )

And something I tried with mcont: wgust_shade = mcont( contour_level_selection_type= "level_list", contour="off", contour_hilo= "off", contour_label="off", contour_level_list=[0., 5., 10., 15., 20., 25., 30., 35., 40., 45., 50., 55., 60., 65., 70., 75., 80., 85., 90., 95., 100., 105., 110., 115., 120., 125., 130., 135., 140., 145., 150.,], contour_shade= "on", contour_shade_method= "area_fill", contour_shade_colour_method= "palette", contour_shade_palette_name = "eccharts_rainbow_white_grey_30", legend='on', contour_legend_text="Wind test")

Is there a way to get the mcont one working with the actual wind speed, and not only the U or V component ?

Thanks, and sorry if this is not the right place to ask for it!