With rounds of rain continually drenching the mid-Atlantic recently and a stormy week on tap for the Midwest, some may be wondering if the weather has the potential to affect their July 4th festivities.

Unless the conditions are really drenching, fireworks can still be shot in the rain. The firework materials are placed in waterproof bags inside of tightly sealed canisters that allow the explosion to take place before they get too wet. Many communities are still able to hold their firework displays in the rain, provided the viewers don’t mind getting a little wet.

Where danger comes in, however, is if the rain is accompanied by a thunderstorm or lightning. On average, 54 people a year die from lightning strikes, most of which occur because people try to stay out in a storm rather than cancel outdoor plans. It’s important for people to heed warnings and head indoors if a thunderstorm starts to roll though, no matter what kind of activities you are taking part in.

Factors that can have an impact on the displays themselves range from pressure to temperature, to the wind. Fireworks release smoke when they go off, which is why the right weather is needed for a clear display. A temperature inversion, for example, can create an obstructed view of fireworks. Typically, temperatures decrease as you get higher into the atmosphere. The sun’s heat is concentrated on the ground, sending warm air up. The heat then starts to dissipate as it gets too high, resulting in cooler temperatures away from the Earth’s surface.