mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-12 05:38:42 +00:00
Particle match & file system & phase space (#11)
* 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
This commit is contained in:
parent
c748c87e45
commit
161c27d995
22 changed files with 1443 additions and 4178 deletions
22
JuliaCSiBORGTools/src/JuliaCSiBORGTools.jl
Normal file
22
JuliaCSiBORGTools/src/JuliaCSiBORGTools.jl
Normal file
|
@ -0,0 +1,22 @@
|
|||
# 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.
|
||||
|
||||
module JuliaCSiBORGTools
|
||||
|
||||
include("./particles_match.jl")
|
||||
|
||||
export halo_parts
|
||||
|
||||
end # module JuliaCSiBORGTools
|
29
JuliaCSiBORGTools/src/particles_match.jl
Normal file
29
JuliaCSiBORGTools/src/particles_match.jl
Normal file
|
@ -0,0 +1,29 @@
|
|||
# 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.
|
||||
|
||||
|
||||
"""
|
||||
halo_parts(clumpid::Int, partids::Vector{<:Int}, clumpids::Vector{<:Int})
|
||||
|
||||
Return particle IDs belonging to a given clump.
|
||||
|
||||
# Arguments
|
||||
- `clumpid::Integer`: the ID of the clump.
|
||||
- `partids::Vector{<:Integer}`: vector of shape `(n_particles,)` with the particle IDs.
|
||||
- `clumpids::Vector{<:Integer}`: vector of shape `(n_particles, )` with the particles' clump IDs.
|
||||
"""
|
||||
function halo_parts(clumpid::Integer, partids::Vector{<:Integer}, clumpids::Vector{<:Integer})
|
||||
return partids[clumpids .== clumpid]
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue