This rather artificial example is taken from c2x's test suite.

The results of a calculation on a six atom cell of diamond are in the test suite. This cell is formed of three layers, so it should be possible to cut it precisely into thirds.

The .cell file for the calculation was:

```%block LATTICE_CART
1.7850000  -1.7850000   0.0000000
1.7850000   0.0000000  -1.7850000
3.5700000   3.5700000   3.5700000
%endblock LATTICE_CART

%block POSITIONS_FRAC
C  0.000000000  0.000000000  0.000000000
C  0.000000000  0.000000000  0.250000000
C  0.666666667  0.666666667  0.333333333
C  0.666666667  0.666666667  0.583333333
C  0.333333333  0.333333333  0.666666667
C  0.333333333  0.333333333  0.916666667
%endblock POSITIONS_FRAC

KPOINT_MP_GRID 1 1 1
KPOINT_MP_OFFSET 0 0 0
```

And Castep produced an integrated charge density of 24 on a 27x27x54 grid.

```\$ c2x --null -vc diamond6.check
First FFT grid     27 27 54
spins=1   spinors=1
Found 3D data for Density
min=0.0877441 max=2.49012 sum=27686.4 int=24
(integral is e per cell for charge and spin densities)
```

```import numpy as np
a=np.zeros((27,27,54))
a[:,:,0:18]=1
a=1-a
```

This mask is of the same size as the FFT grid, and has ones for all elements where the third index is between 1 and 18 (assuming indices start at 1). Note python's odd convention that an index range is specified as `start:end+1`, and that it indexes arrays from zero.

```\$ c2x --null -vc --mask diamond6.check mask.npy
First FFT grid     27 27 54
spins=1   spinors=1
Found 3D data for Density
min=0 max=2.49012 sum=9228.8 int=8
(integral is e per cell for charge and spin densities)