(CNN) Step out on a beach shore, up on a mountain peak, or into a sequoia grove, and many instinctively take the quintessential deep breath of fresh air. You know the one. The one where you breathe in so deeply through your nose that you feel your chest push up into your shoulders.

You might want to rethink that deep breath.

National parks have had similar ozone values to that of the 20 largest major cities in the US states from 1990-2014, according to a study published Wednesday in the journal Science Advances

"The most striking finding was how similar ozone levels were in parks to metropolitan areas," Ivan Rudik, co-author of the study and assistant professor of applied economics at Cornell University, wrote in an email.

"Since the early 2000s, air quality (as measured by ozone) is just as bad (or just as good) in national parks as it is in metropolitan areas," Rudik said.

These areas experience about two and a half to three weeks of unhealthy days a year on average.

For example, Sequoia National Park in Northern California rivaled Los Angeles in ozone exceedance days during the time period of the study. That means there were as much or more days when the air was considered "unhealthy for sensitive groups" by the Environmental Protection Agency.

Sequoia National Park in California

The National Park website for Air Quality at Sequoia National Park says the park is one of the worst national parks for air pollution in the country. The reason is that the park is "downwind of many air pollution sources, including agriculture, industry, major highways, and urban pollutants from as far away as the San Francisco Bay Area," according to the website.

According to this new study, in all but two years since 1996, Sequoia National Park ozone exceedance days have surpassed that of Los Angeles, the metropolitan area with the highest ozone concentration.

"You can see this in the parks' twitter feed ," Rudik said, "where pretty much every day in the summer there is an air quality warning where it is unhealthy for sensitive groups or for all people."

ADVISORY: #ozone is expected to be Unhealthy for All today in and around the foothills area of @SequoiaKingsNPS (Ash Mountain entrance) https://t.co/A9JkmMb5yE — Sequoia Kings Air (@SequoiaKingsAir) July 18, 2018

City air quality days improved better than national parks

Just down the road from Sequoia, Joshua Tree National Park received a similar number of unhealthy days as New York City.

"From 1990 to 2000, Joshua Tree NP had, on average, 105 unhealthy ozone days per year while NYC had 110. From 2001 to 2014, average unhealthy days decreased in both locations to 101 per year in Joshua Tree and 78 in NYC.

New York City

"Consistent with our overall results, the improvements in Joshua Tree are more modest than those in NYC," Rudik said.

The study shows that the 1999 Regional Haze Rule has continued to improve pollutants across the nation since it was put into practice at the turn of the century.

The National Park Air's page states that air quality has improved over the past 30 years. The study confirms this, but the research also shows the average number of exceedance days in metropolitan areas fell to 18 from 53 days per year. National parks saw less progress, where average exceedance days decreased to 16 from 27 days per year.

The National Park system outlines the direct cause of the pollution in its list of air quality profiles for each park.

Grand Canyon National Park

According to the Grand Canyon National Park air profile page, it "is downwind of air pollution from coal-fired power plants in the Four Corners region, nearby mining, and urban and industrial pollutants from Mexico and California."

Acadia National Park

Acadia National Park's page says the pollution drifts in from large urban and industrial areas in the states to the south and west. This polluted air gets trapped in the park's steep slopes and high peaks. The parks air page says after 30 years of air quality monitoring, it has shown the park "receives some of the highest levels of pollution in the northeastern U.S."

Visiting the parks in the smog

There is a direct correlation between the number of visitors and the high pollution levels, the researchers said. When the ozone levels were high, the number of people at the parks reduced.

Poor visibility and air quality warnings issued by the parks were likely the reason for the lower visitor numbers, according to the study.

Conditions in the parks could be improved by cutting back on emissions of pollutants, Rudik said. "The 1999 Regional Haze Rule aims to do just that, although the EPA is currently revisiting the rule."

"Still, 35% of all national park visits occur when ozone levels are elevated," the study states.

The good news is that before you leave for your next national park visit, you can always check the air quality at 48 of the parks.

"We don't mean to discourage visitation to national parks," Rudik said. "Rather, this work highlights an important factor when deciding to visit a park."