Hi yters!
I have been working of a relaunch of the yt blog with Matt over the past
few weeks (it was previewed at the RHytHM workshop if you want to watch the
talk about it (linked below)! Check it out at https://blog.yt-project.org/
Some of the things we tried to do when relaunching the blog was:
- find a format that allowed for easy filtering of posts (in this blog we
have tags, categories, and a search feature)
- Find a format that has a nice post preview (with images)
- Choose something …
[View More]that is accessible to various levels of contribution.
We would love your feedback and contributions on the new blog! What can
make it *even better*? What topics would you like to see on the blog? What
could *you* add to the blog???? I personally think it would be cool to see
stuff like:
- How you use yt for YOUR SCIENCE
- What cool tips and tricks do you use in yt?
- Do you have a favorite feature? What is it and why?
- Did you write a cool extension that uses yt? Let's hear about it!
- Do you have a very cool colormap theme that you use with yt based on
album covers of an artist??? What does science data look like with them???
- And so much more!
We have two different ways of contributing a blog post: either as an issue
or as a PR. You can check out the differences in the contributor guide.
We've moved the blog repo into the yt project organization, it is now
located at https://github.com/yt-project/blog
You can find the blog hosted at https://blog.yt-project.org/
I can't wait to see all of your posts!!!
Madicken
PS -- Chris Havlin has already contributed two new posts to the blog! Dask!
Napari! So many cool things! Check them out.
[View Less]
Hello!
I want to create 3D field within a spherical object. For example, I create 3D electron density in the following manner:
ds = yt.load("DATA")
dd = ds.all_data()
max_level = ds.index.max_level
ref = 2**max_level
low = ds.domain_left_edge
dims = ds.domain_dimensions*ref
nx, ny, nz = dims
L = (ds.domain_right_edge - ds.domain_left_edge).d
all_data_level_max = ds.covering_grid(level=…
[View More]max_level,left_edge=low,dims=dims)
def _elec_den(field,data):
N_A = 1/1.6726219e-24
X = 0.70
return ((all_data_level_max['gas','density'])*N_A*(1+X)/2/ds.quan(1,'g') )
ds.add_field(('gas','elec_den'), function=_elec_den, units='auto', dimensions=dimensions.number_density)
Then if I do:
dd['elec_den']
it will give me a 3D field which will have the same dimensions as the root grid of the dataset. However, if I create spheres and then a spherical object between these two spheres:
rvir = 4.2454307068129566e+24 #virial radius of a halo [cm].
xyz = [0.4208984375, 0.2216796875, 0.5185546875] #centre of a halo.
sph1 = ds.sphere(xyz, (2*rvir, 'cm'))
sph2 = ds.sphere(xyz, (4*rvir, 'cm'))
cutout_obj = sph2 - sph1
cutout_obj['elec_den'] or sph1['elec_den'] and sph2['elec_den'] will have the same dimensions as dd['elec_den'] ; but this cannot be true since sph1 and sph2 include less grid points.
Is there a way I can create 3D field and use it within a different yt objects?
Thanks,
Salome
[View Less]