From 98f2b772cafab0834420ee8eb4f7548d1a1068b7 Mon Sep 17 00:00:00 2001
From: Bruce Flynn <brucef@ssec.wisc.edu>
Date: Mon, 31 Aug 2009 18:31:28 +0000
Subject: [PATCH] modified linearConvert to support numpy arrays.
---
metobs/data/__init__.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/metobs/data/__init__.py b/metobs/data/__init__.py
index d955761..6dc77a1 100644
--- a/metobs/data/__init__.py
+++ b/metobs/data/__init__.py
@@ -1,4 +1,6 @@
"""Functions for calculating the dervied data.
+
+All linear conversion support ``numpy.ndarray`` objects.
"""
__version__ = '$Revision: 1.15 $'
#$Source: /cvsroot/TOOLS/dev/metobs/python/data/metobs/data/__init__.py,v $
@@ -237,7 +239,7 @@ def linearConvert(data, factor=1, offset=0):
>>> linearConvert(1, 90, 10)
100.0
"""
- return float(data) * factor + offset
+ return data * float(factor) + offset
def c2f (val):
"""Degrees celsius to fahrenheit.
--
GitLab