Simple ray generation Query using Trident.

Hum Chand
  • 1
  • 20 Oct '23

Hi Dylan,
I am using this code to generate a simple ray through a TNG snapshot to obtain a Spectrum

import yt
import trident
ds = yt.load('/home/tnguser/sims.TNG/TNG50-3/output/snapdir_099/snap_099.0.hdf5')
ray_start = ds.domain_left_edge
ray_end = ds.domain_right_edge
line_list = ['H']
ray = trident.make_simple_ray(ds,
                              start_position=ray_start,
                              end_position=ray_end,
                              data_filename="simpleray.h5",
                              lines=line_list)
sg = trident.SpectrumGenerator(lambda_min=0, lambda_max=8000,
dlambda=0.01)
sg.make_spectrum('simpleray.h5', lines=['H'])
sg.plot_spectrum('H.png')

As you can see in yt.load I am loading just 1 chunk of the spectrum but in the documentation of YT I have read this
"If you are loading a multi-file dataset with Gadget, you can either supply the zeroth file to the load command or the directory containing all of the files. For instance, to load the zeroth file: yt.load("snapshot_061.0.hdf5")"

So supplying the name of the zeroth file loads all the chunks and shoots a sightline. I experimented by deleting some chunks in my working folder to see how it affects the spectrum but even if I delete all the chunks other than snap_099.0.hdf5, YT still plots a spectrum that is the same as I plotted when all the chunks were available in the folder. YT gives a warning that it did not find the other chunks but still, the code runs, and the Identical spectrum gets plotted. So I am confused as to what exactly is happening here. Is only one chunk being used to plot a spectrum if that is so, using some other chunk in the file path should give me some other spectrum but if I write snapshot_061.1.hdf5 or any other chunk in the path, the spectrum is still the same.

It is also worth mentioning that when I print column densities in various cases ( i.e. when all the chunks are present, when a few chunks are present when a single chunk is present in the folder being loaded), I find a very minute difference in that. Essentially, order and 7-8 significant digits of the column density remain the same.

Dylan Nelson
  • 24 Oct '23

This sounds like a yt issue. In general, I would suggest you view yt support simulations such as TNG experimental, i.e. not well tested in all circumstances.

Hum Chand
  • 29 Oct '23

Thank you .

  • Page 1 of 1