Measurement of ion density