# ANN: PhaseSpaceIO

**URL:** <https://discourse.julialang.org/t/ann-phasespaceio/16250>\
**Category:** Community\
**Tags:** package, announcement\
**Created:** [October 12, 2018, 7:12pm UTC](https://discourse.julialang.org/t/ann-phasespaceio/16250 "2018-10-12T19:12:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [October 12, 2018, 7:12pm UTC](https://discourse.julialang.org/t/ann-phasespaceio/16250/1 "2018-10-12T19:12:55Z")

</div>

I just tagged an initial release of [PhaseSpaceIO](https://github.com/jw3126/PhaseSpaceIO.jl). Its a package, that allows to read and write [IAEA](https://www-nds.iaea.org/phsp/phsp.htmlx) phase space files. Performance is roughly the same as the [IAEA C++ implementation](https://www-nds.iaea.org/phsp/software/iaea_phsp_Sept2013.zip), usage is as follows:

```julia
julia> using PhaseSpaceIO

julia> path = joinpath(dirname(pathof(PhaseSpaceIO)), "..", "test", "assets","some_file.IAEAphsp");

julia> ps = iaea_iterator(collect,path)
1-element Array{Particle{0,1},1}:
 Particle(typ=photon, E=1.0, weight=2.0, x=3.0, y=4.0, z=5.0, u=0.53259337, v=0.3302265, w=-0.7792912, new_history=true, extra_floats=(), extra_ints=(13,))

julia> dir = mkpath(tempname())
"/tmp/julia7uigbI"

julia> readdir(dir)
0-element Array{String,1}

julia> path = joinpath(dir, "hello")
"/tmp/julia7uigbI/hello"

julia> iaea_writer(path, RecordContents{0,1}()) do w
           for p in ps
               write(w,p)
           end
       end

julia> readdir(dir)
2-element Array{String,1}:
 "hello.IAEAheader"
 "hello.IAEAphsp"  

```
