Science projects with the Python MetPy library
How Do You Calculate Wind Chill?
The MetPy windchill
function returns a "feels like" temperature according to wind speed and ambient temperature. For example, an outside ambient temperature of 40°F with a wind of 20mph feels like 28°F:
>>> import metpy.calc >>> >>> temp = [40] * units.degF >>> wind = [20] * units.mph >>> metpy.calc.windchill(temp, wind, face_level_winds=True) <Quantity([28.42928573], 'degree_Fahrenheit')>
When the temperature starts going below -20°C, parents need to keep a close eye on their kids for frostbite.
Listing 5 calculates a wind chill curve (Figure 4) of -20°C by ambient temperature and wind. The code iterates between temperatures of 0°C and -45°C (line 12) and wind speeds of 1 to 60kph (line 14) and finds wind chills of -20°C (line 18).
Listing 5
A -20°C Wind Chill Curve
From the results, you can see that even if you have a nice ski day of -8°C, a high wind of 40kph will make the temperature feel like -20°C, a 12° drop.
Summary
MetPy didn't help me answer all of my kids' science questions, but it really helped with water and weather problems. If you have a budding meteorologist or chemical engineer in your house, take a look at the Python MetPy library.
Infos
« Previous 1 2
Buy this article as PDF
(incl. VAT)