Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliaastrosim/astroio.jl
I/O interface for astrophysical simulation codes
https://github.com/juliaastrosim/astroio.jl
astro astrophysical-simulation-codes fileio
Last synced: about 2 months ago
JSON representation
I/O interface for astrophysical simulation codes
- Host: GitHub
- URL: https://github.com/juliaastrosim/astroio.jl
- Owner: JuliaAstroSim
- License: gpl-3.0
- Created: 2019-12-04T13:41:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-07T03:08:53.000Z (7 months ago)
- Last Synced: 2024-11-15T20:30:23.159Z (3 months ago)
- Topics: astro, astrophysical-simulation-codes, fileio
- Language: Julia
- Homepage:
- Size: 703 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# AstroIO.jl
I/O interface for astrophysical simulation codes
[![codecov](https://codecov.io/gh/JuliaAstroSim/AstroIO.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaAstroSim/AstroIO.jl)
[![][docs-dev-img]][docs-dev-url]## Installation
```julia
]add AstroIO
```or
```julia
using Pkg; Pkg.add("AstroIO")
```or
```julia
using Pkg; Pkg.add("https://github.com/JuliaAstroSim/AstroIO.jl")
```To test the Package:
```julia
]test AstroIO
```## Documentation
- [**Dev**][docs-dev-url] — *documentation of the in-development version.*
[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://juliaastrosim.github.io/AstroIO.jl/devFor beginners, it is highly recommended to read the [documentation of PhysicalParticles.jl](https://juliaastrosim.github.io/PhysicalParticles.jl/dev/).
## Usage
```julia
using AstroIO
```### Gadget2
Suffixes `gadget2`, `Gadget2`, `GADGET2` are supported
```julia
header, data = read_gadget2("snapshot.gadget2", uAstro)write_gadget2("output.Gadget2", header, data)
# If only data provided, a default header would be generated
write_gadget2("output.GADGET2", data)
```Supported units: `uAstro`, `uGadget2`, `uSI`, `uCSG`.
### Use FileIO interfaces
```julia
header, data = load("snapshot.gadget2")
save("FileIO.gadget2", header, data)
```### Output CSV
```julia
write_csv("output", csv) # No suffix
```### Save and load with JLD2
```julia
write_gadget2_jld("output.jld2", header, data, uGadget2)
write_jld("NoHeader.jld2", data)header, data = read_gadget2_jld("output.jld2")
data = read("NoHeader.jld2")# Or simply use JLD2 interfaces
@load "NoHeader.jld2"
```## Package ecosystem
- Basic data structure: [PhysicalParticles.jl](https://github.com/JuliaAstroSim/PhysicalParticles.jl)
- File I/O: [AstroIO.jl](https://github.com/JuliaAstroSim/AstroIO.jl)
- Initial Condition: [AstroIC.jl](https://github.com/JuliaAstroSim/AstroIC.jl)
- Parallelism: [ParallelOperations.jl](https://github.com/JuliaAstroSim/ParallelOperations.jl)
- Trees: [PhysicalTrees.jl](https://github.com/JuliaAstroSim/PhysicalTrees.jl)
- Meshes: [PhysicalMeshes.jl](https://github.com/JuliaAstroSim/PhysicalMeshes.jl)
- Plotting: [AstroPlot.jl](https://github.com/JuliaAstroSim/AstroPlot.jl)
- Simulation: [ISLENT](https://github.com/JuliaAstroSim/ISLENT)## Contribution
Welcome issues and PRs. Need help for other snapshot formats.