How to calculate Partial Density of States?

Hello Dear Friends! I am a new user of this Dassault systemes. I am learning to calculate the density of states by using materials studio (CASTEP). I wish to know how to write extended functional code to calculate the partial density of states(px, py, pz)?