How to transform snapnum to time?

Jinning Liang
  • 29 Sep '21

Hi!
When I want to transform snapnum to time(Gyr), I find out that the time in TNG are represented as snapnum. (ill.groupcat.loadHeader(BASE_PATH_ILLUSTRIS_1, j)['Time'] cannot return cosmic time) But I want to use cosmic time(Gyr) to do some analysis. What should I do? Does TNG have this function? Or I have to do this personally.

Looking forward to your reply!

Best wishes,
Jinning

Dylan Nelson
  • 29 Sep '21

Hello,

The Time gives the cosmic scale factor (a). You can convert this to age of the universe, or lookback time, or similar values, using e.g. astropy.cosmology, or you can implement yourself a simple equation for flat cosmologies e.g. the Peebles textbook eq 13.2.

Jinning Liang
  • 29 Sep '21

Hello! That's what I want! Thanks for your help!

Tianning LYU
  • 21 Nov '23

Hi!
I am using merger tree, but in merger tree data there is only SnapNum, even not Time(cosmic scale factor). Does TNG have a function for transferring SnapNum to time? So that I can use astropy.cosmology for further analysis.

Best,
Tianning

Jinning Liang
  • 21 Nov '23

Hi Tianning,

You can use il.groupcat.loadHeader(basePath,snap)["Time"] to get scale factor or il.groupcat.loadHeader(basePath,snap)["Redshift"] to get redshift with given snapnum and transform them into cosmic time by satrapy.

Best,
Jinning

Tianning LYU
  • 21 Nov '23

Thanks! I will try.

  • Page 1 of 1