Memories of photon energy, polarization and phase in luminescence of rare earth ions under resonant light excitation