mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-12 05:38:42 +00:00
Add monopole to VF (#136)
* Add monopole sampling * Add monopole * Update script * Bring back zmax * Add monopole * Add condition in case division by 0 * Add monopole to field * Update nb * Update script * Update scripts * Simplify docs
This commit is contained in:
parent
43ebf660ee
commit
68fbd594cd
8 changed files with 161 additions and 91 deletions
File diff suppressed because one or more lines are too long
|
@ -43,6 +43,24 @@ def read_enclosed_density(simname):
|
|||
return r, overdensity
|
||||
|
||||
|
||||
def read_enclosed_monopole(simname, rmax=155):
|
||||
fname = join(FDIR, f"enclosed_mass_{simname}.npz")
|
||||
|
||||
if exists(fname):
|
||||
data = np.load(fname)
|
||||
else:
|
||||
raise FileNotFoundError(f"File {fname} not found.")
|
||||
|
||||
r = data["distances"]
|
||||
vmono = data["cumulative_velocity_mono"]
|
||||
|
||||
mask = r < rmax
|
||||
r = r[mask]
|
||||
vmono = vmono[..., mask]
|
||||
|
||||
return r, vmono
|
||||
|
||||
|
||||
def read_enclosed_flow(simname):
|
||||
fname = join(FDIR, f"enclosed_mass_{simname}.npz")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue