Commit d4c75d0b authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Sat May 25 00:00:52 EDT 2019

parent f3fdaa5a
......@@ -13,16 +13,13 @@ import cjs
class Ibtracs:
''' This class uses IBTrACS data. '''
def __init__(
self, epoch='last3years',
inpath='~/data/ibtracs/v04r00/IBTrACS.last3years.v04r00.nc'):
def __init__(self, inpath='since1980'):
epochs = [ 'last3years', 'All', 'since1980' ]
if inpath in epochs:
self.inpath = ( '~/data/ibtracs/v04r00/IBTrACS.' + epochs
self.inpath = ( '~/data/ibtracs/v04r00/IBTrACS.' + inpath
+ '.v04r00.nc' )
else:
self.inpath = inpath
self.inpath = inpath
self.ds = xr.open_dataset(self.inpath)
def find_tropical(self, thresh=35, keep_subtropical=True):
......@@ -48,8 +45,15 @@ class Ibtracs:
is_strong = self.ds.usa_wind == lmi
nstrong = np.sum(is_strong, axis=1)
is_eligible = is_main & is_tropical & is_strong
neligible = np.sum(is_eligible, axis=1)
print(np.c_[self.ds.sid.values, nstrong, neligible])
ind_eligible = np.argmax(is_eligible,1)
retval = is_eligible
retval = False
for i,j in enumerate(ind_eligible):
if curr_any:
first_ind = list(is_eligible[i,:]).index(True)
is_eligible[i,first_ind+1:] = False
print(np.c_[self.ds.sid.values[i], nstrong[i], first_ind])
# print(np.c_[self.ds.sid.values[is_eligible], nstrong[is_eligible], any_eligible[is_eligible]])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment