Before going to sea, any sailor should check the marine weather forecast to check on different aspects of the weather including the direction and strength of the wind (wind speed).
The wind speed can be measured using different units such as mph (miles per hour), km/h (km per hour) but sailors tend to prefer to use knots. A knot represents a speed of 1 nautical mile per hour, and a nautical mile is exactly 1,852 meters!
The Beaufort wind force scale was introduced in 1805 by a Royal Navy officer, Francis Beaufort. It relates wind speeds to observed conditions at sea or on land. Nowadays, the scale contains thirteen values (from zero to twelve): A force 0 wind represents very calm wind conditions whereas a force 12 wind represents a Hurricane-force wind!
Here is the full Beaufort scale:
|Force||Description||Wind speed||Wave height||Sea conditions||Land conditions|
|0||Calm||< 1 knot||0 ft (0 m)||Sea like a mirror||Smoke rises vertically.|
|1||Light air||1–3 knots||0–1 ft||Ripples with appearance of scales are formed, without foam crests||Direction shown by smoke drift but not by wind vanes.|
|2||Light breeze||4–6 knots||1–2 ft||Small wavelets still short but more pronounced; crests have a glassy appearance but do not break||Wind felt on face; leaves rustle; wind vane moved by wind.|
|3||Gentle breeze||7–10 knots||2–4 ft||Large wavelets; crests begin to break; foam of glassy appearance; perhaps scattered white horses||Leaves and small twigs in constant motion; light flags extended.|
|4||Moderate breeze||11–16 knots||3.5–6 ft||Small waves becoming longer; fairly frequent white horses||Raises dust and loose paper; small branches moved.|
|5||Fresh breeze||17–21 knots||6–10 ft||Moderate waves taking a more pronounced long form; many white horses are formed; chance of some spray||Small trees in leaf begin to sway; crested wavelets form on inland waters.|
|6||Strong breeze||22–27 knots||9–13 ft||Large waves begin to form; the white foam crests are more extensive everywhere; probably some spray||Large branches in motion; whistling heard in telegraph wires; umbrellas used with difficulty.|
|28–33 knots||13–19 ft||Sea heaps up and white foam from breaking waves begins to be blown in streaks along the direction of the wind; spindrift begins to be seen||Whole trees in motion; inconvenience felt when walking against the wind.|
|34–40 knots||18–25 ft||Moderately high waves of greater length; edges of crests break into spindrift; foam is blown in well-marked streaks along the direction of the wind||Twigs break off trees; generally impedes progress.|
|9||Strong/severe gale||41–47 knots||23–32 ft||High waves; dense streaks of foam along the direction of the wind; sea begins to roll; spray affects visibility||Slight structural damage (chimney pots and slates removed).|
|48–55 knots||29–41 ft||Very high waves with long overhanging crests; resulting foam in great patches is blown in dense white streaks along the direction of the wind; on the whole the surface of the sea takes on a white appearance; rolling of the sea becomes heavy; visibility affected||Seldom experienced inland; trees uprooted; considerable structural damage.|
|11||Violent storm||56–63 knots||37–52 ft||Exceptionally high waves; small- and medium-sized ships might be for a long time lost to view behind the waves; sea is covered with long white patches of foam; everywhere the edges of the wave crests are blown into foam; visibility affected||Very rarely experienced; accompanied by widespread damage.|
|12||Hurricane force||≥ 64 knots||≥ 46 ft||The air is filled with foam and spray; sea is completely white with driving spray; visibility very seriously affected||Devastation.|
In this challenge we will write a python script that:
- lets the user enter a wind speed in the unit of their choice (mph, km/h, knot)
- converts this wind speed in knots and lookup the matching find force,
- looks up for the matching wind force from the Beaufort scale,
- outputs the wind force and both the matching sea and land conditions
You can complete the python code using the following trinket: