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
streamlines #269
Comments
did it broke recently? |
@doutriaux1 Try setting gm.startseed to be inside the domain. |
that did it! st.startseed = [-100,0,0] @danlipsa we should default it to None and manually pick a point inside the domain |
@danlipsa it's probably worth explaining in your notebook tutorial |
I still don't get any streamlines. import cdms2
import vcs
f1=cdms2.open('uas_6hr_reanalysis_CFSR_1998010100-1998123118.nc')
f2=cdms2.open('vas_6hr_reanalysis_CFSR_1998010100-1998123118.nc')
u=f1('uas',time=('1998-10-27','1998-10-29'),lat=(12,16),lon=(-96,-82))
v=f2('vas',time=('1998-10-27','1998-10-29'),lat=(12,16),lon=(-96,-82))
#u=f1('uas',time=('1998-10-27','1998-10-29'))
#v=f2('vas',time=('1998-10-27','1998-10-29'))
x=vcs.init()
gm=x.createstreamline()
gm.evenlyspaced = False # only available on releases after 2.10 or on the nightly packages.
# streamlines are colored by vector magnitude
gm.coloredbyvector = True
# We want 10 glyphs(arrows) per streamline
gm.numberofglyphs = 10
gm.filledglyph = True
# we place 400 random seeds in a circle that covers the data. This means fewer seeds will be inside the data.
# The number of seeds inside the data will result in streamlines.
gm.numberofseeds = 400
gm.evenlyspaced = True # only available only on releases > 2.10 or on the nightly packages
# We want the streamline to be about one cell apart from each other
gm.separatingdistance = 1
# The seed for the first streamline. All other seeds are generated automatically
gm.startseed = [-90, 0, 0]
# create an evenly spaced streamline plot
x.plot(u, v, gm, bg=1) |
@potter2 you need to get a pint within your domain |
got it. Thanks now it works |
@doutriaux1 None for startseed is a good idea. This way I can leave the value as is if the user sets it. We should do that. |
... If the value is None, we ca set it in the middle of the domain. |
which colormap are you using? is it an "old" vcs colormap with reserved colors from 240 to 256? if so import vcs
vcs.utils.defaultColorRange = range(16,240) |
Yes, the old one,. this doesn't work, I still get the blank on each end sorry to be so dense on this: u.units='mph' gm=x.createstreamline() streamlines are colored by vector magnitudegm.coloredbyvector = True We want 10 glyphs(arrows) per streamlinegm.numberofglyphs = 10 we place 400 random seeds in a circle that covers the data. This means fewer seeds will be inside the data.The number of seeds inside the data will result in streamlines.gm.numberofseeds = 400 We want the streamline to be about one cell apart from each othergm.separatingdistance = 1 The seed for the first streamline. All other seeds are generated automaticallygm.startseed = [-90.0, 14.0, 0] create an evenly spaced streamline plotx.plot(u, v, gm, bg=1,continents=4,ratio="auto") |
I'm trying to make a notebook that someone could use to look at local wind (streamlines) at the time of a hurricane eg. the 1998 Honduras hurricane |
@doutriaux1 Not sure what is wrong here. |
having a default to |
Oh, yes. Now I remember. Thanks! |
The text was updated successfully, but these errors were encountered: