NV5 GEOSPATIAL SOFTWARE
>  Docs Center  >  Libraries  >  ASTROLIB  >  FLUX2MAG

FLUX2MAG

FLUX2MAG

## Purpose

Convert from flux (ergs/s/cm^2/A) to magnitudes.

## Explanation

Use MAG2FLUX() for the opposite direction.

## Calling Sequence

mag = flux2mag( flux, [ zero_pt, ABwave= ] )

## Inputs

flux - scalar or vector flux vector, in erg cm-2 s-1 A-1

## Optional Input

zero_pt - scalar giving the zero point level of the magnitude.
If not supplied then zero_pt = 21.1 (Code et al 1976)
Ignored if the ABwave keyword is supplied

## Optional Keyword Input

ABwave - wavelength scalar or vector in Angstroms. If supplied, then
FLUX2MAG() returns Oke AB magnitudes (Oke & Gunn 1983, ApJ, 266,
713).

## Output

mag - magnitude vector. If the ABwave keyword is set then mag
is given by the expression
ABMAG = -2.5*alog10(f) - 5*alog10(ABwave) - 2.406

Otherwise, mag is given by the expression
mag = -2.5*alog10(flux) - zero_pt

## Example

Suppose one is given wavelength and flux vectors, w (in Angstroms) and
f (in erg cm-2 s-1 A-1). Plot the spectrum in AB magnitudes
IDL> plot, w, flux2mag(f,ABwave = w), /nozero

## Revision History

Written J. Hill STX Co. 1988
Converted to IDL V5.0 W. Landsman September 1997
Added ABwave keyword W. Landsman September 1998

© 2024 NV5 Geospatial Solutions, Inc. |  Legal