sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
221 stars 110 forks source link

create_profile problem using U and V instead of wspd and wdir #78

Closed keltonhalbert closed 8 years ago

keltonhalbert commented 8 years ago

I've come across an interesting error in using create_profile (with arg profile="raw")when adding a new data source.

When writing the WRF-ARW decoder, the program crashes if u,v are passed, but does not crash if wspd, wdir are passed. The error returned has to do with self.u and self.v still being None when asserting the length of the arrays, causing a "length of unsized" error.

I have not managed to locate the point of failure yet, but I think it has to do with the copy function and the passing of arguments to the Convective Profile object. I think it's possible that the arguments "wdir, wspd" are being passed through the copy and it enters the if statement regarding that before it does the if statement for u,v, causing it to set all wind values to None.

keltonhalbert commented 8 years ago

I've finally tracked down the problem - no kwargs were being passed to the copy method, which was how it was checking whether or not U/V or WSPD/WDIR should be passed on when copying a profile. I changed the logic to check for whether or not U/V is None instead of checking an empty list of kwargs.

The changes have been pushed to the Andover branch.