Mailman 3 python.org
Sign In
Sign Up
Manage this list
Sign In
Sign Up
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
yt-users
Thread
Start a new thread
Download
Threads by
month
----- 2025 -----
February
January
----- 2024 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2023 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2022 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2021 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2020 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2019 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2018 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2017 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2016 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2015 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2014 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2013 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2012 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2011 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2010 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2009 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2008 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2007 -----
December
yt-users@python.org
September 2009
4 participants
1 discussions
Problem with zlim setting in yt slices
by Fen Zhao
Sept. 15, 2009
Sept. 15, 2009
Hi all, I've recently been having problems setting the colorbar max and min in yt, and would appreciate some help figuring out what the problem might be. Full python code attached at the end, but the important parts are: pf=lagos.EnzoStaticOutput(thefile) pc = PlotCollection(pf, center=[c1, c2, c3]) plot1=pc.add_slice("B", 0) plot2=pc.add_slice("Density", 0) plot3=pc.add_slice("Velocity_Vorticity1", 0) plot3.set_log_field(False) plot3.set_zlim(-200, 500) thefile2=(output %
…
[View More]
ind) +"large" pc.save(thefile2) plot1.set_width(haloradius*2,1) plot2.set_width(haloradius*2,1) plot3.set_width(haloradius*2,1) plot3.set_log_field(False) plot3.set_zlim(-200, 500) thefile2=(output % ind) + "halo" pc.save(thefile2) Neither the "large" or "halo" have the colorbar set correctly. Cheers, Fen Context of code: import sys sys.path = ["/usr/work/mturk/local-testing/lib/python2.5/site-packages/"] + \ sys.path from yt.config import ytcfg; ytcfg["lagos","serialize"] = "False" from yt.mods import * #import yt.lagos as lagos #import yt.raven as raven #import os.path def write_out_binned_vals(plot, fn): vals = plot.vals x = plot.x_bins y = plot.y_bins print "Opening",fn, vals.shape, x.shape, y.shape f=open(fn,"w") for i in range(x.shape[0]): for j in range(y.shape[0]): print i,j f.write("%0.5e\t%0.5e\t%0.5e\n" % (x[i],y[j],vals[i,j])) f.close() #ind=71 #inputDir="/a/wain027/g.ki.ki01/fenzhao/data/nobackup/vorticity/correct" inputDir="/lustre/ki/orange/fenzhao/vorticity/try2" outputDir="/a/wain027/g.ki.ki01/fenzhao/data/nobackup/vorticity/analysis/slices/data/images/other" outputName="lustreversion" start=40 end=40 ind=start while ind<=end: thefile= inputDir + "/star_%04i.dir/star_%04i" % (ind,ind) output= outputDir + "/" + outputName+ "%04i" pf=lagos.EnzoStaticOutput(thefile) timeUnits=pf["years"] DensityUnits=pf["Density"] LengthUnits=pf["cm"] VelocityUnits=pf["x-velocity"] newred=pf["CosmologyCurrentRedshift"] a=1/(1+newred) k=1.3806503e-16 c=2.99792e10 e=4.8032068e-10 me=9.1093897e-28 mh=1.66053886e-24 pressure=k*(DensityUnits/mh) density=DensityUnits/mh graddensity=density/LengthUnits gradpressure=pressure/LengthUnits bbunits=(c/e)*graddensity*gradpressure/(density**2) vorticityUnits=VelocityUnits/LengthUnits alpha=mh*c/e/(1+1e-4) def Vorticity(field,data): return (((data["Velocity_Vorticity1"]**2)+(data["Velocity_Vorticity2"]**2)+(data[" Velocity_Vorticity3"]**2))**0.5)*vorticityUnits lagos.add_field("Vorticity", units=r"\rm{s}^{-1}",function=Vorticity) import numpy as na def B(field, data): return na.clip(alpha*(data["Vorticity"]),1e-30,1e30) lagos.add_field("B", units=r"\rm{Gauss}", function=B) haloradius=0.013 halo = pf.h.sphere([0.5, 0.5, 0.5], haloradius*2.0) v, i, c1, c2, c3, gi = halo.quantities["MaxLocation"]("Density", lazy_reader=True) pc = PlotCollection(pf, center=[c1, c2, c3]) plot1=pc.add_slice("B", 0) plot2=pc.add_slice("Density", 0) plot3=pc.add_slice("Velocity_Vorticity1", 0) plot3.set_log_field(False) plot3.set_zlim(-200, 500) thefile2=(output % ind) +"large" pc.save(thefile2) plot1.set_width(haloradius*2,1) plot2.set_width(haloradius*2,1) plot3.set_width(haloradius*2,1) plot3.set_log_field(False) plot3.set_zlim(-200, 500) thefile2=(output % ind) + "halo" pc.save(thefile2) ind=ind+1 #plot=pc.add_slice("B", 0)
[View Less]
4
7
0
0
Results per page:
10
25
50
100
200