Skip to content
Snippets Groups Projects
Commit 4596a88c authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 134bbe54
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ from datetime import timezone
from metpy.units import units
from metpy.calc import thickness_hydrostatic
from collections import namedtuple
import os
LatLonTuple = namedtuple('LatLonTuple', ['lat', 'lon'])
......@@ -18,6 +19,22 @@ def get_time_tuple_utc(timestamp):
return dt_obj, dt_obj.timetuple()
def add_time_range_to_filename(pathname, tstart, tend):
dt_obj, _ = get_time_tuple_utc(tstart)
str_start = dt_obj.strftime('%Y%m%d%H')
dt_obj, _ = get_time_tuple_utc(tend)
str_end = dt_obj.strftime('%Y%m%d%H')
filename = os.path.split(pathname)[1]
w_o_ext, ext = os.path.splitext(filename)
filename = w_o_ext+'_'+str_start+'_'+str_end+ext
path = os.path.split(pathname)[0]
path = path+'/'+filename
return path
def haversine_np(lon1, lat1, lon2, lat2):
"""
Calculate the great circle distance between two points
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment