Questions tagged [yt-project]

yt is a python library and toolkit for analyzing and visualizing volumetric data

About yt

From the yt homepage

yt is a python package for analyzing and visualizing volumetric, multi-resolution data from astrophysical simulations, radio telescopes, and a burgeoning interdisciplinary community.

The yt project aims to produce an integrated science environment for collaboratively asking and answering astrophysical questions. To do so, it will encompass the creation of initial conditions, the execution of simulations, and the detailed exploration and visualization of the resultant data. It will also provide a standard framework based on physical quantities interoperability between codes.

Development of yt is driven by a commitment to Open Science principles as manifested in participatory development, reproducibility, documented and approachable code, a friendly and helpful community of users and developers, and Free and Libre Open Source Software.

Resources:

14 questions
2
votes
1 answer

Annotation options of yt ProjectionPlot

I am new to yt and I would like to make some major adjustments of the yt ProjectionPlot output that I am getting. So far I have: import yt ds = yt.load("/path/to/data") prj = yt.ProjectionPlot(ds, 'z', 'Tmean', method='integrate', weight_field='rho…
anfho
  • 131
  • 1
  • 9
2
votes
1 answer

sliceplot for bound material in yt without showing unbound

I am trying to mask out the bound density of a system with the masking field @derived_field(name = "bound_density", units = "g/cm**3") def _get_ejected_density(field, data): E = 0.5* data["cell_mass"]*…
bhjghjh
  • 889
  • 3
  • 16
  • 42
2
votes
1 answer

creating gradient of a field as a derived field in project yt

I need a little help creating a derived field which will return me the negative gradient of gravitational potential, hence the gravitational acceleration. I tried something like this: @derived_field(name = "gradient_gravpot", units = " cm/s**2") def…
bhjghjh
  • 889
  • 3
  • 16
  • 42
2
votes
2 answers

How can I set the colorbar limits for a yt.SlicePlot using set_cmap?

I am totally new to Python and I am totally lost. My supervisor helped me to generate a script to see some slices of a 3D velocity model: import numpy as np import matplotlib.pyplot as plt import yt from yt.units import km #Import et reshape…
OcéF
  • 47
  • 8
2
votes
1 answer

Adding subplots within yt-Project plot

I'm using the yt-Project library to visualize data and create plots. Now, I want to create a plot containing of two subplots. It seems this is not directly possible with yt and you have to use matplotlib for further customization (described…
rtime
  • 349
  • 6
  • 23
2
votes
1 answer

How do I add a scalar value to a yt array?

I'm trying to add a numerical floor to one of my derived fields in yt. However, when I try: new_field = 1.0e-10 + data['metal_density'] I get the following error: In [1]: ad = ds.all_data() In [2]: floored_density = 1.0e-10 + ad['density'] yt :…
skillman
  • 73
  • 7
1
vote
0 answers

PyCharm cannot find references when importing classes from unyt package

I am trying to work with yt Project's unyt, a Python package "for working with data that has physical units" (source). When I try to import units using syntax like from unyt import degC, PyCharm tells me Cannot find reference 'degC'. What am I doing…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
1
vote
1 answer

Coordinates and Field values

Consider I have load a dataset as follows: ds = yt.load('pltxxx') The dataset includes the following fields density, mag_vort, tracer, x_velocity, y_velocity One can simply plot the mag_vort which is the magnitude of vorticity in 2D domain in this…
mko
  • 61
  • 7
1
vote
1 answer

How to volume render simple 3D Data via yt-project

yt-project is a nice toolkit for volumetric data. But the dataset it used is a bit of complex, such as Enzo data. So if I only want to volume render a simple 3d data via yt-project, how to load data? The simple 3D data only contain the…
Honghe.Wu
  • 5,899
  • 6
  • 36
  • 47
1
vote
1 answer

Installing two different yt versions in two different directories

I am using yt 3.1 on a cluster and the current version is installed in a directory /work/../../sw/yt-3.1/yt-x86_64/bin/yt , now I would like to try the new version 3.3.1 but I still want to use the older version in parallel to compare. Please let me…
bhjghjh
  • 889
  • 3
  • 16
  • 42
1
vote
1 answer

python syntax error and usage of yt package

I need a little help in defining a new derived field in yt. my goal is to find if a stellar system eject some mass or not. I am attaching the derived_field_list from the file I have. I am trying to define the total energy of the system…
bhjghjh
  • 889
  • 3
  • 16
  • 42
1
vote
1 answer

running python program in yt project with STAMPEDE

I have been working on this python program to find max_dens of my files but whenever I execute the file I get the same error. Can anyone please tell me what these errors refer to? I am using yt 3.1 computes and plots the maximum density over time …
bhjghjh
  • 889
  • 3
  • 16
  • 42
0
votes
0 answers

making smooth lined plots in python using yt toolkit

I have been using python based yt toolkit to analyze some data and my files are not that frequent enough to make a smooth plot out of it. The plot is shown on a log scale. ni56Mass[n] = (d['cell_mass'] * d['ni56']).sum() …
bhjghjh
  • 889
  • 3
  • 16
  • 42
0
votes
0 answers

derived fields in yt

I am having problem with creating a derived field in yt and printing it. please look at my code: %matplotlib inline import yt import numpy as np from yt import derived_field from matplotlib import pylab @derived_field(name = "C12", units = "…
bhjghjh
  • 889
  • 3
  • 16
  • 42