Tropical storms and Python scripts – a far cry from Apollo or Mars, but so went the past few days at Johnson Space Center.
Houston was a beehive of preparation long before Tropical Storm Bill was more than a few cumulous clouds. Radio broadcasters preached preparation. Hourly emails described floods and electricity loss. I woke up half expecting Schlitterbahn in my living room, but besides heavy pockets of rainfall, reality fell thankfully short of the media’s prediction.
Most of the engineers on my floor decided to work from home to avoid Tuesday’s potential flooding, giving me some much needed time to review the Python scripts I will work with throughout the summer. Python is a high-level programming language present throughout the digital world. My engineering group uses it to build Mars mission simulations based on a hodge-podge of Fortran and C++ algorithms. Everything from a spacecraft’s shape to the Martian atmosphere is modeled in a Fortran and C++ library; it will eventually be my job to write Python scripts that call specific portions of this library to simulate how different spacecraft designs perform.
I’ve never coded in Python before, and it was definitely a shock when my engineering mentor started pulling up file after file coded exclusively in Python and told me I would soon build a Mars mission simulation based on the language. The engineers I work with are incredibly supportive however, and I’ve had as much help as I need while learning the language.
Tuesday I spent troubleshooting a group of Python files that simulate an Earth-Mars orbit transfer. My engineering group worked with an out-of-state professor to develop the files, and I ended up communicating with him via email throughout the day as we both tried to spot the source of error – somewhere buried in the lines of code is a mistake that makes the simulation miss its target orbit altitude by several thousand kilometers.
Searching code is slow work. A possible mistake is spotted, a few characters are changed or deleted, the code is re-compiled and the results are emailed back and forth before the process repeats itself. It can get repetitive and dull, but it is classic problem-solving, and if it brings humanity an inch closer to Mars then it is worth my time.
My primary goal is to get comfortable with Python and finally find the mistake in our orbit altitude files. It’s going to be a long week of rain and code, but most accomplishments are gritty and prolonged before they become fantastic and impactful.