+# other miscellaneous routines
+def setup_time_values(station):
+ """establish time bounds of data request(s)"""
+
+ # default timezone to UTC (for MesoWest)
+ tz = pytz.utc
+
+ # but for NRCS, use the config-specified timezone
+ if station['provider'] == 'nrcs':
+ tz = station['tz']
+
+ # floor time to nearest hour
+ date_time = datetime.datetime.now(tz=tz)
+ end_date = date_time - datetime.timedelta(minutes=date_time.minute % 60,
+ seconds=date_time.second,
+ microseconds=date_time.microsecond)
+ begin_date = end_date - datetime.timedelta(hours=3)
+ return (begin_date, end_date)
+
+def f_to_c(f):
+ """convert Fahrenheit to Celsius"""
+ return (float(f) - 32) * 5.0/9.0
+
+def in_to_cm(inches):
+ """convert inches to centimetrs"""
+ return float(inches) * 2.54
+
+def in_to_mm(inches):
+ """convert inches to millimeters"""
+ return (float(inches) * 2.54) * 10.0
+
+def ms_to_mph(ms):
+ """convert meters per second to miles per hour"""
+ return ms * 2.236936
+
+def kn_to_mph(kn):
+ """convert knots to miles per hour"""
+ return kn * 1.150779
+