How to do Bader analysis on CASTEP?

Hi, everyone:
Recently, I have done some calculations about atomic populations, but the Mulliken populations in CASTEP is not so crecct. Bader analysis will be a better choice. However, I don't know how to do it with output files of CASTEP? Do anybody know how to deal with it? Do I need to write some scripts?
Thanks in advance. Any help is appreciated.

Sincerely
 Li