def _parse_parameter_file(self):
# Read all parameters.
simu = self._read_log_simu()
param = self._read_parameter()
# Set up general information.
self.filename_template = self.parameter_filename
self.file_count = 1
self.parameters.update(param)
self.particle_types = ('halos')
self.particle_types_raw = ('halos')
self.unique_identifier = \
int(os.stat(self.parameter_filename)[stat.ST_CTIME])
# Set up geometrical information.
self.refine_by = 2
self.dimensionality = 3
nz = 1 << self.over_refine_factor
self.domain_dimensions = np.ones(self.dimensionality, "int32") * nz
self.domain_left_edge = np.array([0.0, 0.0, 0.0])
# Note that boxsize is in Mpc but particle positions are in kpc.
self.domain_right_edge = np.array([simu['boxsize']] * 3) * 1000
self.periodicity = (True, True, True)
# Set up cosmological information.
self.cosmological_simulation = 1
self.current_redshift = param['z']
self.omega_lambda = simu['lambda0']
self.omega_matter = simu['omega0']
cosmo = Cosmology(self.hubble_constant,
self.omega_matter, self.omega_lambda)
self.current_time = cosmo.hubble_time(param['z']).in_units('s')
评论列表
文章目录