Please see the source code for details. Any spectra observed at the Earth's surface will differ from true due to atmospheric effects, particularly wavelength dependent transmission, noticeable in the infra-red due to water vapour and carbon dioxide. The correction of these effects is to compare the source with another having a well-behaved and understood spectral shape i.e. viz. This depends upon the path length through which both source and standard are measured. To remain true both must be observed at, or close to, the same airmass.
Equation contains the key.
Standard stars are observed in exactly the same way as other astronomical objects. They are sky subtracted into reduced group files, although a reduced observation can be filed as a standard if desired.