-
Notifications
You must be signed in to change notification settings - Fork 308
Description
Hi,
I am having issue with the automated detection of conformal/proper time for a Ramses snapshot.
The snapshot is correctly flagged as a cosmological run, the RT fields are detected, but use_conformal_time remains True.
In [1]: import yt
In [2]: s = yt.load("./output_00192/")
yt : [INFO ] 2025-10-15 12:22:23,511 Parameters: current_time = 12.319863697238487 Gyr
yt : [INFO ] 2025-10-15 12:22:23,511 Parameters: domain_dimensions = [256 256 256]
yt : [INFO ] 2025-10-15 12:22:23,511 Parameters: domain_left_edge = [0. 0. 0.]
yt : [INFO ] 2025-10-15 12:22:23,511 Parameters: domain_right_edge = [1. 1. 1.]
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: cosmological_simulation = True
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: current_redshift = 0.11107106477806394
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: omega_lambda = 0.691399991512299
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: omega_matter = 0.308600008487701
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: omega_radiation = 0.0
yt : [INFO ] 2025-10-15 12:22:23,512 Parameters: hubble_constant = 0.6776999664306641
In [3]: s.use_conformal_time
Out[3]: True
In [4]: s.fluid_types
Out[4]: ('gas', 'deposit', 'index', 'ramses-rt', 'gravity', 'ramses')
I tracked the issue to the code here:
yt/yt/frontends/ramses/data_structures.py
Lines 877 to 885 in 744b51b
| if use_conformal_time is not None: | |
| self.use_conformal_time = use_conformal_time | |
| elif self.cosmological_simulation: | |
| if "rt" in self.fluid_types: | |
| self.use_conformal_time = False | |
| else: | |
| self.use_conformal_time = True | |
| else: | |
| self.use_conformal_time = False |
Even though the RT fields are detected with ramses-rt in fluid_types, the specific rt fluid type is not available until gas loading has been explicitly attempted. The if statement then fails and returns use_conformal_time=True.
I am not familiar enough with all the ins and outs of YT, but a simple fix could to replace if "rt" in by if "ramses-rt" in, or another more robust test taking into account partial loading.