A study of the theory and operation of a resonance fluorescence water vapour sensor for upper tropospheric humidity measurements