Coding Mars: temperatures on the surface of Mars
OK, did you like coding with Scratch? Let us go to some more serious stuff: Python is a very widely used programming language in science. It is open-sourced, multiplatform very flexible. It is based on commands, but these are very close to human language and its use is quite intuitive.
TIME
4-6 hours
MATERIALS
- Computer
- Internet connection
- Python script provided (plot_GCM_temperature.py)
OBJETIVES
- Getting comfortable installing software
- Understanding the general flow of a program/script
- Making simple changes to code
- Interpreting a scientific plot
- Learning about seasons on Mars
- Learning about day/night temperatures on Mars
INSTRUCTIONS
1. Install Pycharm community free version https://www.jetbrains.com/pycharm/download.
2. Start Pycharm.
3. At the bottom of window, select “Python Packages”, search for ‘matplotlib’ and install the package, check to ensure the ‘numpy’ package is also installed
4. Select ‘open file’ and open the provided script
5. Check it out, there are some comments inside (lines starting with #) explaining what it is doing.
6. Run the script using the green triangle play button at the top right, a plot should appear.
Analyse the plot, what is it showing,
7. Discuss results, the difference between winter and summer, night and day.
8. Perhaps change the temperature scale from Kelvin to Celsius and compare with typical Earth values.
Mars’ orbit around the Sun.
EXTRA
Mars Facts
- Mars is tilted on its rotational axis (like the Earth), and its orbit around the Sun is more eccentric than the Earth
- One Martian day (called a sol) is 24.66 Earth hours long
- One Martian year is 668.6 sols long, which is 687 Earth days, almost 2 Earth years
- We use the term “Solar Longitude (Ls)” to describe the path of the planet around the Sun starting at Ls=0 marking the spring equinox in the Northern Hemisphere. So, Ls=90 is Northern summer, Ls=270 is Northern winter.
- Mars is furthest from the sun at aphelion, at Ls=71 and closest at perihelion, Ls=251.
What is a Global Climate or General Circulation Model (GCM)?
The surface temperatures provided in this exercise come from a computer simulation of the Martian atmosphere using a General Circulation Model (GCM), which is like a weather forecast model. We divide the globe into latitude, longitude and height boxes and compute the evolution of temperature, winds, and atmospheric composition in each box, and on the surface. The surface temperatures given were computed at the equator, at longitude 0 degrees.
The Mars’ atmosphere divided into grid boxes.
Mars’ topography, the star marks the point where the simulated temperatures are from.
You have managed to complete all of the experiments! This is the end of your trip. There is a message for you from Mars.
Download the instructions for this experiment in Spanish, French and Dutch
Date:
30 de agosto de 2022