Possibility of doing PhD in astronomy with only masters in CS
In Sweden there is no hard requirement. (In Spain, for that matter, there isn't either, but I don't recommend going for a PhD there). You just need to convince a professor that you are a good asset for the team. The way it works here (and in some other countries in Europe) is that the PI gets funding and hires whomever he wants, based on whatever criteria. Other countries make the decision at a department level, usually putting stress on the marks. Anyway, the difference is convincing one party or a few.

It is true that all the people I know in the closest related department, are physicist, but they do a lot of programming and data analysis. Your strong points are:


You can improve code quality. (I have seen code that gives me nightmares.)
You can implement new algorithms.
You can learn the physics along the way.


CS backgrounds are, by the way, quite common in Bioinformatics and, to a lesser degree, Biophysics.

References:

I am in Sweden working in Biophysics, and my girlfriend is doing a PhD in Astrophysics.