## Code

```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# convert nautical miles to kilometers
= 1.852
NMi2Km
# per wiki he graduated USMA in 1951 and by 1972 at retirement. I made up the graduation date
# he already had 3500 hours flying time per https://www.nationalaviation.org/our-enshrinees/aldrin-buzz/
# assume 9km average flight altitude (~30kft)
= pd.Timestamp('May 1, 1951 12:00:00 UTC')
AFstart = pd.Timestamp('July 1, 1971 12:00:00 UTC')
AFend = AFend - AFstart
AFdur = 9 * pd.Timedelta('3500 hours') / AFdur # spread flight hours over the whole AF career evenly
AFeffectiveAlt
# Gemini 12 https://en.wikipedia.org/wiki/Gemini_12
# assume mean orbital distance of apogee and perigee
= pd.Timestamp('November 11, 1966, 20:46:33 UTC')
G12start = pd.Timestamp('November 15, 1966, 19:21:04 UTC')
G12end = np.mean([160,270]) # already in km from wiki
G12meanAlt
# Apollo 11 https://airandspace.si.edu/sites/default/files/images/5317h.jpg
# https://history.nasa.gov/SP-4029.pdf
# Table 7.11 of https://www.hq.nasa.gov/alsj/a11/a11MIssionReport_1971015566.pdf
= 384400
MoonMeanDistKm = pd.Timestamp('July 16, 1969, 13:32:00 UTC')
A11liftoff = 100 * NMi2Km # this is rough
A11EarthOrbitAlt = A11liftoff + pd.Timedelta('2 hours 50 minutes')
A11TLI = A11liftoff + pd.Timedelta('26 hours 45 minutes')
A11MidcourseOut = 109475 * NMi2Km
A11MidcourseAlt = A11liftoff + pd.Timedelta('75 hours 50 minutes')
A11LunarInsert = A11liftoff + pd.Timedelta('135 hours 24 minutes')
A11TEI = A11liftoff + pd.Timedelta('195 hours 18 minutes')
A11splashdown # lets check to see if we need to do any detailed interpolation, or if mean is enough...
# print(109475 * NMi2Km / MoonMeanDistKm, (A11MidcourseOut - A11TLI) / (A11LunarInsert - A11MidcourseOut))
# > 0.5274393860561915 0.4872665534804754
# this is close enough to linear interpolation that I'm not going to bother with anything else
# so for the duration of the flight from earth to moon, just fill in 1/2 the lunar distance
= pd.date_range(start='January 20, 1930',end='November 10, 2022',freq='H',tz='UTC')
baidx = pd.Series(0,index=baidx)
BuzzAlt = AFeffectiveAlt
BuzzAlt.loc[AFstart:AFend] = G12meanAlt
BuzzAlt.loc[G12start:G12end] = A11EarthOrbitAlt
BuzzAlt.loc[A11liftoff:A11TLI] = MoonMeanDistKm / 2
BuzzAlt.loc[A11TLI:A11LunarInsert] = MoonMeanDistKm
BuzzAlt.loc[A11LunarInsert:A11TEI] = MoonMeanDistKm / 2
BuzzAlt.loc[A11TEI:A11splashdown]
#BuzzAlt.plot(logy=True, ylim=(1,1000000));
#plt.ylabel('kilometers');
#plt.xlabel('on this date');
#plt.title('Aldrin\'s altitude history - log scale');
#plt.annotate('Gemini 12', xy=(G12start,2*10**2), xycoords='data', xytext=(-55,0), textcoords='offset points');
#plt.annotate('Apollo 11', xy=(A11liftoff,4*10**5), xycoords='data', xytext=(5,0), textcoords='offset points');
print('\tWhen this post was first published in Feb 2020,\nAldrin\'s lifetime mean altitude was {:3.1f} km'.format(BuzzAlt[:'2020-02-02'].mean()))
print('\n\tNow (Nov 2022) Aldrin\'s lifetime mean altitude\nis {:3.1f} km and dropping \U0001F680\U0001F913'.format(BuzzAlt.mean()))
```

```
When this post was first published in Feb 2020,
Aldrin's lifetime mean altitude was 61.2 km
Now (Nov 2022) Aldrin's lifetime mean altitude
is 59.4 km and dropping 🚀🤓
```