Commit 3682e23f authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

fix bug on kx,ky computed as integer instead of real git status

parent 24dafb28
......@@ -215,10 +215,10 @@ class C2dplot:
y (y axis pos)
"""
to = time.clock()
kx = (w - 1) / (x1 - x0) # scale on x according to the windows width
ky = (h - 1) / (y1 - y0) # scale on y according to the windows height
kx = (w - 1.) / (x1 - x0) # scale on x according to the windows width
ky = (h - 1.) / (y1 - y0) # scale on y according to the windows height
if self.__vdebug:
print ("sigma r=",r,file=sys.stderr)
print ("sigma r=",r," kx,ky",kx,ky,file=sys.stderr)
#r=10
border = 0#r
imgw = int(w + 2 * border) # !!!!! INT
......@@ -439,11 +439,13 @@ class C2dplot:
if ok:
# get data
ok,rho=uns.getData(comp,"rho") # rho
if ( ok!=True) :
rho=np.ones(pos.size)
if not ok:
rho=np.ones(pos.size/3)
# get data
ok,mass=uns.getData(comp ,"mass") # gas density
if not ok:
mass=np.ones(pos.size/3)
# reshape array in x,y,z arrays
pos=np.reshape(pos,(-1,3)) # pos reshaped in a 2D array [nbody,3]
......@@ -507,6 +509,9 @@ class C2dplot:
view_xmin = xmin
view_xmax = xmax
if self.__vdebug and x.size > 0 and y.size > 0:
print("view xmin/xmax, ymin,ymax",xmin,xmax,ymin,ymax,file=sys.stderr)
print("data xmin/xmax, ymin,ymax",x.min(),x.max(),y.min(),y.max(),file=sys.stderr)
# get visible data points
xlvis = x
ylvis = y
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment