View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Two quesitons about flux scales and arithmetic with the wavelengths

Frank Valdes wrote on May 21, 1999

Q1: What is the iraf routine which allows to multiply/divide a spectrum by the
wavelength so as to transform photons to flux units or vice-versa ?

Observed spectra are in photons/pixel, "reduced" spectra are in units of
energy per wavelength bin per second etc. Basically, there is a converion
problem of photons --> energy which involves a multiplicative factor
proportional to the wavelength. 


A1:  To go from photons/pixel to flux units in 1D spectra (spectra that have
been extracted to 1D format and wavelength calibrated) consists of the
following steps.

1) Standard stars are also extracted from the data.  Standard stars are
those which have calibration information in the IRAF calibration
directories (see "help onedstds") or which you can create a calibration
file.

2) The task STANDARD compiles bandpass fluxes from the standard stars
matching the calibration points.

3) The task SENSFUNC fits a "response" function which defines the
conversions from observed photon counts on the detector to flux
above the atmosphere.

4) The task CALIBRATE uses the response function to convert to flux
units.  This task also applies extinction corrections.


CALIBRATE is the task you are asking about though the other tasks are
needed to derive the calibration since it is more than just a
wavelength multiplication.  If you just wanted to assume some simple
response you could create the sensitivity image (just a 1D spectrum) in
some other way.  The format is described in the help pages.

To read more about this you might start with

ftp://iraf.noao.edu/iraf/docs/spect.ps.Z        (compressed postscript doc)


The task SPLOT has keys to multiply ('n') or divide ('l) by lambda^2/c.
This is used to convert between f_nu and f_lambda though you could use
it just to do this multiply/divide in uncalibrated photon count data.

There is nothing I can think of right now that does a simple lambda
multiply or divide.  What you would need to do is get the lambda values
in a separate spectrum.  This could be done by listing the wavelengths
to a text file and reading them back into a 1D image as pixel values
and then using IMARITH or IMEXPR.  The steps would be:

cl> listpix <spec> wcs=world|fields STDIN 1|rtextim STDIN waves head- dim=<npix>
 

This does three things piped into each other though you could do the steps
yourself.

There are probably some other ways using the TABLES package; i.e. convert
your spectrum to a table of wavelength and flux and then use tools that
can operate on columns.  I don't use this package much so I can tell
you much about it.


Q2:  I have pretty much figured out how to use the onedspec package with
identify, dispcor, standard, sensfunc, and calibrate.  The one question I
had was that the final spectra comes out in units of F-lambda and I wanted
to write out my final calibrated data using wspectext in units of
magnitude.  I know the conversion is:

mag = -2.5 log10 ((flux * lambda^2) / (c * fnuzero))

where c	= 2.997925e18 angstroms / sec and
      fnuzero = 3.68e-20 ergs / cm^2 / sec / Hz

However, I can not find a convient function in the "onedspec" package to do
that. "sarith" can't multiply by "lambda^2".  Any ideas?



A2:  After a decade or more of no one asking about operations with the
wavelength array yours is the second in a week.  There is no easy
way to do this other than to write out the wavelengths and then
read them into a image.  See the previous question and answer for details.

However, your need is more specific and there are better ways to accomplish
what you want.  The first answer is to just use CALIBRATE to calibrate
directly in F-nu.  Then use SARITH, IMFUNC, IMEXPR, or SPLOT to do
the magnitude conversion.

The second answer is that you can use SPLOT and the 'n' key to convert
to F-nu from F-lambda.  This step simply multiplies by lambda^2 / c
as you asked about.  The 'f' mode can then be used to do the conversion
to magnitude and then the 'i' key to write out the new spectrum.

Phil Hodge wrote on May 21, 1999

>>Q1: What is the iraf routine which allows to multiply/divide a spectrum by the
>>wavelength so as to transform photons to flux units or vice-versa ?
> ...
> cl> listpix <spec> wcs=world|fields STDIN 1|rtextim STDIN waves head- dim=<npix>
> ...
>
> There are probably some other ways using the TABLES package; ...

You can use:

cl> listpix <spec> wcs=world > spec.lis
cl> tcalc "spec.lis" c3 "c1 * c2" datatype="double" colfmt=""

Then the third column in the text file "spec.lis" will contain the
product of wavelength and flux.

Phil

Last post on May 21, 1999