Yes. The time-honored way is to find a stretch of continuum in the extracted
spectra which contains no spectral features and is free of pixels of with
negative data-quality flag values and then compute the rms formally from its
noise fluctuations.
Since "clean" continuum is not always easy to find, let's consider an
empirical procedure which works well even for a spectrum containing features.
As long as the flux errors are primarily gaussian- distributed, we can make
use of the fact that randomly drawn samples will differ from one another,
on average, by exactly one standard deviation. In the computing language IDL,
an estimate of the rms may be computed conveniently by a few steps.
Defining "f" as a spectral flux array
taken from pixels near the blaze maximum (so the noise will be approximately
uniform along the spectrum) and containing only zero-valued quality flags, we
compute the mean point to point fluctuation of two pixels separated by a short
distance n:
The distribution of noise fluctuations among
these pixels can be obtained from the computation:
rmsdist = abs( f - shift( f , n) ) .
The median of this distribution is computed by sorting the distribution
rmsdist and finding the middle element of the sorted rmsdist
array, which by definition is half the number of elements in the distribution.
Thus:
ntot = n_elements(rmsdist), so
ntot2 ,
= ntot/2 ,
Now we compute the sorted index distribution and take the value of
rmsdist we need:
isort = sort(rmsdist) ,
medrms = rmsdist( isort(ntot2) ) .
medrms is the our noise estimate using the median average.
The mean of the distribution can likewise easily be determined from:
meanrms = total( rmsdist )/ntot .
This value will be biased on the high side if there are outlying fluctuations
in the spectrum.
In practice the pixel separation distance n should be at least a spectral resolution
element (3 or more).