mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:58:02 +00:00
add the maximum snapshot
This commit is contained in:
parent
76349bab3f
commit
f33bf0c3b2
2 changed files with 18 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
from .readsim import (get_csiborg_ids, get_sim_path, get_snapshots, # noqa
|
||||
get_snapshot_path, read_info, nparts_to_start_ind, # noqa
|
||||
get_snapshot_path, get_maximum_snapshot, read_info, nparts_to_start_ind, # noqa
|
||||
open_particle, open_unbinding, read_particle, # noqa
|
||||
drop_zero_indx, # noqa
|
||||
read_clumpid, read_clumps, read_mmain, # noqa
|
||||
|
|
|
@ -106,6 +106,23 @@ def get_snapshots(simpath):
|
|||
return numpy.sort(snaps)
|
||||
|
||||
|
||||
def get_maximum_snapshot(simpath):
|
||||
"""
|
||||
Return the maximum snapshot of an IC realisation stored at `simpath`.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
simpath : str
|
||||
Path to the CSiBORG IC realisation.
|
||||
|
||||
Returns
|
||||
-------
|
||||
maxsnap : float
|
||||
The maximum snapshot.
|
||||
"""
|
||||
return max(get_snapshots(simpath))
|
||||
|
||||
|
||||
def get_snapshot_path(Nsnap, simpath):
|
||||
"""
|
||||
Get a path to a CSiBORG IC realisation snapshot.
|
||||
|
|
Loading…
Reference in a new issue