mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-23 03:58:02 +00:00
161c27d995
* Create file system * add doc * add n_sim n_snap directly to paths * Move things to a single particle reader for consistency * add docstring * add srdcir, dumpdir and mmain_path * make boxunits work with paths * switch to using paths * add tempdumpdir * rm dependence on old functions * rm comment * rm unused import * go back to all imports * fix import bug * rm dependence on old functions * modernize code! * fix typo * fix typo * update fits to new data structureing * change docs * add julia repo * add setup * add install commands * ignore install files * add array flattening * update dependene * add positions reader * update manifest and projects * add func * update gitignore * pos matching progress * move file * rm comment * add velocities getter * fix bug * fix name bug * fix path bug * fix args func * add redshift calculation to catalogues * add shortcut to set n_sim and n_snap * if cond bug * add the cosine similarity * add verbosit iterator * add docs * update README * update README * update README
49 lines
1.7 KiB
Julia
49 lines
1.7 KiB
Julia
# Copyright (C) 2022 Richard Stiskalek
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by the
|
|
# Free Software Foundation; either version 3 of the License, or (at your
|
|
# option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
# Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License along
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
using Pkg: activate, build
|
|
activate("../JuliaCSiBORGTools/")
|
|
|
|
using JuliaCSiBORGTools
|
|
using NPZ: npzread
|
|
using PyCall: pyimport
|
|
csiborgtools = pyimport("csiborgtools")
|
|
|
|
verbose = true
|
|
paths = csiborgtools.read.CSiBORGPaths()
|
|
nsims = paths.ic_ids[:1]
|
|
|
|
for nsim in nsims
|
|
nsnap_min = convert(Int64, paths.get_minimum_snapshot(nsim))
|
|
nsnap_max = convert(Int64, paths.get_maximum_snapshot(nsim))
|
|
|
|
# Get the maximum snapshot properties
|
|
verbose ? println("Loading snapshot $nsnap_max from simulation $nsim") : nothing
|
|
pids, ppos, pmass, clumpids = csiborgtools.read.get_positions(nsim, nsnap_max, get_clumpid=true, verbose=false)
|
|
|
|
println("Sizes are: ")
|
|
println(size(pids))
|
|
println(size(ppos))
|
|
println(size(pmass))
|
|
|
|
|
|
|
|
# # Get the minimum snapshot properties
|
|
# verbose ? println("Loading snapshot $nsnap_min from simulation $nsim") : nothing
|
|
# pids, ppos, pmass = csiborgtools.read.get_positions(nsim, nsnap_max, get_clumpid=false, verbose=false)
|
|
|
|
JuliaCSiBORGTools.halo_parts(0, partids, clumpids)
|
|
|
|
end
|