Skip to content

Better presentation of wind field #6108

Closed

Description

@leeyupeng119

Description of the desired feature
I use grdvector function to plot the wind field, I adjusted -Q and -Si parameters repeatedly, but I couldn't get satisfactory results.

Here is my final code (turn parameters again and again) and output figure,

gmt begin wind2_gmt.png
gmt coast  -JM5i -R75/140/15/55 -Baf -A4000  -W0.25p,black
gmt grdvector u.nc v.nc -Ix5 -Q4p+e+h0.1+n1k -Gblack -W0.5p -Si30k
gmt end

GMT plot

And I did the same thing with NCL (NCAR Command Language), which is a very commonly used software in atmospheric science research. And here's what NCL output,
NCL plot
By comparing the two plots, it can be found that GMT still has some limitations in drawing wind fields, the main limitations are as follows:

  1. Wind direction is not easily discernible in the weak wind speed zone, so you can't see the circulation pattern very well.
  2. There is no feature for automatically generating the legend of the reference vector.

Are you willing to help implement and maintain this feature? Yes

In my opinion, when the wind speed is very small, the stem may disappear, but there should be a certain lower limit for the reduction of the arrow, and the overall shape of the arrow should not be destroyed, so that the wind direction of each grid point can be clearly identified, which is very important in circulation analysis. In the research of meteorology, we pay attention not only to the value of the wind speed but also to the wind direction. Therefore, would you consider adding the features I mentioned above? Thanks in advance.

Maybe I am not good at using grdvector, so I have uploaded the data, welcome you to test and turning.
data_uv.zip

Activity

  1. added
    feature request
    on Dec 11, 2021
  2. welcome commented on Dec 11, 2021

    @welcome

    👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

    Please make sure you read our Contributing Guide and abide by our Code of Conduct.

  3. PaulWessel commented on Dec 11, 2021

    @PaulWessel
    Contributor

    Thanks for this example and the comparison. Having +n be subjected to a minimum shrinking is a good idea that can be implemented. I will play with your data example to see how we can improve the plot. And adding -l for auto-legend is on my mental agenda anyway.

  4. self-assigned this
    on Dec 11, 2021
  5. added this to the milestone on Dec 11, 2021
  6. PaulWessel commented on Dec 11, 2021

    @PaulWessel
    Contributor

    So it looks like the vector head never shrinks in the NCL plot but you could do the same in GMT, no (not using +n)? Aren't you comparing apples and oranges a bit here? Anyway, some possibilities would be to add an optional minimum length to +n so syntax would be +nstart[/stop], so shrinking will begin for vectors shorter than start but only down to stop [0].

    If you want open vector heads like the NCL then you use +eA to change what head you want. So although I have not tried yet, seems like you could make a map very similar to the NCL with GMT if you just select no shrinking and pick the plain vector head.

  7. joa-quim commented on Dec 11, 2021

    @joa-quim
    Member

    NCL vector heads also shrink, but apparently not more then 3 to 4 times.

  8. PaulWessel commented on Dec 12, 2021

    @PaulWessel
    Contributor

    Yes you are right, there are clear differences but where we go to zero they stop shrinking. I agree going to zero makes it impossible to see directions (you just get a point if you are lucky), so we can consider improvements here.

  9. PaulWessel commented on Dec 12, 2021

    @PaulWessel
    Contributor

    Maybe the syntax could be +nnorm[/frac] where default frac = 0 but if given indicates how much smaller than the given vector head size we shall shrink. E.g., a frac of 0.5 means just shrink down to half the size and no further.

  10. joa-quim commented on Dec 12, 2021

    @joa-quim
    Member

    I would even prefer that default frac would be something that still allowed seeing the vector head. This would be a small breaking but we can always call the trick of saying previous behavior was a bug.

  11. PaulWessel commented on Dec 12, 2021

    @PaulWessel
    Contributor

    We can discuss that. I am opening a WIP branch PR that implements the /frac and have an example with some issues to comment on.

  12. PaulWessel commented on Dec 13, 2021

    @PaulWessel
    Contributor

    After fixing the plain geovector and the minimum shrink value, I get stuff like this which is approximating what the NCL does if you prefer such vectors.

    wind2_gmt

  13. PaulWessel commented on Dec 13, 2021

    @PaulWessel
    Contributor

    Hopefully, @leeyupeng119 can play with the revised vector head via +eA and the terminal shrink threshold via +n1k/0.7 (I used 0.7 in the above plot) and give more feedback.

  14. leeyupeng119 commented on Dec 14, 2021

    @leeyupeng119
    Author

    @PaulWessel, It looks awesome and I think this would work well for my needs. Thank you all.

  15. leeyupeng119 commented on Dec 14, 2021

    @leeyupeng119
    Author

    I've downloaded the code of master brunch and compiled it. It works very well for values of the new parameter from 0.7 to 0.9 with the +eA option. But when there is no A, some vector in the weak wind area is a bit strange. The stems ran to the front of the arrows instead of the tail.
    Here is the code and a screenshot of strange zones.

     gmt begin wind2_gmt pdf
     gmt coast  -JM5i -R75/140/15/55 -Baf -A4000  -W0.25p,black
     gmt grdvector u.nc v.nc -Ix5 -Q4p+e+n1k/.9 -Gblack -W0.5p -Si20k
     gmt end
    

    image

  16. PaulWessel commented on Dec 14, 2021

    @PaulWessel
    Contributor

    Thanks, I noticed that too. Will have a look.

  17. gd-a commented on Dec 14, 2021

    @gd-a
    Contributor

    And adding -l for auto-legend is on my mental agenda

    Do you plan on adding an option to define at which latitude the legend takes reference from? Or simply in the middle of the plot ? (I'm more comfortable with the latter)

    Most importantly, will the scaling be applied accordingly from an user-defined value or from a mean ? (I'm more comfortable with the former)

    Thanks @PaulWessel !

  18. maxrjones commented on Dec 28, 2021

    @maxrjones
    Member

    Final issues were fixed by #6161. @leeyupeng119, please comment if you notice any other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions