Now the interpretation will be easier if we overlay those two figures as in one as shown below:
From there you can see how there is a fairly large variability in the amount of clear sky days. From a few at the coast, to about a week over the coastal mountains to about two weeks east of the coastal mountains. Peaking at 17 days per month over the Salar de Atacama (a value surpassed only by the Sahara desert and the interior of Antarctica). Then, it is no coincidence that ALMA observatory, the largest radio telescope in the world, is located there, just east of the salar de Aatacama.
As mentioned before, topography is the main factor controlling this pattern. Even close to the coast, some mountain tops can have remarkable clear sky records, as is the case of the 2,635 m high Mount Paranal were the VLT observatory is located at just 15 km from the coast (falling on the lower left cell with 9 clear sky days in the figure above).
Finally, going back to your question: Both the astronomers and your geography text book are right, but each one is referring to a different area of the Atacama desert. And looking at the above data, it is right to say that the coastal part of the Atacama desert is cloudy most of the year. However, a fairly large area in the interior is cloudless most of the year.