Methods
Index
AstroIO.read_gadget2
AstroIO.read_gadget2_pos
AstroIO.renamereplace
AstroIO.renamesuffixs
AstroIO.write_gadget2
AstroIO.write_gadget2_format2
Gadget2
AstroIO.read_gadget2
— Functionread_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.
Keywords
- acc::Bool = false : read acceleration data if exist
- pot::Bool = false : read potential data if exist
AstroIO.read_gadget2_pos
— Functionread_gadget2_pos(filename::AbstractString, units, fileunits = uGadget2)
Only read position block and return a StructArray.
AstroIO.write_gadget2
— Functionwritegadget2(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_format2
— Functionwrite_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 for load(::Stream{format"Gadget2"})
. Check Documenter's build log for details.
Missing docstring for save(::Stream{format"Gadget2"})
. Check Documenter's build log for details.
JLD2
Missing docstring for read_jld
. Check Documenter's build log for details.
Missing docstring for read_gadget2_jld
. Check Documenter's build log for details.
Missing docstring for write_jld
. Check Documenter's build log for details.
Missing docstring for write_gadget2_jld
. Check Documenter's build log for details.
Tools
AstroIO.renamesuffixs
— Functionfunction 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.renamereplace
— Functionfunction renamereplace(folder::AbstractString, old::AbstractString, new::AbstractString; kw...)
Replace string old
in all files to new
. Keywords kw...
are passed to replace