Los Osos and Morro Bay both ranked in a listing of the top 20 beach town housing markets in the nation compiled by RealtyTrac.
    The rankings were based on home values, weather, air quality and crime rates. The two were the highest-ranked California communities in the tally.
    Los Osos ranked sixth with a public safety grade of A, a median home price of $418,403, an average temperature of 60 with sunny days 78 percent of the time, and good air quality days 100 percent of the time.
    Morro Bay ranked 11th, with identical weather, crime and air quality numbers but a higher median home price of $537,479.
    The median is the midpoint at which half of the houses sold for more and half for less. Figures are compared year-over-year because of the seasonal nature of home sales.
    The top-20 U.S. beach communities ranked by RealtyTrac, a resource for comprehensive housing data, were all from California, Florida or Hawaii.
    Hobe Sound, Fla., was ranked highest in the report published in May. The other California communities to make the list were Dana Point at No. 16, Seal Beach at No. 17, and San Clemente at No. 19. Each of the top-20 beach towns had median home prices below $1 million and average daily temperatures either in the 60s or 70s.