Enhanced rare earth photoluminescence in inverse opal photonic crystals and its application for pH sensing