Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to put wind field into minput? #18

Open
NMC-DAVE opened this issue Aug 21, 2019 · 3 comments
Open

How to put wind field into minput? #18

NMC-DAVE opened this issue Aug 21, 2019 · 3 comments

Comments

@NMC-DAVE
Copy link

NMC-DAVE commented Aug 21, 2019

Hi,
I want to plot wind flags with data fields. But I can not find the examples which show how to put data filed into minput, just like:

  data =  magics.minput(
        input_type = "geographical",
        input_x_component_field = uwind_field,    # 2D array, [nlat, nlon]
        input_y_component_field = vwind_field,    # 2D array, [nlat, nlon]
        input_latitude_list = lat,         # 1D vector
        input_longitude_list = lon,     # 1D vector
        input_metadata = metadata)

but this is not working. Very thanks!

Dave

@sylvielamythepaut
Copy link
Contributor

To plot wind with minput, Magics needs 4 1D vectors. (x, y, lat, lon)

input_x_component_field and input_y_component_field are 1D vectors with the u and v components of the winds.
I hope this helps
Sylvie

@NMC-DAVE
Copy link
Author

Sylvie,
Thanks for your help. Now I can put vector data in to minput:

  return magics.minput(
        input_type = "geographical",
        input_x_component_values = uwind_field,    # 1D nlon x nlat vector
        input_y_component_values = vwind_field,    # 1D nlon x nlat vector
        input_latitude_values = lat,    # 1D nlon x nlat vector
        input_longitude_values = lon,    # 1D nlon x nlat vector
        input_metadata = metadata)

But when i plot the wind field, the "wind_thinning_factor" is not working.

# Defining Wind plotting
wind_flags = magics.mwind(
    legend                  = 'off',
    wind_field_type         = 'flags',
    wind_flag_length        = 1.0,
    wind_thinning_factor    = 5.,
    wind_flag_calm_below    = 0.5,
    wind_flag_calm_indicator = 'off',
    wind_flag_thickness = 1,
    wind_flag_origin_marker = "circle",
    wind_flag_colour        = 'chestnut')

Thanks very much!

@sylvielamythepaut
Copy link
Contributor

Yes, you are right, the wind thinning factor is only working when using GRIB or NetCDF data.
We could implement it , in the meantime you can subsample your vectors .. I think lat[start:end:step] should work.

Sylvie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants