Python script to calculate the water density in a MD system