ds.conversion_factors.update({f: 1.0 for f in fields}) ds.gamma = 5.0 / 3.0 ds.current_redshift = 0.0001 ds.cosmological_simulation = 1 ds.hubble_constant = 0.7 ds.omega_matter = 0.27 ds.omega_lambda = 0.73 ds.cosmology = Cosmology( hubble_constant=ds.hubble_constant, omega_matter=ds.omega_matter, omega_lambda=ds.omega_lambda, unit_registry=ds.unit_registry, ) for my_unit in ["m", "pc", "AU", "au"]: new_unit = f"{my_unit}cm" my_u = Unit(my_unit, registry=ds.unit_registry) ds.unit_registry.add( new_unit, my_u.base_value, dimensions.length, "\\rm{%s}/(1+z)" % my_unit, prefixable=True, ) header = r""" .. _field-list: Field List ========== This is a list of many of the fields available in yt. We have attempted to
def fix_units(units, in_cgs=False): unit_object = Unit(units, registry=ds.unit_registry) if in_cgs: unit_object = unit_object.get_cgs_equivalent() latex = unit_object.latex_representation() return latex.replace(r"\ ", "~")
def fix_units(units, in_cgs=False): unit_object = Unit(units, registry=ds.unit_registry) if in_cgs: unit_object = unit_object.get_cgs_equivalent() latex = unit_object.latex_representation() return latex.replace("\ ", "~")