During the rocket campaign we will be using the programming language Python to process and analyze the recorded data, and ahead of the campaign we will use it to simulate the rocket trajectory. A full course in Python programming is outside the scope of this article, but here we have gathered some useful resources (all links open in a new tab):
- For beginners, the official Python page has a wiki-page with some online resources and suggested reading. We will be using Python 3.
- For those familiar with MATLAB, Perl, Java, C or similar, programming in Python is mostly just a matter of getting used to another syntax. Examples include: lines need not be terminated with semicolons; whitespace indentation is used to delimit blocks, rather than curly brackets or keywords; and variables are not directly assigned a type. However, as detailed by Trey Hunner, Python has a somewhat idiosyncratic approach to for-loops.
- We will be using the free open-source environments Spyder to write, compile and run our code, but you are free to use whatever integrated development environment (IDE) or editor you might choose.
- Numfys.net is an excellent resource for numerical physics projects written in Python. The site is run by the Department of Physics at NTNU (Norwegian University of Science and Technology).
Lastly, some references to popular and/or helpful libraries:
- Math. Provides common mathematical constants like pi and e ( and Euler’s constant, respectively), as well as the trigonometric functions, logarithms and the square root.
- Matplotlib. Useful for plotting.
- NumPy. Introduces multidimensional arrays into Python, and extends the definition of many functions from the math-library to accept arrays as arguments.
- SciPy.Integrate. Useful for numerical calculations.
- Pandas. Useful for handling large, labelled datasets. If you are new to pandas, the user guide might provide a helpful introduction.
- Dask. Used for parallel computing. In our case, this will only be used to minimize memory usage during data loading.
This article is part of a pre-course program used by Andøya Space Education in Fly a Rocket! and similar programs.