josephhardinee / PyDSD

Python Library for working with disdrometer data.
GNU Lesser General Public License v2.1
45 stars 33 forks source link

calculate_R_Zh_relationship call error #70

Closed aamatthews closed 6 years ago

aamatthews commented 6 years ago

I ran dsd.calculate_R_Zh_relationship() and got the following error:

TypeError Traceback (most recent call last)

in () ----> 1 dsd.calculate_R_Zh_relationship() /Users/matt493/PyDSD/pydsd/DropSizeDistribution.pyc in calculate_R_Zh_relationship(self) 439 440 popt, pcov = expfit( --> 441 np.power(10, 0.1 * self.fields["Zh"]["data"][self.rain_rate["data"] > 0]), 442 self.fields["rain_rate"]["data"][self.fields["rain_rate"]["data"] > 0], 443 ) TypeError: 'NoneType' object has no attribute '__getitem__' It seems this is occurring because self.rain_rate doesn't exist. It is now in the "fields", so should be called by: self.fields['rain_rate']['data'] instead.
aamatthews commented 6 years ago

I should add, the call to rain_rate is correct in line 442, but not in 441.

josephhardinee commented 6 years ago

This is fixed by PR #72. Closing.