Big Sur 2021-09-25 thru 26
Photos
Hosted on Google Photos, displayed in carousel below using the Public Album tool created by Pavel.
## GPS Dataimport pandas as pd
from gpx_converter import Converter
from haversine import haversine, Unit
files = [
'big-sur-2021-09-25-thru-26/salmon-creek-station-to-north-buckeye.gpx',
'big-sur-2021-09-25-thru-26/north-buckeye-camp-to-villa-creek-camp.gpx',
'big-sur-2021-09-25-thru-26/track-92621-100917am.gpx'
]
Cleanse and Transform GPS Data
def transform_gpx_data(filename):
df = (Converter(input_file=filename)
.gpx_to_dataframe())
df = df[df['time'].dt.day == df['time'].dt.day.values[0]].reset_index(drop=True)
df['time'] = df['time'].apply(lambda x: x.tz_convert('US/Pacific'))
df['seconds_delta'] = (((df['time'].shift(-1)-df['time'])
.fillna(pd.Timedelta(seconds=0))
.astype(int)/1000000000)
.astype(int))
df['human_date'] = df['time'].dt.strftime('%Y-%m-%d')
df['human_time'] = df['time'].dt.strftime('%I:%M:%S %p')
df['altitude_feet'] = round(df['altitude'] * 3.280839895).astype('int')
for i in range(df.shape[0]-1):
start = df.at[i, 'latitude'], df.at[i, 'longitude']
end = df.at[i+1, 'latitude'], df.at[i+1, 'longitude']
distance = round(haversine(start,
end,
unit=Unit.FEET),1)
df.at[i, 'distance_feet'] = distance
altitude_change = df.at[i+1, 'altitude_feet'] - df.at[i, 'altitude_feet']
df.at[i, 'altitude_change'] = altitude_change
df['speed_mph'] = ((df['distance_feet'] / df['seconds_delta']) * (3600/5280)).round(1)
df = df[['time', 'human_date', 'human_time', 'seconds_delta',
'latitude', 'longitude', 'altitude', 'altitude_feet',
'distance_feet', 'speed_mph',
'altitude_feet','altitude_change']].copy()
return df
for file in files:
print(file)
d = transform_gpx_data(file)
string = '''{}, {} - {}
Start: ({}, {}), End: ({}, {})
{} GPS datapoints
{} duration
{:3.2f} miles @ {:3.1f} avg MPH
{:3.0f}/{:3.0f} feet total/net elevation change'''.format(
d['human_date'].min(),
d.iloc[0]['human_time'],
d.iloc[d.shape[0]-1]['human_time'],
d.iloc[0]['latitude'],
d.iloc[0]['longitude'],
d.iloc[d.shape[0]-1]['latitude'],
d.iloc[d.shape[0]-1]['longitude'],
d.shape[0],
str(d['time'].max()-d['time'].min())[7:12],
d['distance_feet'].sum()/5280,
d['speed_mph'].mean(),
d['altitude_change'].abs().sum(),
d['altitude_change'].sum())
print(string + '\n')
big-sur-2021-09-25-thru-26/salmon-creek-station-to-north-buckeye.gpx
2021-09-25, 11:43:21 AM - 01:49:30 PM
Start: (35.815729, -121.359017), End: (35.840818, -121.378402)
765 GPS datapoints
02:06 duration
4.01 miles @ 2.2 avg MPH
4932/1800 feet total/net elevation change
big-sur-2021-09-25-thru-26/north-buckeye-camp-to-villa-creek-camp.gpx
2021-09-25, 02:47:02 PM - 04:10:51 PM
Start: (35.840754, -121.378376), End: (35.858852, -121.384693)
630 GPS datapoints
01:23 duration
3.01 miles @ 2.5 avg MPH
3623/-919 feet total/net elevation change
big-sur-2021-09-25-thru-26/track-92621-100917am.gpx
2021-09-26, 10:09:20 AM - 01:13:23 PM
Start: (35.859059, -121.384381), End: (35.815803, -121.358766)
1282 GPS datapoints
03:04 duration
6.93 miles @ 2.6 avg MPH
7259/-1139 feet total/net elevation change