Closed doutriaux1 closed 6 years ago
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
gm.startseed = [-90, 0, 0]
has a lat of 0 which is outside of your domain
you want
gm.startseed = [-90, 14,0] # [x,y,z]
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.
How do I fix the endpoints of the color bar and the colors? I know this is because of the matplotlib color maps but I just want one of the vcs colormaps.
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: import cdms2 import vcs vcs.utils.defaultColorRange=range(16,240) 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-29','1998-10-29','cob'),lat=(12,24),lon=(-96,-82)) v=f2('vas',time=('1998-10-29','1998-10-29','cob'),lat=(12,24),lon=(-96,-82)) u=u/.44704 v=v/.44704
x=vcs.init() x.setcolormap("rainbow")
u.units='mph'
gm=x.createstreamline() gm.evenlyspaced = False # only available on releases after 2.10 or on the nightly packages.
gm.coloredbyvector = True
gm.numberofglyphs = 10 gm.filledglyph = True
gm.numberofseeds = 400 gm.evenlyspaced = True # only available only on releases > 2.10 or on the nightly packages
gm.separatingdistance = 1
gm.startseed = [-90.0, 14.0, 0]
x.plot(u, v, gm, bg=1,continents=4,ratio="auto")
x.png('/home/potter/Desktop/honduras1.png')
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
@aashish24 @scottwittenburg @danlipsa ping
@doutriaux1 Not sure what is wrong here.
having a default to None
Oh, yes. Now I remember. Thanks!