add a slot for variable name to save file name format
This commit is contained in:
parent
e13b4a928f
commit
342efef345
1 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# coding: utf-8
|
||||
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -19,6 +20,7 @@ params = vars(args)
|
|||
# Parameters
|
||||
xidx = int(params["xindex"])
|
||||
vfilename = params["variable"]
|
||||
vname = os.path.splitext(os.path.basename(vfilename))[0]
|
||||
|
||||
nbins = int(params["nbins"])
|
||||
boundary = float(params["boundary"])
|
||||
|
|
@ -104,4 +106,4 @@ arr_dict["cmean"] = np.asarray(cmean)
|
|||
arr_dict["bins"] = np.asarray(bin_edges)
|
||||
arr_dict["count"] = np.asarray(count)
|
||||
|
||||
np.savez("cmean_u_given_c_{:03d}".format(xidx), **arr_dict)
|
||||
np.savez("cmean_{}_given_c_{:03d}".format(vname, xidx), **arr_dict)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue