Redshift IC Check
This checks in the initial conditions to see if we have a redshift present. If we do, then we compare this against the redshift from the parameter file.
Redshift was chosen to prevent conflicts between the use of the Time
varibale between SWIFT and Gadget-oid codes.
Let me know if this implementation is utter crap, or if there's anything that I need to change.
This change has been requested from users in the COLIBRE fork.
Merge request reports
Activity
added 1 commit
- 685ec980 - Clarified comment slightly in io_read_attribute_graceful
We could check against the current time and scale factor, should we read the
Time
variable, but I would be worried about edge cases. We would also have to invoke the unit system, should the internal and IC units be different.Edited by Josh BorrowYes, it's tricky. I don't know what was used to generate the SmallCosmoVolume ICs. They have possibly been processed by some version of Gadget-3 to apply the 2LPT correction. As we did for EAGLE.
It's hard to come up with something generic that is not going to backfire given that there is no agreed-upon standard.
How about:
- Check for
Cosmology/Scale-Factor
- if there then pass - Check for
Header/Redshift
- if there then pass - Check for
Code/Code == SWIFT
- if there then we knowHeader/Time
is Scale Factor - Check for
Header/Time
- if nonzero then it's probablya
and we can check against it.
It's pretty nasty, though.
- Check for
-
/Cosmology/
only exists in SWIFT output. -
/Header/Redshift/
will exist in the output of some flavours of G-3 - If
Code/Code
==SWIFT
(or/Header/Code
==SWIFT
) then it's a SWIFT output andHeader/Time
actually contains the time since Big Bang.
All we can do I think is:
- Read
header/Time
and assume it isa
as per Gadget convention. OR - Impose the
Redshift
/Scale-factor
as part of the file format we ask for. And hence break compatibility with the IC codes we currently use.
Edited by Matthieu Schaller-
We could require these things, or we could just add this as a check for people doing something silly; I don't think this requires drastic measures. I think if people are using snapshots without any actual consistent metadata in them and using inconsistent values in their parameter files then it's their bad.
added 1 commit
- bc5328fd - Moved assertion of valid initial redshift to io functions
added 66 commits
-
bc5328fd...1795cab8 - 59 commits from branch
master
- d9e4c3e1 - Added graceful function to read attributes. If failing, this doesn't report anything.
- 4e251c47 - Now read the redshift from snapshot if present, and check against the one from the parameter file
- 09f3f468 - Replaced calls to error with message
- bde32815 - Added improved implementation of the graceful attribute read.
- 3a4a7865 - Clarified comment slightly in io_read_attribute_graceful
- fe15a841 - Moved assertion of valid initial redshift to io functions
- e5cc81c2 - Code formatting
Toggle commit list-
bc5328fd...1795cab8 - 59 commits from branch
added 10 commits
-
c1f3913a...c2d7c869 - 2 commits from branch
master
- 7e3f9898 - Added graceful function to read attributes. If failing, this doesn't report anything.
- 951bf467 - Now read the redshift from snapshot if present, and check against the one from the parameter file
- be33f0ce - Replaced calls to error with message
- 0c77332c - Added improved implementation of the graceful attribute read.
- 89297fdc - Clarified comment slightly in io_read_attribute_graceful
- f32be0df - Moved assertion of valid initial redshift to io functions
- c5e51cd0 - Code formatting
- 8d97d615 - Added documentation for redshift in ICs
Toggle commit list-
c1f3913a...c2d7c869 - 2 commits from branch
mentioned in commit cd24775e