Commit 76f72583 authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Sat Apr 13 00:00:46 EDT 2019

parent 516d5688
"""
Print a string with a timestamp
"""
""" Library of Carl's python functions. """
__author__ = "Carl Schreck"
__email__ = "cjschrec@ncsu.edu"
......@@ -9,7 +7,8 @@ __license__ = "BSD-3.0"
import datetime
def printtime(message='',maxcols=55):
def tstamp(message='',maxcols=55):
""" Print a string with a timestamp. """
print( str(message).ljust(maxcols),
datetime.datetime.today().strftime(' | %F %T'))
""" Library of functions for accessing IBTrACS data """
__author__ = "Carl Schreck"
__email__ = "cjschrec@ncsu.edu"
__copyright__ = "Copyright 2019, North Carolina State University"
__license__ = "BSD-3.0"
import xarray as xr
import sys
sys.path.append('/home/carl/lib/python')
import cjs
class Ibtracs:
''' This class uses IBTrACS data. '''
def __init__(
self, epoch='last3years',
inpath='~/data/ibtracs/v04r00/IBTrACS.ALL.v04r00.nc'):
epochs = [ 'last3years', 'All', 'since1980' ]
if inpath in epochs:
self.inpath = ( '~/data/ibtracs/v04r00/IBTrACS.' + epochs
+ '.v04r00.nc' )
else:
self.inpath = inpath
self.inpath = inpath
self.dataset = xr.open_dataset(self.inpath)
def find_first_ind(self, thresh=35)
wind = self.dataset['usa_wind']
nature = self.dataset['nature']
track_type = self.dataset['track_type']
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