From 2664924b55c4699c9de2593657258f1b0c9c4711 Mon Sep 17 00:00:00 2001 From: "Mads M. Pedersen" <mmpe@dtu.dk> Date: Wed, 19 Jul 2017 10:10:50 +0200 Subject: [PATCH] rename shear coordinates to uvw in shear_file.py --- wetb/hawc2/shear_file.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wetb/hawc2/shear_file.py b/wetb/hawc2/shear_file.py index 94d5deb..7c82cb1 100644 --- a/wetb/hawc2/shear_file.py +++ b/wetb/hawc2/shear_file.py @@ -15,28 +15,28 @@ standard_library.install_aliases() import numpy as np import os -def save(filename, y_coordinates, z_coordinates, u=None, v=None, w=None): +def save(filename, x_coordinates, z_coordinates, u=None, v=None, w=None): """ Parameters ---------- filename : str filename - y_coordinates : array_like + x_coordinates : array_like lateral coordinates z_coordinates : array_like vertical coordinates u : array_like, optional shear_u component, normalized with U_mean\n - shape must be (#z_coordinates, #y_coordinates) or (#z_coordinates,) + shape must be (#z_coordinates, #x_coordinates) or (#z_coordinates,) v : array_like, optional shear_v component, normalized with U_mean\n - shape must be (#z_coordinates, #y_coordinates) or (#z_coordinates,) + shape must be (#z_coordinates, #x_coordinates) or (#z_coordinates,) w : array_like, optional shear_w component, normalized with U_mean\n - shape must be (#z_coordinates, #y_coordinates) or (#z_coordinates,) + shape must be (#z_coordinates, #x_coordinates) or (#z_coordinates,) """ - shape = (len(z_coordinates), len(y_coordinates)) + shape = (len(z_coordinates), len(x_coordinates)) vuw = [v, u, w] for i in range(3): if vuw[i] is None: @@ -56,12 +56,12 @@ def save(filename, y_coordinates, z_coordinates, u=None, v=None, w=None): os.makedirs(os.path.dirname(filename))#, exist_ok=True) with open(filename, 'w', encoding='utf-8') as fid: fid.write(" # autogenerated shear file\n") - fid.write(" %d %d\n" % (len(y_coordinates), len(z_coordinates))) + fid.write(" %d %d\n" % (len(x_coordinates), len(z_coordinates))) for i, l in enumerate(['v', 'u', 'w']): fid.write(" # shear %s component\n " % l) fid.write("\n ".join([" ".join(["%.10f" % v for v in r ]) for r in vuw[i]])) fid.write("\n") - for yz, coor in (['y', y_coordinates], ['z', z_coordinates]): + for yz, coor in (['v', x_coordinates], ['w', z_coordinates]): fid.write(" # %s coordinates\n " % yz) fid.write("\n ".join("%.10f" % v for v in coor)) fid.write("\n") -- GitLab