Hi Bowen,
Thank you for trying the code.
Did you mean you want to calculate density distribution along the pore? If so, the code "almost" can do that in this way: you can define a cubic pillar as the atom selection area like shown in the picture, then calculate the density distribution along the cubic pillar, that could be used to represent the density distribution along the pore. But one thing that may affect the accuracy is the radical distribution in the pore, if the density distribution is nearly homogeneous in the pore, the cubic pillar method is accurate; otherwise it may not be that accurate. You can check the radical distribution by using the code, i.e., do a 2D density distribution on a slice of the pore.
Hope that helps you.
Best,
Yuxiang