Hi, Everybody!
Does anyone out there have a technique for getting the variance out of
a profile object? A profile object is good at getting <X> vs. B, I'd
then like to get < (X - <X>)^2 > vs B. Matt and I had spittballed the
possibility some time ago, but I was wondering if anyone out there had
successfully done it.
Thanks,
d.
--
Sent from my computer.
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot
from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of
a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called
cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center")
normal = cylinder.get_field_parameter("normal")
image_width = (100,"kpc")
three_image_width = YTArray((image_width[0], image_width[0],
image_width[0]),image_width[1])
left = center - image_width
right = center + image_width
region = shot.region(center, left, right)
proj =
yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof =
yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None
)
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source,
bin_fields, fields, n_bins, extrema, logs, units, weight_field,
accumulation, fractional)
1304 else:
1305 raise NotImplementedError
-> 1306 bin_fields = data_source._determine_fields(bin_fields)
1307 fields = data_source._determine_fields(fields)
1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute
'_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection
works, if I provide weights=None as a keyword argument within the
ProjectionPlot object, I get a surface density (g/cm^2). But also a
"cylindrical_r" in cm^2 as well. I *think* the way to get around this is to
do another projection where weights="ones", get the radius values out of
that profile.. and then in matplotlib, useing the surface density array
from the former profile, and the radius bin array from the latter...
Produce a plot of the surface density as a function of radius from those
two arrays (I might check by hand afterwards to see if this does the
trick). This seems kinda convoluted so I am wondering if there is an easier
way than this.
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Dear yt users,
I’m trying to write a script to create different multi-grid figures with in each the slice plot of one quantity from different snapshots (e.g. density slice for the snapshot from 1 to 4, see example below).
density_snapshot_1 | density_snapshot_2
________________ |_________________
|
density_snapshot_3 | density_snapshot_4
I’m able to do it looping first over the quantities and for each open the snapshots, but in they way I’m reopening the snapshots several times (i.e. the number of quantities I want to plot).
I think that the smart way of doing it is to have the for loops as below.
My problem is that I need to create and save the figures at the "same time" and not one after the other.
I tried several option using the ‘field’ index, but I end up saving only the last ‘field’ figure.
Any suggestion?
Thanks,
Nicola Clementel
snapshots = ['./snapshot_001','./snapshot_002','./snapshot_003','./snapshot_004’]
fields = [‘density’, ‘velocity’, ’temperature’]
for i, snapshot in enumerate(snapshots):
ds = yt.GadgetDataset(fn, unit_base=unit_base, bounding_box=bbox) # load data
for j, field in enumerate(fields):
p = yt.SlicePlot(ds, 'z', field, center="center", width=2)
p.set_cmap(field, "gist_rainbow")
# This forces the SlicePlot to redraw itself on the AxesGrid axes.
# need to differentiate between figures using j index here
plot = p.plots[field]
plot.figure = plt.figure()
plot.axes = grid[i].axes
plot.cax = grid.cbar_axes[i]
# Finally, this actually redraws the plot.
p._setup_plots()
for j, field in enumerate(fields):
#need to call the different figures with j index here
plt.savefig(field +’_evolution.png')
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi all,
I'm sure I've just overlooked some bit of documentation, but I'm having
trouble plotting particles generated by FLASH on top of the gas density.
I've been able to load a plot file with the associated particle file via
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density")
p.annotate_particles(1.0) # ValueError!
# p.annotate_particles((4.0, 'kpc')) # ValueError!
I get a ValueError from h5py indicating that zero-length selections are not
allowed. I have also tried passing the full width of the simulation domain
to the annotation function without success. I suspect that this is a user
error stemming from differences between the way that Enzo and FLASH store
particle data. However, I can't find much in the way of documentation or
examples for the FLASH particle data format.
Of course, it would also be handy to be able to write my own analysis
scripts using both gas and particles, but for now, I'll settle for any help
I can get on simple plotting functionality.
Thanks,
Jason Galyardt
Department of Physics and Astronomy
University of Georgia
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi together,
I want to use yt for plotting magnetic field lines in FLASH simulations
from 2D simulations and slices from 3D simulations.
An example of what it could look like can be seen here:
http://aprg.mae.ufl.edu/wp-content/uploads/2014/07/tang_51.png
I tried to use yt's streamline function, but this does not work for me:
http://yt-project.org/doc/visualizing/streamlines.html
The error shown is:
ValueError: operands could not be broadcast together with shapes (9,9,2)
(9,9,95) (9,9,2)
The used FLASH file is attached.
Thanks a lot
Dominik
--
Dominik Derigs
I. Physikalisches Institut
Universität zu Köln
Zülpicher Straße 77
50937 Köln
GERMANY
Tel. (+49|0) 221 470-8352
Fax. (+49|0) 221 470-5162
Diese Email ist vertraulich und nur für den angegebenen Empfänger bestimmt.
Zugang, Freigabe, die Kopie, die Verteilung oder Weiterleitung durch jemand
anderen außer dem Empfänger selbst ist verboten und kann eine kriminelle
Handlung sein. Bitte löschen Sie die Email, wenn Sie sie durch einen Fehler
erhalten haben und informieren Sie den Absender.
This email and any files transmitted with it may contain confidential
and/or privileged material and is intended only for the person or entity to
which it is addressed. Any review, retransmission, dissemination or other
use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you
have received this email in error, please notify the sender immediately and
delete this material from all known records.
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi yt users,
I have a few questions regarding to density and velocity field.
I try to make the 3-dimension dark matter and baryon density and
velocity fields from enzo simulation.
In order to use SPH/CIC smoothing, I tried to use ('deposit',
'Dark_Matter_cic') for enzo dark matter, and it does not work.
What is particletype for Dark Matter density and velocity in enzo?
After making the density field, I would like to deposit the density
for fixed grid cube.
I knew the FixedResolutionBuffer, that does a similar thing for 2D,
but I can not find 3D version of the similar object.
Is there any such object (uni-grid Buffer) for 3D?
Lastly, I try to use the dark matter velocity arrow with
annotate_velocity(), but it looks to me that the annotation only works
for gas,
because it does not have any argument distinct field type.
How can I plot the dark matter (or particle in general) velocity arrow in yt?
Thank you in advance,
Junhwan
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hello everbody,
I forked and cloned the repo on bitbucket and am now trying to install yt using the install script. Unfortunately I keep running into trouble:
The installation runs fine until:
Installing PNG
Installing FreeType2
Installing SQLite3
Installing Python. This may take a while, but don't worry. yt loves you.
Installing mercurial-3.1
Setting YT_DIR=/home/beckmann/soft/yt
Installing distribute
at which point it exits with
********************************************
FAILURE REPORT:
********************************************
return self.parent.open(new, timeout=req.timeout)
File "/home/beckmann/soft/yt/yt-x86_64/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/home/beckmann/soft/yt/yt-x86_64/lib/python2.7/urllib2.py", line 427, in _open
'unknown_open', req)
File "/home/beckmann/soft/yt/yt-x86_64/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/home/beckmann/soft/yt/yt-x86_64/lib/python2.7/urllib2.py", line 1247, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib2.URLError: <urlopen error unknown url type: https>
********************************************
********************************************
I have tried installing distribute manually but I immediately run into the same error with the next package so that is not a solution.
This website suggests that the issue is that SSL is not supported: http://www.xinotes.net/notes/note/628/ <http://www.xinotes.net/notes/note/628/> and I need to recompile python with SSL? How do I do that in this context? Is there another solution? I do not have root access on this machine.
Thank you,
Ricarda
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Dear yt-ers, as many of us teach and train students (or are students),
I wanted to draw attention to a new project that I've been working on,
the Open Astrophysics Bookshelf. Essentially it is just a github
organization where open (CC-licensed) astro texts can be hosted as git
repos. The idea is that many of us have our own set of notes, with
varying degrees of polish, and by hosting the latex source on github,
we can invite other contributors to add to the notes. This would also
enable the community to crowdsource new texts of interest to our
field, and free us all up from reinventing the wheel.
And since everything is openly licensed, anyone can create mash-ups of
the content to suit their needs. I have a project page up here where
you can read some initial ideas:
http://open-astrophysics-bookshelf.github.io/
I've already moved my set of notes on Computational Astrophysical
Hydrodynamics there and I've contacted several of our colleagues about
hosting their own course notes/texts there as well---hopefully once
summer hits, we'll see some new stuff.
There is an empty template for a Scientific Computing Cookbook to
share tips/techniques and good practices across our field---this
latter one is a case where crowdsourcing can hopefully put something
nice together. Many people I've spoken to in our field have noted the
need for some instructions on computing to new grad students.
The way I envision things working is that a book would have a lead
author (or authors) who are responsible for the overall flow, tone, etc.,
and as many contributing authors as want to help out, all of whom would
be listed on an author page (and, of course, in the git history).
Anyway, that's my ad---if contributing to community-sourced texts or
opening up something you've already written for a class interests
you, then I hope that you will help out.
--
Michael Zingale
Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
11794-3800
*phone*: 631-632-8225
*e-mail*: Michael.Zingale(a)stonybrook.edu
*web*: http://www.astro.sunysb.edu/mzingale
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hello yt-users,
I saw a yt presentation at the Python Astronomy Meeting and am interested to see if yt could be used for non-spatial data. My specific problem is MCMC chains in 19 (or up to 23) dimensional parameter space in which none of the parameters are nuisance parameters. I thought yt could be used to visualize and analyze such data. I tried to load the chain as particles and managed to do so, but am having problems plotting. I pasted the code below.
Has anyone used yt for non-spatial data?
Cheers,
Carolin
-----------
In [81]: mcchain.keys() ## a dictionary containing dimensions of the chain
Out[81]:
['particle_position_z',
'particle_mass',
'particle_position_x',
'particle_position_y',
'qso']
In [82]: mcyt = yt.load_particles(mcchain)
yt : [INFO ] 2015-04-23 09:47:39,235 Parameters: current_time = 0.0
yt : [INFO ] 2015-04-23 09:47:39,235 Parameters: domain_dimensions = [2 2 2]
yt : [INFO ] 2015-04-23 09:47:39,237 Parameters: domain_left_edge = [ 0. 0. 0.]
yt : [INFO ] 2015-04-23 09:47:39,237 Parameters: domain_right_edge = [ 1. 1. 1.]
yt : [INFO ] 2015-04-23 09:47:39,238 Parameters: cosmological_simulation = 0.0
In [83]: circle = mcyt.sphere([0.5, 0.5, 0.5], 0.25)
yt : [INFO ] 2015-04-23 09:47:45,741 Allocating for 1.000e+04 particles
yt : [INFO ] 2015-04-23 09:47:45,763 Identified 7.130e+02 octs
yt : [INFO ] 2015-04-23 09:47:45,897 Loading field plugins.
yt : [INFO ] 2015-04-23 09:47:45,898 Loaded angular_momentum (8 new fields)
yt : [INFO ] 2015-04-23 09:47:45,898 Loaded astro (15 new fields)
yt : [INFO ] 2015-04-23 09:47:45,898 Loaded cosmology (22 new fields)
yt : [INFO ] 2015-04-23 09:47:45,899 Loaded fluid (64 new fields)
yt : [INFO ] 2015-04-23 09:47:45,900 Loaded fluid_vector (96 new fields)
yt : [INFO ] 2015-04-23 09:47:45,900 Loaded geometric (112 new fields)
yt : [INFO ] 2015-04-23 09:47:45,900 Loaded local (112 new fields)
yt : [INFO ] 2015-04-23 09:47:45,901 Loaded magnetic_field (120 new fields)
yt : [INFO ] 2015-04-23 09:47:45,901 Loaded my_plugins (120 new fields)
yt : [INFO ] 2015-04-23 09:47:45,901 Loaded species (122 new fields)
In [84]: pl=yt.ProjectionPlot(circle, 'x', 'y')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-84-685c784708ec> in <module>()
----> 1 pl=yt.ProjectionPlot(circle, 'x', 'y')
/Users/cvillforth/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/yt/visualization/plot_window.pyc in __init__(self, ds, axis, fields, center, width, axes_unit, weight_field, max_level, origin, fontsize, field_parameters, data_source, method, proj_style, window_size, aspect)
1212 self.ts = ts
1213 ds = self.ds = ts[0]
-> 1214 axis = fix_axis(axis, ds)
1215 # proj_style is deprecated, but if someone specifies then it trumps
1216 # method.
/Users/cvillforth/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/yt/funcs.pyc in fix_axis(axis, ds)
649
650 def fix_axis(axis, ds):
--> 651 return ds.coordinates.axis_id.get(axis, axis)
652
653 def get_image_suffix(name):
AttributeError: 'YTSphere' object has no attribute 'coordinates'
--------------------------------------------------------------------------------
Dr Carolin Villforth
SUPA Advanced Fellow
University of St Andrews (SUPA)
School of Physics & Astronomy
North Haugh, St Andrews, Fife
KY16 9SS
UK
cv21(a)st-andrews.ac.uk
Office: 272
phone +44 (0) 1334 46 1612
http://www-star.st-and.ac.uk/~cv21/cv21/Home.html
--------------------------------------------------------------------------------
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org