NEW YORK (MainStreet) — If the snow and cold that have hit much of the nation this winter have got you down, here's a look at five communities that offer the best weather among America's largest cities.

"Weather is certainly a big factor [in real estate]. People really want to be where the weather is nice," says economist Svenja Gudell of property-listing site Zillow, which recently analyzed historical records for the 25 most-populous U.S. cities to see which ones have the best climates.

Not surprisingly, the winners are all in California or Florida — and most have home prices as high as the UV index on their many sunny days.

"We definitely noticed that there tends to be a larger demand for housing in cities that have nicer weather," Gudell says. "If you think about 'snowbirds' coming down to places like Phoenix and Las Vegas to buy property, weather certainly makes a big difference."

Read More: 3 Best U.S. Real Estate Markets for First-Time Home Buyers in 2015

Here's a rundown of cities that Zillow found have the most nice days per year among America's most-populous locales.

The firm defined good-weather days as those with no precipitation, median temperatures of 55 to 75 degrees Fahrenheit and no period when the mercury rises to 85 degrees or falls to 45 degrees.

All climate figures come from the National Oceanic and Atmospheric Administration and Weatherbase.com. Home-price figures refer to Zillow's estimates of median December 2014 property values for all residences (for sale or not) in a given metro area.

U.S. city with the fifth-best weather: Jacksonville, Fla.
Average number of pleasant days per year:
118

Jacksonville combines great weather with an oceanfront location and the lowest median property prices of any city on Zillow's top-five list.

A typical home there costs just $154,400, making Jacksonville the only community in the top five where homes typically costs less than the U.S. median of $179,200. 

"Jacksonville is certainly a great option for waterfront property at lower prices," Gudell says.

Located on Florida's Atlantic Coast, the community typically enjoys more than 100 good-weather days per year, with rain or snow normally falling just 113.5 days annually. Temperatures also generally drop below freezing during only 15.6 days a year, more than offsetting the 73.2 days per year on average the mercury hits 90 degrees.

U.S. city with the fourth-best weather: San Francisco
Average number of pleasant days per year:
189

San Francisco is famous for its Mediterranean climate, with nearly 200 pleasant days in a typical year.

The City by the Bay also usually has just 67 wet days per year, while temperatures normally drop below 32 degrees just once every five years and rise into the 90s only 2.4 days annually.

Of course, the Bay Area's great climate — not to mention its booming tech economy — means San Francisco has some of America's highest home prices. A median residence there costs $706,600.

"San Francisco is just off the charts in terms of how much homes cost there," Gudell says.

U.S. city with the third-best weather: San Jose, Calif.
Average number of pleasant days per year:
198

Silicon Valley's hometown of San Jose slightly beats neighboring San Francisco's good-weather numbers — and its high home prices.

Just 50 miles or so south of San Francisco, San Jose saw median property values hit $837,900 in December, the top price among cities on Zillow's list.

"Like San Francisco, San Jose has a great job market — especially for tech — and that shows up in terms of home values," Gudell says.

On the upside, San Jose offers one of America's best climates.

Residents generally face just 61.9 days a year with precipitation, as well as a mere 2.7 days with temperatures below 32 degrees and 16.1 days when the thermometer rises to 90 degrees.

U.S. city with the second-best weather: Los Angeles
Average number of pleasant days per year:
221

The Los Angeles air might be full of smog, but at least it's warm and sunny.

The City of Angels has more than 200 good-weather days in a typical year, with just 35 rainy ones and 19.5 days when the temperature tops 90 degrees. And cold weather is about as rare as leading roles for actresses over 40, with the temperature dropping below 32 just once every 10 years on average.

Read More: Here Are America's Most Desirable (but Expensive) ZIP Codes

Of course, all of those rich Hollywood types help keep home prices high, with median L.A. property values reaching $532,900 as of December.

But Gudell says smart house hunters can look at Riverside or other lower-priced areas a bit outside of Los Angeles proper. "If you're [just] interested in sunny days, I'd recommend moving a little further out where you can find cheaper housing but still get really nice weather," she says.

U.S. city with the best weather: San Diego
Average number of pleasant days per year:
261

San Diego calls itself "America's Finest City," and that's certainly true when it comes to weather.

The Southern California community has great conditions more than 70% of the time, with rain falling just 41.5 days per year on average. San Diego also historically gets no freezing weather, as well as only 1.2 days a year when the temperature climbs to 90 degrees.

But home prices there are decidedly less pleasant.

Gudell says investors often snap up San Diego's low-end properties and turn them into rentals, helping push median home values up to $469,400. "San Diego is certainly on the expensive side and always has been," she says.

— By Jerry Kronenberg for MainStreet