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.
Dear yt
Can current yt calculate 3-D Mass power spectra? I checked the website but
I didn't find any information. I think calculating 3-D Mass power
spectra is a very useful for cosmological simulations. So I guess maybe yt
supports this function now....?
Thanks in advance
Hello Everyone,
I am a volunteer at Digital NEST, a non-profit high-tech training and
collaboration space for young people. We have been exploring the idea of
using yt as the main focus of a course that will introduce young students
to data visualization, python programming and open source software.
One of our ideas is to contribute to the open issues marked
"new-contributor-friendly" on the yt github. However, we were hoping to
find someone who has a visualization project in mind and would want to
collaborate with us. Maybe you have a data set and want visualizations
produced and don't have the time to create them. We are open to discuss
other projects that are more in-depth and are still focused on data
visualization.
You can find out more about Digital NEST here : http://digitalnest.org/about
/
Thanks,
Alex
Hi all,
I’m attempting to adapt the example script for plotting star formation rates (found at http://yt-project.org/doc/analyzing/analysis_modules/star_analysis.html#sta… <http://yt-project.org/doc/analyzing/analysis_modules/star_analysis.html#sta…>) to work with output data from a simulation run using Enzo. However, when I attempt to run the script, I get the following error:
———————————————————
File "PlotSFR.py", line 26, in <module>
sfr = StarFormationRate(data, star_mass=mass_old, star_creation_time=ct_old, volume=sp.volume())
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/analysis_modules/star_analysis/sfr_spectrum.py", line 115, in __init__
self._ds.quan(1.0, 'Mpccm**3').units
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/yt_array.py", line 1355, in __new__
dtype=dtype, bypass_validation=bypass_validation)
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/yt_array.py", line 430, in __new__
units = Unit(input_units, registry=registry)
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/unit_object.py", line 257, in __new__
unit_data = _get_unit_data_from_expr(unit_expr, registry.lut)
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/unit_object.py", line 572, in _get_unit_data_from_expr
unit_data = _get_unit_data_from_expr(unit_expr.args[0], unit_symbol_lut)
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/unit_object.py", line 566, in _get_unit_data_from_expr
return _lookup_unit_symbol(str(unit_expr), unit_symbol_lut)
File "/usr/local/anaconda/lib/python2.7/site-packages/yt/units/unit_object.py", line 657, in _lookup_unit_symbol
"symbols." % symbol_str)
yt.units.unit_registry.UnitParseError: Could not find unit symbol 'Mpccm' in the provided symbols.
———————————————————
I am using version 3.3.5 of yt.
Does anyone know how I can resolve this? Any suggestions would be greatly appreciated.
Thanks,
Ashley
Hello yt users,
I have tried to save a clump dataset but I'm getting the following error:
*Code:*
*...*
*find_clumps(master_clump, cmin, cmax, step)*
*fn=master_clump.save_as_dataset(fields=["cell_mass",
"total","x","y","z","velocity_x","velocity_y","velocity_z"])*
*print(fn)*
*...*
*Error*
*yt : [INFO ] 2017-09-22 10:34:12,164 Saving field data to yt dataset:
G-0001_clump_0.h5.*
*Traceback (most recent call last):*
* File "Save_Clumps.py", line 43, in <module>*
* master_clump.save_as_dataset(fields=["cell_mass",
"total","x","y","z","velocity_x","velocity_y","velocity_z"])*
* File
"/home/jutreras/miniconda3/lib/python3.6/site-packages/yt/analysis_modules/level_sets/clump_handling.py",
line 365, in save_as_dataset*
* extra_attrs=extra_attrs)*
* File
"/home/jutreras/miniconda3/lib/python3.6/site-packages/yt/frontends/ytdata/utilities.py",
line 149, in save_as_dataset*
* _yt_array_hdf5(fh[field_type], field_name, data[field])*
* File
"/home/jutreras/miniconda3/lib/python3.6/site-packages/yt/frontends/ytdata/utilities.py",
line 208, in _yt_array_hdf5*
* dataset = fh.create_dataset(str(field), data=data)*
* File
"/home/jutreras/miniconda3/lib/python3.6/site-packages/h5py/_hl/group.py",
line 111, in create_dataset*
* self[name] = dset*
* File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
(/home/ilan/minonda/conda-bld/h5py_1496889914775/work/h5py/_objects.c:2846)*
* File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
(/home/ilan/minonda/conda-bld/h5py_1496889914775/work/h5py/_objects.c:2804)*
* File
"/home/jutreras/miniconda3/lib/python3.6/site-packages/h5py/_hl/group.py",
line 276, in __setitem__*
* h5o.link(obj.id <http://obj.id>, self.id <http://self.id>, name,
lcpl=lcpl, lapl=self._lapl)*
* File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
(/home/ilan/minonda/conda-bld/h5py_1496889914775/work/h5py/_objects.c:2846)*
* File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
(/home/ilan/minonda/conda-bld/h5py_1496889914775/work/h5py/_objects.c:2804)*
* File "h5py/h5o.pyx", line 202, in h5py.h5o.link
(/home/ilan/minonda/conda-bld/h5py_1496889914775/work/h5py/h5o.c:3901)*
*RuntimeError: Unable to create link (Name already exists)*
A file G-0001_clump_0.h5 is created but when I try to load the data I get
another error
*----> 1 ds_clumps = yt.load('CLUMPS/G-0001_clump_0.h5')*
*~/miniconda3/lib/python3.6/site-packages/yt/convenience.py in load(*args,
**kwargs)*
* 96 return output_type_registry[n](fn)*
* 97 mylog.error("Couldn't figure out output type for %s",
args[0])*
*---> 98 raise YTOutputNotIdentified(args, kwargs)*
* 99 *
* 100 mylog.error("Multiple output type candidates for %s:",
args[0])*
*YTOutputNotIdentified: Supplied ('CLUMPS/G-0001_clump_0.h5',) {}, but
could not load!*
Cheers!
José Utreras
Hi All,
I'm hoping to modify YT to read in arrays from ActiveParticle fields. I
have an array which is part of the AP data structure. At the moment YT sees
the field but only reads the first element which kinda makes sense.
Just wondering how I can modify the source code so that YT realised that a
field is in fact an array and to read in all the values?
At the moment YT is also complaining with the message:
yt/yt/frontends/enzo/io.py:140: VisibleDeprecationWarning: boolean index
did not match indexed array along dimension 0; dimension is 20 but
corresponding boolean dimension is 1
which is because of course the field is an array of length 20 rather than a
scalar.
Any tips on what is required? I am looking on io.py at the
_read_particle_fields function and I imagine it is this function that needs
modification?
Cheers,
John
Dear yt users,
I am trying to read some AMR data and convert them into 3D array. The test
code:
######################### BEGIN #########################
import yt
from time import time
yt.enable_parallelism()
ds = yt.load("flash_hdf5_plt_cnt_0000")
tstart = time()
cg = ds.covering_grid(level=ds.max_level, left_edge=ds.domain_left_edge,
dims=ds.domain_dimensions*2**ds.max_level)
cg['dens']
if yt_isroot(): print "It takes {0}s".format(time()-tstart)
######################### END #########################
I tried to run to serial or parallel on an interactive session on stampede:
######################### BEGIN #########################
[yclu@ test]$ ls
flash_hdf5_plt_cnt_0000 test.py
[yclu@ test]$ python test.py
It takes 34.0571820736s
[yclu@ test]$ export OMP_NUM_THREADS=68
[yclu@ test]$ python test.py
It takes 33.1969199181s
[yclu@ test]$ export OMP_NUM_THREADS=1
[yclu@ test]$ mpirun -np 68 python test.py
It takes 58.0391800404s
######################### END #########################
The time does not seem to be reduced by parallelism. And multi-process seem
to have huge communication overhead. Is there a way to increase the speed
by parallelism?
Thanks,
Yingchao
Hi People,
I am trying to play around with FITS file format. I want to create an image
from this file which will include data from center to 20 arc minutes. each
pixel is 3x3 arc sec.
*import yt*
*ds = yt.load("signal_wfilt_sn.fits")*
*ds.print_stats()*
*ds.field_list*
*ds.domain_width*
*ds.derived_field_list*
*dd = ds.all_data()*
*dd*
*sp = ds.sphere(ds.domain_center, (400, 'code_length')) # create sphere of
20 arcminutes with 3x3 pixel size*
*sp[("fits", "image_0")]
# check array of data within the sphere*
*#plot 1D histogram of data over pixel*
*pplot = yt.ProfilePlot(sp, "image_0", ["pixel"], weight_field=None,
n_bins=1024, *
*plot_spec=dict(color='red', linestyle="--"), y_log={'pixel':False})*
*pplot.show()*
*# convert data to numpy array*
*import numpy as np*
*image = np.array(sp['image_0'])*
*# create image?*
*imgplot = plt.imshow(image)*
*imgplot*
*plt.show()*
*image*
*The code is failing at this point with error:*
---------------------------------------------------------------------------TypeError
Traceback (most recent call
last)<ipython-input-21-6a83e68fbbf2> in <module>()----> 1 imgplot =
plt.imshow(image) 2 3 imgplot 4 plt.show()
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.pyc
in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax,
origin, extent, shape, filternorm, filterrad, imlim, resample, url,
hold, data, **kwargs) 3155
filternorm=filternorm, filterrad=filterrad, 3156
imlim=imlim, resample=resample, url=url, data=data,-> 3157
**kwargs) 3158 finally: 3159 ax._hold
= washold
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/__init__.pyc
in inner(ax, *args, **kwargs) 1896
warnings.warn(msg % (label_namer, func.__name__), 1897
RuntimeWarning, stacklevel=2)-> 1898
return func(ax, *args, **kwargs) 1899 pre_doc =
inner.__doc__ 1900 if pre_doc is None:
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc
in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin,
vmax, origin, extent, shape, filternorm, filterrad, imlim, resample,
url, **kwargs) 5122 resample=resample,
**kwargs) 5123 -> 5124 im.set_data(X) 5125
im.set_alpha(alpha) 5126 if im.get_clip_path() is None:
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/image.pyc
in set_data(self, A) 598 if (self._A.ndim not in (2, 3) or
599 (self._A.ndim == 3 and self._A.shape[-1] not in
(3, 4))):--> 600 raise TypeError("Invalid dimensions for
image data") 601 602 self._imcache = None
TypeError: Invalid dimensions for image data
I am completely new to image processing, so I am interested to know how you
create image for this type of data in yt. Your help is very appreciated. I
also provided a link to the dataset:
https://www.dropbox.com/s/bftuihqcoun8tny/signal_wfilt_sn.fits?dl=0
Thanks a lot
Tazkera haque
Hi People,
I am trying to play around with FITS file format. I want to create an image
from this file which will include data from center to 20 arc minutes. each
pixel is 3x3 arc sec.
*import yt*
*ds = yt.load("signal_wfilt_sn.fits")*
*ds.print_stats()*
*ds.field_list*
*ds.domain_width*
*ds.derived_field_list*
*dd = ds.all_data()*
*dd*
*sp = ds.sphere(ds.domain_center, (400, 'code_length')) # create sphere of
20 arcminutes with 3x3 pixel size*
*sp[("fits", "image_0")]
# check array of data within the sphere*
*#plot 1D histogram of data over pixel*
*pplot = yt.ProfilePlot(sp, "image_0", ["pixel"], weight_field=None,
n_bins=1024, *
*plot_spec=dict(color='red', linestyle="--"), y_log={'pixel':False})*
*pplot.show()*
*# convert data to numpy array*
*import numpy as np*
*image = np.array(sp['image_0'])*
*# create image?*
*imgplot = plt.imshow(image)*
*imgplot*
*plt.show()*
*image*
*The code is failing at this point with error:*
---------------------------------------------------------------------------TypeError
Traceback (most recent call
last)<ipython-input-21-6a83e68fbbf2> in <module>()----> 1 imgplot =
plt.imshow(image) 2 3 imgplot 4 plt.show()
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.pyc
in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax,
origin, extent, shape, filternorm, filterrad, imlim, resample, url,
hold, data, **kwargs) 3155
filternorm=filternorm, filterrad=filterrad, 3156
imlim=imlim, resample=resample, url=url, data=data,-> 3157
**kwargs) 3158 finally: 3159 ax._hold
= washold
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/__init__.pyc
in inner(ax, *args, **kwargs) 1896
warnings.warn(msg % (label_namer, func.__name__), 1897
RuntimeWarning, stacklevel=2)-> 1898
return func(ax, *args, **kwargs) 1899 pre_doc =
inner.__doc__ 1900 if pre_doc is None:
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc
in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin,
vmax, origin, extent, shape, filternorm, filterrad, imlim, resample,
url, **kwargs) 5122 resample=resample,
**kwargs) 5123 -> 5124 im.set_data(X) 5125
im.set_alpha(alpha) 5126 if im.get_clip_path() is None:
/home/trina/anaconda2/lib/python2.7/site-packages/matplotlib/image.pyc
in set_data(self, A) 598 if (self._A.ndim not in (2, 3) or
599 (self._A.ndim == 3 and self._A.shape[-1] not in
(3, 4))):--> 600 raise TypeError("Invalid dimensions for
image data") 601 602 self._imcache = None
TypeError: Invalid dimensions for image data
I am completely new to image processing, so I am interested to know how you
create image for this type of data in yt. Your help is very appreciated. I
have also attached the jupyter notebook and the actual data I am using for
the processing.
Thanks a lot
Tazkera Haque
I went to this in 2016 and had a great time. It would be great if we could
get some yt representation at the next meeting in 2018.
---------- Forwarded message ----------
From: *Matthew Craig* <mcraig(a)mnstate.edu>
Date: Monday, September 18, 2017
Subject: [AstroPy] Python in Astronomy 2018
To: Astronomical Python mailing list <astropy(a)python.org>
Hello all,
The 2018 Python in Astronomy conference will be held on 30th Apr - 4th May
2018 at the Center for Computational Astrophysics at the Flatiron Institute
in New York, New York. For more information see http://openastronomy.org/
pyastro/2018/.
Python in Astronomy 2018 aims to bring a wide variety of people who
currently use, develop or teach people about Python packages in the context
of all forms of Astronomy. The conference will include presentations,
tutorials, unconference sessions, and sprints. As well as building the
community around astronomical uses of Python, the conference aims to
improve collaboration and interoperability between Python packages and
share knowledge on Python packages and techniques. It will also provide
training and educational materials for users and developers of Python
packages.
Participant selection will be made with the goal of enhancing the Python in
Astronomy community and we particularly encourage requests to attend from
junior astronomers and people who are new to contributing to open source
software. Effort will also be made to select participants who have a
demonstrated potential to contribute meaningfully to the Python in
Astronomy infrastructure via providing educational materials,
documentation, and/or coding. This conference is intended to be neither an
introduction to Python bootcamp nor only for expert-level Python developers.
If you are interested in attending and/or have any questions about the
conference, please use this form: https://goo.gl/forms/47eYzrWsKPqIPTL42
Further, please nominate people who you think should might benefit from
attending and contributing to Python in Astronomy 2018 using this form:
https://goo.gl/forms/47eYzrWsKPqIPTL42
Applications from interested participants will open by Oct 16, 2017; the
link to the application form will be available at the conference web site,
http://openastronomy.org/pyastro/2018/
Matt Craig
On behalf of the 2018 SOC:
Azalee Bostroem
Daniela Huppenkothen
Andrew Leonard
Duncan Macleod
Brigitta Sipocz
Erik Tollerud