API Reference
GadgetUnits.GadgetPhysicalGadgetUnits.GadgetPhysicalGadgetUnits.GadgetPhysicalGadgetUnits.GadgetPhysicalGadgetUnits.GadgetPhysicalUnitsGadgetUnits.GadgetPhysicalUnitsGadgetUnits.GadgetPhysicalUnitsGadgetUnits.GadgetPhysicalUnitsGadgetUnits.GadgetPhysicalUnitsCosmology.ageCosmology.ageCosmology.cosmologyCosmology.cosmologyCosmology.lookback_timeGadgetUnits.arcmin_to_kpcGadgetUnits.arcmin_to_kpcGadgetUnits.arcmin_to_kpcGadgetUnits.arcmin_to_kpcGadgetUnits.arcmin_to_kpcGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.mJy_to_WGadgetUnits.redshiftGadgetUnits.redshiftGadgetUnits.redshiftGadgetUnits.redshift
Exported Functions
Cosmology.age — Functionage(h::AbstractGadgetHeader, units::Bool=false)Computes the age of the universe given the properties from AbstractGadgetHeader.
Cosmology.cosmology — Methodcosmology(h::AbstractGadgetHeader)Defines a Cosmology.AbstractCosmology from the properties of h.
Cosmology.lookback_time — Functionlookback_time(h::AbstractGadgetHeader, units::Bool=false)Computes the lookback tima given the properties from AbstractGadgetHeader.
GadgetUnits.arcmin_to_kpc — Methodarcmin_to_kpc(c::Cosmology.AbstractCosmology, θ::Real, z::Real)Convert arcmin to kpc for a given redshift z and cosmology c. Deletes unit information.
GadgetUnits.arcmin_to_kpc — Methodarcmin_to_kpc(c::Cosmology.AbstractCosmology, θ::Unitful.AbstractQuantity, z::Real)Convert arcmin to kpc for a given redshift z and cosmology c. Conserves unit information.
GadgetUnits.arcmin_to_kpc — Methodarcmin_to_kpc(θ::Real, h::AbstractGadgetHeader)Convert arcmin to kpc for a given redshift and cosmology taken from AbstractGadgetHeader.
GadgetUnits.arcmin_to_kpc — Methodarcmin_to_kpc(θ::Unitful.AbstractQuantity, h::AbstractGadgetHeader)Convert arcmin to kpc for a given redshift and cosmology taken from AbstractGadgetHeader.
GadgetUnits.mJy_to_W — MethodmJy_to_W( c::Cosmology.AbstractCosmology, S::Real, z::Real )Converts synchrotron flux density S in [mJy] to [W/Hz] for a given redshift z and cosmology c. Deletes unit information.
GadgetUnits.mJy_to_W — MethodmJy_to_W( c::Cosmology.AbstractCosmology, S::Unitful.AbstractQuantity, z::Real )Converts synchrotron flux density S in [mJy] to [W/Hz] for a given redshift z and cosmology c. Conserves unit information.
GadgetUnits.mJy_to_W — MethodmJy_to_W(S::Union{Real,Unitful.AbstractQuantity}, d::Real)Converts synchrotron flux density S in [mJy] to [W/Hz] for a given distance d in [Mpc].
GadgetUnits.mJy_to_W — MethodmJy_to_W(S::Union{Real, Unitful.AbstractQuantity}, h::AbstractGadgetHeader)Converts synchrotron flux density S in [mJy] to [W/Hz] for a given redshift and cosmology taken from AbstractGadgetHeader.
GadgetUnits.mJy_to_W — MethodmJy_to_W(S::Union{Real,Unitful.AbstractQuantity}, d::Real)Converts synchrotron flux density S in [mJy] to [W/Hz] for a given distance d in [Mpc].
GadgetUnits.mJy_to_W — MethodmJy_to_W(S::Union{Real,Unitful.AbstractQuantity}, d::Unitful.AbstractQuantity)Converts synchrotron flux density S in [mJy] to [W/Hz] for a given distance d.
GadgetUnits.redshift — Methodredshift(c::AbstractCosmology, t_Gyrs::Real)Computes the redshift at a given age of the universe in Gyrs for a cosmology t.
GadgetUnits.redshift — Methodredshift(t::Real, h::AbstractGadgetHeader)See redshift.
GadgetUnits.redshift — Methodredshift(t::Unitful.AbstractQuantity, h::AbstractGadgetHeader)See redshift.
GadgetUnits.redshift — Methodredshift(t::Unitful.AbstractQuantity, h::AbstractGadgetHeader)See redshift.
Exported Types
GadgetUnits.GadgetPhysical — TypeGadgetPhysical( DT::DataType,
l_unit::Real=3.085678e21, m_unit::Real=1.989e43, v_unit::Real=1.e5;
a_scale::Real=1.0, hpar::Real=1.0,
γ_th::Real=5.0/3.0, xH::Real=0.752)Set up a unit struct with a given DataType.
GadgetUnits.GadgetPhysical — MethodGadgetPhysical( h::SnapshotHeader,
l_unit::Real=3.085678e21, m_unit::Real=1.989e43, v_unit::Real=1.e5;
γ_th::Real=5.0/3.0, xH::Real=0.752)Set up a unit struct with a given SnapshotHeader. Only works in 64-bits.
GadgetUnits.GadgetPhysical — MethodGadgetPhysical(l_unit::T=3.085678e21, m_unit::T=1.989e43, v_unit::T=1.e5;
a_scale::T=1.0, hpar::T=1.0,
γ_th::T=5.0/3.0, xH::T=0.752) where TCreates a struct GadgetPhysical which holds the conversion factors between comoving code units and physical units, without unit information.
Keyword arugments specify:
Arguments
a_scale::T = 1.0: Cosmological scale factor of the simulation. Can be passed with the headerhash.time.hpar::T = 1.0: Hubble constant as 'little h'. Can be passed with headerhash.h0.γ_th::T = 5.0/3.0: Adiabatic index of gas.xH::T = 0.752: Hydrogen fraction of the simulation, if run without chemical model.
Fields
| Name | Meaning |
|---|---|
x_cgs::T | position in cm |
x_physical::T | position in kpc |
v_cgs::T | velocity in cm/s |
v_physical::T | velocity in km/s |
m_cgs::T | mass in g |
m_msun::T | mass in Msun |
m_physical::T | mass in 10^10 Msun |
t_s::T | time in sec |
t_Myr::T | time in Myr |
E_cgs::T | energy in erg |
E_eV::T | energy in eV |
B_cgs::T | magnetic field in Gauss |
rho_physical::T | density in 10^10 Msun/kpc^3 |
rho_cgs::T | density in $g/cm^3$ |
rho_ncm3::T | density in $n_p/cm^3$ |
T_K::T | temperature in K |
T_eV::T | temperature in eV |
P_th_cgs::T | thermal pressure in Ba |
P_CR_cgs::T | cosmic ray pressure in Ba |
CR_norm::T | LMBSPECTRALCRs Norm in cgs units |
GadgetUnits.GadgetPhysicalUnits — TypeGadgetPhysical( h::SnapshotHeader,
l_unit::Real=3.085678e21, m_unit::Real=1.989e43, v_unit::Real=1.e5;
γ_th::Real=5.0/3.0, xH::Real=0.752)Set up a unit struct with a given SnapshotHeader. Only works in 64-bits.
GadgetUnits.GadgetPhysicalUnits — TypeGadgetPhysicalUnits( DT::DataType,
l_unit::Real=3.085678e21, m_unit::Real=1.989e43, v_unit::Real=1.e5;
a_scale::Real=1.0, hpar::Real=1.0,
γ_th::Real=5.0/3.0, xH::Real=0.752)Set up a unit struct with a given DataType.
GadgetUnits.GadgetPhysicalUnits — MethodGadgetPhysicalUnits(l_unit::T=3.085678e21, m_unit::T=1.989e43, v_unit::T=1.e5;
a_scale::T=1.0, hpar::T=1.0,
γ_th::T=5.0/3.0, xH::T=0.752) where TCreates a struct GadgetPhysicalUnits which holds the conversion factors between comoving code units and physical units. Stores the unit information which can be converted with Unitful or UnitfulAstro.
Keyword Arguments
a_scale::T = 1.0: Cosmological scale factor of the simulation. Can be passed with the headerhash.time.hpar::T = 1.0: Hubble constant as 'little h'. Can be passed with headerhash.h0.γ_th::T = 5.0/3.0: Adiabatic index of gas.xH::T = 0.752: Hydrogen fraction of the simulation, if run without chemical model.
Fields
| Name | Meaning |
|---|---|
x_cgs::Quantity{T} | position in cm |
x_physical::Quantity{T} | position in kpc |
v_cgs::Quantity{T} | velocity in cm/s |
v_physical::Quantity{T} | velocity in km/s |
m_cgs::Quantity{T} | mass in g |
m_msun::Quantity{T} | mass in solar masses |
t_s::Quantity{T} | time in sec |
t_Myr::Quantity{T} | time in Myr |
E_cgs::Quantity{T} | energy in erg |
E_eV::Quantity{T} | energy in eV |
B_cgs::Quantity{T} | magnetic field in Gauss |
rho_cgs::Quantity{T} | density in $g/cm^3$ |
rho_ncm3::Quantity{T} | density in $n_p/cm^3$ |
T_K::Quantity{T} | temperature in K |
T_eV::Quantity{T} | temperature in eV |
P_th_cgs::Quantity{T} | thermal pressure in Ba |
P_CR_cgs::Quantity{T} | cosmic ray pressure in Ba |
CR_norm::Quantity{T} | LMBSPECTRALCRs Norm in cgs units |