As Californians savor their Thanksgiving feasts, the states’ farmers are especially thankful. California’s agriculture sector is on track for a record year, a rare bright spot in the state’s economy.

Prices for cotton, grapes and other crops are near all-time highs. Foreign buyers are gobbling California almonds, grapes, citrus and dairy products. Agricultural exports through September are up 16% over the same period last year. Net farm income is projected to post strong gains in 2011 after nearly doubling over the previous decade.

At a time when other Golden State industries are struggling, times are good down on the farm. Just ask Steve Moore.

The Fresno County pistachio farmer recently completed the harvest on his 480-acre spread near Huron, part of what’s estimated to be California’s second-largest pistachio crop ever. Prices are strong, at around $2.10 a pound, driven by growing demand in places including China and Israel.