Skip to content

Reading the statistics #143

Discussion options

You must be logged in to vote

Hello,

https://github.com/fschuch/xcompact3d_toolbox/
or

#! /usr/bin/env python3
#
import numpy as np
import argparse
#
parser = argparse.ArgumentParser(description='Print min / max and average in space.')
parser.add_argument('files', nargs='+', help='list of .bin files')
args = parser.parse_args()
#
# Incompact3d grid
#
nx = 128
ny = 65
nz = 64
f = open("yp.dat")
yp = np.fromfile(f, sep='\n')
f.close()
#
for binfile in args.files:
    # Read 3D binary file
    f = open(binfile, 'rb')
    data = np.fromfile(f) #, '<f4')
    f.close()
    # Print the file name and min / max
    print("File : " + binfile)
    print("   Min : " + str(np.min(data)))
    print("   Max : " + str(np.max(data)))
…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@pbartholomew08
Comment options

@pbartholomew08
Comment options

@pbartholomew08
Comment options

@pbartholomew08
Comment options

@dineshkumarreddyg36
Comment options

Answer selected by mathrack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants