[yt-users] lightray start and end points

Britton Smith brittonsmith at gmail.com
Wed Jul 13 00:04:48 PDT 2016


Hi Stephanie,

The light_ray_solution attribute associated with your LightRay object
contains a list of dictionaries with "start" and "end" entries (among
others) for each segment of the LightRay.  Before you look at it, I suggest
adding the following bit of code to your script:

for sl in lr.light_ray_solution:
     del sl["next"]
     del sl["previous"]

This will remove the pointers that refer to the next and previous segments
of the light_ray_solution.  If you don't remove those, printing out that
object will be like looking at yourself in a hall of mirrors.  Give it a
try.

As for your ultimate goal of trying to make light rays that span some
redshift range but only use the high resolution region of the box, I
managed to make this work for myself in the past.  It was a bit of a hack
so I never ended up adding it to the main repository.  However, if you'd
like to try working with what I did, feel free to contact me off-list and
we can work together to make it happen and perhaps even clean up that code
and add it to the main repo.

Britton

On Wed, Jul 13, 2016 at 7:34 AM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hi Stephanie,
>
> Looking at the code, I think what you're looking for is the
> light_ray_solution list, which is attached to the LightRay object. I just
> tried running this cookbook script:
>
>
> http://yt-project.org/docs/dev/cookbook/cosmological_analysis.html#light-ray
>
> And afterwards inspected the light_ray_solution list:
>
> https://paste.yt-project.org/show/6676/
>
> In this context 'lr' is a light ray object.
>
> I would also encourage you to look at the source code, as that's probably
> the best source of truth for this as the docs seem to be a little minimal:
>
>
> https://bitbucket.org/yt_analysis/yt/src/5e50ddf62454f276c63fc939ab6aa96cceefc817/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py?at=yt&fileviewer=file-view-default
>
> On Tue, Jul 12, 2016 at 10:37 PM, Stephanie Tonnesen <stonnes at gmail.com>
> wrote:
>
>> Hi yt-users,
>>
>> I have a somewhat strange goal using lightray.  I have a large box, 120
>> Mpc/h on a side, but only a portion of it is highly resolved (about 25
>> Mpc/h on a side).  I want to create a set of lightrays that span a small,
>> constant z range and only cross the refined region of the box.
>>
>> So right now I am using the cosmology LightRay call so that I can set the
>> redshift range, and would like to be able to take a look at the start and
>> stop positions of the lightray that is created, and not just in the output
>> dump of the run.  What command can I use to make those positions into a
>> variable in my code?  I tried
>>
>> lr.start_position, but that doesn't exist.
>>
>> Any help is appreciated!
>>
>> Thanks,
>> Stephanie
>>
>> --
>> Dr. Stephanie Tonnesen
>> Alvin E. Nashman Postdoctoral Fellow
>> Carnegie Observatories, Pasadena, CA
>> stonnes at gmail.com
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160713/ee5d582d/attachment.htm>


More information about the yt-users mailing list