Relating spectral and species diversity through rarefaction curves