Hello again,
I am using yt slices and projections with scale annotation. I have my plots in comoving units ("Mpccm/h") but whenever I want to use the same units for annotation:
slc.annotate_scale(corner='lower_right', coeff=10, units='Mpccm/h'),
yt does not recognize these units. Am I missing something or only the physical scale annotation is possible ?
Thanks,
Salome
Hi!
Working on the FLASH code (dynamic mesh refinement), I am looking for how could I get from the HDF5 Outputs the spatial positions (in physical units).
Idealy, if I run a 2D simulation, I would like to obtain x and y arrays at a given time.
It is not necessarally a YT issue but it is obvious that some modules could help a lot.
Tell me if you have any idea!
Thanks
--
Thibault Goudal
PhD Student CEA
CELIA CNRS UMR5107 laboratory
+33664160842
thibault.goudal(a)u-bordeaux.fr
Dear all,
I am trying to annotate quiver over the projection plot of density field
using the following code line:
* p.annotate_quiver("velocity_x", "velocity_y", factor = 35,
normalize = True, plot_args = {"color":'Red'})*
but it shows an *error*:
File "/home/user1/yt/yt/visualization/plot_window.py", line 997, in
run_callbacks
callback = CallbackMaker(*args[1:], **kwargs)
*TypeError: __init__() got an unexpected keyword argument 'plot_args'*
Without *'plot_args'* keyword argument annotation works fine but I need to
adjust the color and the width of the vectors.
I am using yt Version = 3.5.dev0.
It may be a silly question: while annotating vectors (velocity_x and
velocity_y, say) over the projection plot, is the annotation done after the
weighted line integration of velocity_x and velocity_y over the width of
the projection? and for this also the weight field is the same as we
specified in the field projection method! If so, Is there any way to change
the weight field for the annotation?
Many thanks and regards,
-Prateek
Hi all,
I am attempting to add a divergence field and am running into the issue apparent in the plot below:
The grid artifacts appear to be the meshblocks for mpi parallelization when running the simulation. This doesn’t occur for any other field.
I am working with an Athena++ athdf dataset and using yt version 3.7.dev0.
Here is the script I used to add the desired field:
import yt
from yt.fields.derived_field import ValidateSpatial
import yt.units as u
kappa0 = 9.68e4
ds = yt.load('../pleiades/grf/grf_pr_2_3_nm5_3/TI.uov.00200.athdf',\
units_override=units_override,unit_system="cgs")
grad_fields = ds.add_gradient_fields(("gas","temperature"))
def _therm_cond(field,data):
kappa = kappa0*u.erg/(u.cm*u.K*u.s)
sl_left = slice(None, -2, None)
sl_right = slice(2, None, None)
div_fac = 2.0
ds = div_fac * data['dx'].flat[0]
f = data["temperature_gradient_x"][sl_right,1:-1,1:-1]/ds
f -= data["temperature_gradient_x"][sl_left ,1:-1,1:-1]/ds
if data.ds.dimensionality > 1:
ds = div_fac * data['dy'].flat[0]
f += data["temperature_gradient_y"][1:-1,sl_right,1:-1]/ds
f -= data["temperature_gradient_y"][1:-1,sl_left ,1:-1]/ds
if data.ds.dimensionality > 2:
ds = div_fac * data['dz'].flat[0]
f += data["temperature_gradient_z"][1:-1,1:-1,sl_right]/ds
f -= data["temperature_gradient_z"][1:-1,1:-1,sl_left ]/ds
new_field = np.zeros(data["temperature_gradient_x"].shape, dtype='float64')
new_field = data.ds.arr(new_field,'K/cm**2')
new_field[1:-1,1:-1,1:-1] = f
return kappa*new_field/data['density']
ds.add_field(('gas','therm_cond'), function=_therm_cond, units="erg/(g*s)", sampling_type="cell", take_log=False,
display_name=r'$\nabla \cdot (\kappa\nabla T)/\rho$', force_override=True, validators = [ValidateSpatial(1,
['temperature_gradient_x','temperature_gradient_y','temperature_gradient_z'])])
Has anyone come across this issue before? Is this a known bug or am I just implementing the divergence field incorrectly? Any help is greatly appreciated.
Thanks,
Michael
Hi all,
I'm trying to use the 'density' method for the smooth() function (which points to the class SmoothedDensityEstimate), but I can't find any documentation about how to use the 'density' method of smooth (i.e. what fields, index fields, etc. I should feed it.) Could someone give me an example of how this method should be used? I'm using yt 3.6 with FLASH particle data. The link to the SmoothedDensityEstimate class code is https://github.com/yt-project/yt/blob/6befef2bc0427250fd62395962599be41b193….
Thanks,
Camryn
Hi! I'm working with a FLASH dataset and am trying to use the add_nearest_neighbor_field() function as briefly described here https://yt-project.org/doc/analyzing/fields.html#computing-the-nth-nearest-…. However, when I run the short script (with the input data replaced with my own FLASH dataset), I get the errors yt.fields.field_exceptions.NeedsGridType: (0, None) and NotImplementedError. Is this function not available for FLASH datasets, and is there a workaround? My final goal is to create a smoothed particle field, so if there is a better way than using the nearest_neighbor_distance_64 field in place of a smoothing_length field, please let me know!
Input data:
plt file - http://use.yt/upload/a94cdffd
part file - http://use.yt/upload/dec62ce5
Test Script: http://paste.yt-project.org/show/259/
Camryn
Hi,
Just wondering if it is possible to find the ellipticity of the model. I assume one should first start with all the (x,y,z) coordinates and fit them to an ellipsoid. Is it already implemented in yt?
Thank you
Robin