You asked

Is the panasonic lumix s 18mm f 1 8 good for astrophotography?

The guide doesn't cover astrophotography, so it can't rate this lens for that. Its specs do suggest it could be useful. At f/1.8 it gathers a lot of light, which is the main thing dim night skies need, and 18mm on full frame takes in a wide strip of sky. The guide's rule of thumb is that a fast lens and a full-frame sensor matter more in low light than stabilisation. This lens isn't stabilised, so for star shots you would normally use a tripod anyway.

The lens fits the full-frame Panasonic bodies in its catalogue entry, including the Panasonic Lumix S5 and the Panasonic Lumix S1R. Those are the natural pairings if you're building a camera around it. Check the lens's catalogue page for the full list of bodies, and see the focal length converter for how f/1.8 compares on smaller sensors.

If you're just starting out, the lenses guide suggests a fast standard prime for low light, which points the same way as this lens.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.