Methods

Index

Gadget2

AstroIO.read_gadget2Function
read_gadget2(filename::AbstractString, units, fileunits = uGadget2; kw...)

Return a Tuple of header and particle data in snapshot file. units is supported by PhysicalParticles: uSI, uCGS, uAstro, uGadget2, nothing. fileunits is the internal units in the file, and will be converted to units while reading the file.

AstroIO.read_gadget2_posFunction
read_gadget2_pos(filename::AbstractString, units, fileunits = uGadget2)

Only read position block and return a StructArray.

AstroIO.write_gadget2Function

writegadget2(filename::AbstractString, header::HeaderGadget2, data::AbstractArray, units = uGadget2; format2 = true, kw...) writegadget2(filename::AbstractString, data, units = uGadget2; kw...)

Write particle data to file. units are supported by PhysicalParticles: uSI, uCGS, uAstro, uGadget2, nothing. Gadget2 header is automatedly generated if not provided.

Keywords

  • format2 = true: if true, write in format-2 of Gadget2 snapshot
  • acc::Bool = false : write acceleration data
  • pot::Bool = false : write potential data
AstroIO.write_gadget2_format2Function
write_gadget2_format2(filename::AbstractString, header::HeaderGadget2, data::AbstractArray, units = uGadget2; kw...)
write_gadget2_format2(filename::AbstractString, data, units = uGadget2; kw...)

Write particle data to format-2 Gadget2 snapshot file. units are supported by PhysicalParticles: uSI, uCGS, uAstro, uGadget2, nothing. Gadget2 header is automatedly generated if not provided.

Keywords

  • acc::Bool = false : write acceleration data
  • pot::Bool = false : write potential data
Missing docstring.

Missing docstring for load(::Stream{format"Gadget2"}). Check Documenter's build log for details.

Missing docstring.

Missing docstring for save(::Stream{format"Gadget2"}). Check Documenter's build log for details.

JLD2

Missing docstring.

Missing docstring for read_jld. Check Documenter's build log for details.

Missing docstring.

Missing docstring for read_gadget2_jld. Check Documenter's build log for details.

Missing docstring.

Missing docstring for write_jld. Check Documenter's build log for details.

Missing docstring.

Missing docstring for write_gadget2_jld. Check Documenter's build log for details.

Tools

AstroIO.renamesuffixsFunction
function renamesuffixs(folder::AbstractString, namebase::AbstractString, suffix::AbstractString)

Replace the end of all files whose name contain namebase with suffix.

Example

For files test_1.middle.txt and test_2.middle.txt, with command

renamesuffixs("./", "test", ".csv")

we will get test_1.middle.csv and test_2.middle.csv

AstroIO.renamereplaceFunction
function renamereplace(folder::AbstractString, old::AbstractString, new::AbstractString; kw...)

Replace string old in all files to new. Keywords kw... are passed to replace