- Can I bin the fields in a ray into cells of fixed size? I want to display the ray temperature and density fields along with the final absorption spectrum in a single plot. Can I bin the fields stored in the ray with the same uniform bins with binsize dlambda as used in the absorption spectra?
- When calculating the 21 cm forest spectra, thermal broadening of the lines isn't considered. (Eq 1 https://arxiv.org/abs/1510.02296). Can I disable the voigt deposition in trident? Another way I could do this is using the temperature and column density fields from the ray. But the fields need to be binned along the sightline to calculate the spectrum, which is why I asked the first question.
- I'm using a small box with L = 12.5 cMpc and the dz across the box is too small. I want to loop the sightline inside the same dataset until I achieve a fixed dz. Is this possible with trident? I don't have access to the simulation parameter file which makes things more difficult. Is the looping part achievable?
I guess I don't fully understand what you mean by this question. The wavelength array is in wavelength space that does not directly correlate with the "l" array in physical space down the ray. Are you trying to make a plot/movie like this: https://vimeo.com/116594959 ? It may be a bit trickier for a particle-based dataset, because the "dl" and "l" arrays, the path lengths of the ray elements and their location along the ray, are not uniform in distribution for SPH datasets.As the ray traverses the simulation volume, it isn't sampling the fluids in a uniform way as it would for grid-based datasets. It's actually identifying what portion of the ray passes in proximity to SPH particles along its length within their smoothing kernels. Trident records the fluid quantities for each of those particles in the ray itself (e.g., the temperature field, density field, metallicity field), so the ray data structure actually has the particles' original fluid quantities in it, *not* the values along the ray itself. The way trident/yt actually encodes how much these fluid quantities from the SPH particles *matter* for the ray is encoded in the path length of that ray element, the "dl" array. So the "dl" array array is not a true physical path length, it's a combination of the true path length and the proximity of that path to the SPH particle. But for calculating column densities, the traditional calculation still works for a given ray element: density * dl = column density. dl is just where all the magic is hidden about numerically integrating the path of the ray through the smoothing kernel of the particle.
You are the first person to my knowledge, who has tried to use Trident to produce predictions of 21 cm data, so things may not work out ideally, but we will see what we can do. The actual Voigt deposition is done in using the "tau_profile" function https://github.com/trident-project/trident/blob/master/trident/absorption_spectrum/absorption_line.py#L147 . It's primarily used in absorption_line.py here: https://github.com/trident-project/trident/blob/master/trident/absorption_spectrum/absorption_spectrum.py#L886 . As you can see, the "thermb" value is what feeds into it to give it doppler broadening (or thermal broadening) to each line. One way to suppress thermal broadening would be for you to generate a ray for your sightline, then manually set the temperature field in that ray to something very small (zero may just break it), and then generate your spectrum from that.
You can use the "make_compound_ray" function to generate rays that traverse the simulation volume mulitiple times: https://trident.readthedocs.io/en/latest/annotated_example.html#compound-lightrays . But this requires the simulation parameter file. I suppose you could try to make several sightlines across the box and then stitch them together yourself, but this will be a bit harder to achieve. But you could just manually pick your start_point and end_point of your different lines. Just remember to look at the final redshift of the last ray element to figure out what to use as your starting redshift for the next sightline, and use them until you get your desired z range. Keep in mind that the "starting" z is the high-z, and the ending "z" is low-z.
--
You received this message because you are subscribed to the Google Groups "trident-project-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trident-project-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trident-project-users/CAGpJuHKtLNGZnNtqWgpFY2G_hZ4W8JYjWraVcGwV2%3D6v4Ce_1A%40mail.gmail.com.
I am not 100% sure this will help with your first question, but it's possible. If you are working directly with the SpectrumGenerator as is documented in here, there is a keyword argument for the make_spectrum command called "store_observables", which if set to True, will create a dictionary called "line_observables_dict" hanging off the SpectrumGenerator object. This is a relatively unknown feature that could use some more documentation, but I believe it will contain a dictionary of arrays of column density, wavelength, equivalent width, etc for each line that was deposited in the spectrum. Have a look at the docstring for the make_spectrum command. It may contain a little more information.
For the error you're getting in the make_compound_ray command, it's possible a bug may have crept in because I think this is suppose to work. I'm happy to try to help debug this. This thread is already pretty long and a bit hard to read. I think it might be easier to chat on the slack channel (info in trident docs). If you've able to come on there, one of us should be around.