diff --git a/docs/contents.rst b/docs/contents.rst index 946eb24..6563315 100644 --- a/docs/contents.rst +++ b/docs/contents.rst @@ -32,6 +32,14 @@ Lightcone .. automodule:: tools21cm.lightcone :members: +N-Body Tools +------------ +.. automodule:: tools21cm.nbody_tools + :members: + +.. automodule:: tools21cm.nbody_file + :members: + Point statistics ---------------- .. automodule:: tools21cm.statistics diff --git a/src/tools21cm/nbody_tools.py b/src/tools21cm/nbody_tools.py index 03e848e..accddf3 100644 --- a/src/tools21cm/nbody_tools.py +++ b/src/tools21cm/nbody_tools.py @@ -36,15 +36,15 @@ def ParticleMass_to_ParticleNumber(Lbox, particle_mass, cosmo='Planck18'): print('Particles | along each direction = {} | total = {}'.format(particle_number,particle_number**3)) return particle_number.value -def HaloMass_to_ParticleNumber(Lbox, halo_mass, particles_in_halo, cosmo='Planck18'): +def halo_mass_to_particle_number(Lbox, halo_mass, particles_in_halo, cosmo='Planck18'): particle_mass = halo_mass/particles_in_halo - return ParticleMass_to_ParticleNumber(Lbox, particle_mass, cosmo=cosmo) + return particle_number_to_particle_mass(Lbox, particle_mass, cosmo=cosmo) -def ParticleNumber_to_ParticleMass(Lbox, particle_each_direction=None, particle_total=None, cosmo='Planck18'): +def particle_number_to_particle_mass(Lbox, particle_each_direction=None, particle_total=None, cosmo='Planck18'): particle_number = particle_each_direction if particle_each_direction is not None else np.cbrt(particle_total) cosmo = _set_cosmo(cosmo) if not isinstance(Lbox, units.Quantity): Lbox *= units.Mpc print('As the box length provided is not using Astropy units, Mpc is assumed here.') particle_mass = cosmo.critical_density0*cosmo.Om0*(Lbox/particle_number)**3 - return particle_mass.to('Msun') \ No newline at end of file + return particle_mass.to('Msun')