diff --git a/requirements.txt b/requirements.txt index 1c12bab28021d3dd10594cea6cb59de041bd0684..28900c3b2c3fd7621a4492e6c038b19a08d33393 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,5 @@ h5py pandas tables future +paramiko diff --git a/wetb/hawc2/simulation.py b/wetb/hawc2/simulation.py index 79b2c198db1058c7f7b72e25f96cbe680e25f411..e5a8d2b9db5de4b6c087ed95e292a39eb76e7240 100755 --- a/wetb/hawc2/simulation.py +++ b/wetb/hawc2/simulation.py @@ -635,7 +635,7 @@ cp -R . /scratch/$USER/$PBS_JOBID cd /scratch/$USER/$PBS_JOBID pwd echo "---------------------" -%s -c "from wetb.hawc2.cluster_simulation import ClusterSimulation;ClusterSimulation('.','%s', ('%s',%s'))" +%s -c "from wetb.hawc2.cluster_simulation import ClusterSimulation;ClusterSimulation('.','%s', ('%s','%s'))" echo "---------------------" echo $? echo "---------------------" diff --git a/wetb/utils/cluster_tools/ssh_client.py b/wetb/utils/cluster_tools/ssh_client.py index 3a2ed1781acba5fe69df5e3eab9aa57c226712e3..4a69aac132bef9a65a2af1b4f864a2b60f214d16 100644 --- a/wetb/utils/cluster_tools/ssh_client.py +++ b/wetb/utils/cluster_tools/ssh_client.py @@ -41,7 +41,7 @@ class SSHClient(object): return self.client def connect(self): - if self.password is None: + if self.password is None or self.password == "": raise IOError("Password not set") self.client = paramiko.SSHClient() self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) diff --git a/wetb/wind/shear.py b/wetb/wind/shear.py index 3d03110aff5b304807cd546c52e47153b73ffc80..4916a86ce087f06f6b0c892a36fb4b799496ad17 100644 --- a/wetb/wind/shear.py +++ b/wetb/wind/shear.py @@ -51,7 +51,7 @@ def fit_power_shear(z_u_lst): Parameters ---------- - z_u_lst : [(z_ref, u_z_ref), (z1, u_z1),...] + z_u_lst : [(z_ref, u_z_ref), (z1, u_z1)] - z_ref: Reference height\n - u_z_ref: Wind speeds or mean wind speed at z_ref - z1: another height @@ -73,7 +73,7 @@ def fit_power_shear(z_u_lst): return alpha def fit_power_shear_ref(z_u_lst, z_ref): - """Estimate power shear parameter, alpha, from two or morea specific reference height using polynomial fit. + """Estimate power shear parameter, alpha, from two or more specific reference heights using polynomial fit. Parameters ---------- @@ -99,7 +99,8 @@ def fit_power_shear_ref(z_u_lst, z_ref): """ def shear_error(x, z_u_lst, z_ref): alpha, u_ref = x - return np.sum([(np.mean(u) - u_ref * (z / z_ref) ** alpha) ** 2 for z, u in z_u_lst]) + return np.sum([(u - u_ref * (z / z_ref) ** alpha) ** 2 for z, u in z_u_lst]) + z_u_lst = [(z, np.mean(u)) for z, u in z_u_lst] return fmin(shear_error, (.1, 10), (z_u_lst, z_ref), disp=False)