Skip to content

Commit

Permalink
Merge pull request #32 from chowland/plane_mean_read
Browse files Browse the repository at this point in the history
Add reading of mean planes to afidtools
  • Loading branch information
chowland authored Oct 18, 2022
2 parents 6e0711e + 3003212 commit d8f4f32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Choose the machine being used
# Options: PC_GNU, PC_INTEL, (i)SNELLIUS, IRENE, MARENOSTRUM, SUPERMUC
MACHINE=IRENE_SKL
MACHINE=PC_GNU
# Modules required for each HPC system as follows:
# SNELLIUS: 2021 foss/2021a HDF5/1.10.7-gompi-2021a
# iSNELLIUS: 2021 intel/2021a FFTW/3.3.9-intel-2021a HDF5/1.10.7-iimpi-2021a
Expand Down
12 changes: 12 additions & 0 deletions tools/afidtools/afidtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ def read_cut(folder, var, idx, plane):
A = np.array(f[varname][()])
return A

def read_plane_mean(folder, var, idx, plane):
"""
Returns a 2D plane of sample number `idx` of the variable `var`.
`plane` can be 'y' or 'z' and specifies which dimension
is averaged over to obtain the plane. `folder` specifies the root directory
of the simulation.
"""
varname = var+"/"+"%05d" % idx
with h5py.File(folder+"/outputdir/flowmov/movie_"+plane+"mean.h5","r") as f:
A = np.array(f[varname][()])
return A

def continua_master_from_input(folder, time=0.0):
"""
This function generates the file `continua_master.h5` needed to run
Expand Down

0 comments on commit d8f4f32

Please sign in to comment.