2013年6月28日星期五

Magnitude systems ( tips for flux, magnitude, error and how to convert)


Hello, everybody! 

If you still get trouble to deal with the flux, magnitude, error of the catalog you get (Mostly, the catalog are created by SExtractor).  This file must be helpful for you. Just give you all the equations about how the photometric system works. 

If You still have question about these, please leave me a message, I will be quite pleasant to help you. You will be the nest astronomer! 

______________________________________________________

Magnitude systems

STMAG

ZEROPTsecond = -2.5 * log10(PHOTFLAM) + PHOTZPT
ZEROPTexptime = -2.5 * log10(PHOTFLAM) + PHOTZPT + 2.5 * log10(exptime)
PHOTZPT = -21.1 (always)
mstmag = -2.5 * log10(counts/exptime) + ZEROPTexptime
mstmag = -2.5 * log10(counts/sec) + ZEROPTseconds
mstmag = -2.5 * log10( PHOTFLAM * DN / EXPTIME) + PHOTZPT

AB mag

mAB = -2.5 log10( Fluxnu ) - 48.594
where fluxnu is in ergs cm-2 s-1 HZ-1
mAB = -2.5 log10( Fluxlambda ) - 2.402 - 5.0 * log10( lambda )
where fluxlambda is in ergs cm-2 s-1 A-1
and lambda in A
Fnu = flambda * lambda2 / c
flam = 3x10^18 * fnu / lam^2
fnu = (lam^2 * flam) / 3x10^18

______________________________________________________

Converting an image to flux

flux = DN * PHOTFLAM / exposure_time
where flux is in erg cm-2s-1A-1

flux = DN * PHOTFLAM / exposure_time * PHOTPLAM**2 / 2.9972E18 * 1E+23
where flux is in Jy

JANSKY

1 Jy = 1.0 * 10-26 (W/m2/Hz) = 1.0E-23 erg/s/cm2/Hz

FWHM

        seeing_fwhm = 1.22 * (photplam / 24000000000.0 ) * 206264.806247
 seeing_fwhm = math.sqrt( (seeing_fwhm * seeing_fwhm) + (pixscale[chip] * pixscale[chip])  )
 24000000000.0 = size of the mirror
 206264.806247 = 180 * 3600. / pi


        $diameter=2.4e10; #diameter of the telescope

 $arc_rad = 206264.8; #number of arcsec/rad

 $rayleigh=1.22*$photplam * $arc_rad / $diameter; #1.22 * lambda/D

 $resolution  = sqrt( ($rayleigh**2) + ($pixscale**2))

CVORES

cvosres = (( photplam / 10.0E10 ) / 2.4 ) * (2.063 * (10**5)) cvonyqr = cvosres / pixscale[chip] cvosres = cvosres / 3600.0 The Nyquist ratio (spatial_resolution/spatial_sample). Values less than 2.5 are undersampled.

equations

# [Y ABnu] = -2.5 * log([X ergs/cm^2/s/Hz]) - 48.594 
# [Y ABnu] = -2.5 * log([X ergs/cm^2/s/A]) - 2.402 - 5.0 * log(lambda A) 
# [Y ABnu] = -2.5 * log([X W/m^2/Hz]) - 56.094 
# [Y ABnu] = -2.5 * log([X photon/cm^2/s/A]) + 16.852 - 2.5 * log(lambda A) 
# [Y ABnu] = -2.5 * log([X photon/cm^2/s/um]) + 16.852 - 2.5 * log(lambda um)
[Y Jy] = 1.0E+23 * [X erg/cm^2/s/Hz]
______________________________________________________

Daniel Durand, April 2004

Alberto Micol, September 2004

Photometric systems: zeropoints and formulae

Generic: m = -2.5 * log10( DN/EXPTIME ) + ZEROPOINT

ST sys:  mst = -2.5 * log10( Flambda ) - 21.10

AB sys:  mAB = -2.5 * log10( Fnu ) - 48.60

where Flambda is in erg/cm2/sec/A
  and Fnu        in erg/cm2/sec/Hz

Flambda = countRate * PHOTFLAM

Fnu     = Flambda * lambda2 / c
                   = countRate * PHOTFLAM * PHOTPLAM2 / c

where:

 - counteRate is the number of counts diveded by the exptime

 - PHOTFLAM is the flux of a source with constant flux per unit wavelength
            (in erg/cm2/sec/A) which produces a count rate of 1DN/sec.
   Note: Obviously a change of GAIN will have repercussions on PHOTFLAM

 - c must be given in A/sec, that is: 2.99792E+18 A/sec
     since PHOTPLAM is in A, and PHOTFLAM in erg/cm2/sec/A.

Hence,

 mst = -2.5 * log10( countRate * PHOTFLAM ) - 21.10
     = -2.5 * log10( countRate ) -2.5*log10( PHOTFLAM ) - 21.10

     = -2.5 * log10( count ) -2.5*log10( PHOTFLAM ) - 21.10 + 2.5 * log10( EXPTIME )


 mAB = -2.5 * log10( countRate * PHOTFLAM * PHOTPLAM2 / c ) - 48.60
     = -2.5 * log10( countRate ) -2.5*log10(PHOTFLAM*PHOTPLAM2/c) - 48.60

     = -2.5 * log10( count ) -2.5*log10(PHOTFLAM*PHOTPLAM2/c) - 48.60 + 2.5*log10( EXPTIME )

 

Effective Gain

The effective gain is to be used within PIPE only when running SExtractor,
that is, when the noise of the image must be computed.
The effective gain is g for the noise of an single image.

The effective gain is g for the noise of an coadded image (pure sum).

The effective gain is N * g for the noise of an averaged image.

   That's because the poissonian noise can be computed only from the Total number of electrons,

   not from the average number of electrons; and
   the total number of electrons is N * g * the number of counts

    of an averaged image.


All the formulae to do with gain

FLUX COMPUTATION
For a source which has 1DN/sec in an image with gain g,
the flux is PHOTFLAM, where PHOTFLAM is to be scaled to g7 or g15.

Flux(erg/cm2/sec/A) = NDN/exptime * PHOTFLAM(g=g7 or g15)

For an averaged image, whose members are images at g=g7,
the flux is computed this way:

Flux = Total Ne / g7 / Total Exptime * PHOTFLAM(g7)

     = N * g7 * Mp / g7 / Total Exptime * PHOTFLAM(g7)

     = N/Total Exptime * Mp * PHOTFLAM(g7)

     = Mp / AVGExpTime * PHOTFLAM(g7)


For a summed image, whose members are images at g=g7,
the flux is computed this way:

Flux = Total Ne / g7 / Total Exptime * PHOTFLAM(g7)

     = g7 * Tp / g7 / Total Exptime * PHOTFLAM(g7)

     =  Tp / Total Exptime * PHOTFLAM(g7)


SExtractor outputs always FLUXes as counts;
hence,
a SExtractor run onto an averaged image, will return the average counts;
a SExtractor run on a total image will return the total number of counts.
______________________________________________________________________


PS:   This is from an quite old document, but the idea will not change.
From:
http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/hst/wfpc2/wfpc2_r2_processing.html

Converting Counts to Flux or Magnitude


[When I tried to use the flux from catalog, the unit is count/s !! You have to convert it to flux or magnitude considering the zero point! Let me show you here.]

All calibrated HST images record signal in units of counts or Data Numbers (DN)1-NICMOS data is DN s-

1. The pipeline calibration tasks do not alter the units of the pixels in the image. Instead they calculate and write the inverse sensitivity conversion factor (PHOTFLAM) and the ST magnitude scale zero point (PHOTZPT) into header keywords in the calibrated data. WF/PC-1 and WFPC2 observers should note that the four chips are calibrated individually, so these photometry keywords belong to the group parameters for each chip.

For all instruments other than NICMOS, PHOTFLAM is defined to be the mean flux density F in units of erg cm-2 s-1 Å-1 that produces 1 count per second in the HST observing mode (PHOTMODE) used for the observation. If the F spectrum of your source is significantly sloped across the bandpass or contains prominent features, such as strong emission lines, you may wish to recalculate the inverse sensitivity using synphot, described below. WF/PC-1 observers should note that the PHOTFLAM value calculated during pipeline processing does not include a correction for temporal variations in throughput owing to contamination buildup. Likewise, FOC observers should note that PHOTFLAM values determined by the pipeline before May 18, 1994 do not account for sensitivity differences in formats other than 512 x 512 (see "Format-Dependent Sensitivity" on page 7-10).

To convert from counts or DN to flux in units of erg cm-2 s-1 Å-1, multiply the total number of counts by the value of the PHOTFLAM header keyword and divide by the value of the EXPTIME keyword (exposure time). You can use the STSDAS task imcalc to convert an entire image from counts to flux units. For example, to create a flux-calibrated output image outimg.fits from an input image inimg.fits[1] with header keywords PHOTFLAM = 2.5E-18 and EXPTIME = 1000.0, you could type:


st> imcalc inimg.fits[1] outimg.fits "im1*2.5E-18/1000.0" 


Calibrated NICMOS data are in units of DN s-1, so the PHOTFLAM values in their headers are in units of erg cm-2 Å-1. You can simply multiply these images by the value of PHOTFLAM to obtain fluxes in units of erg cm-2 s-1 Å-1. NICMOS headers also contain the keyword PHOTFNU in units of Jy s. Multiplying your image by the PHOTFNU value will therefore yield fluxes in Janskys.



From:     http://www.stsci.edu/documents/dhb/web/c03_stsdas.fm3.html


Here is another website for the ACS header: 



Photometric Systems:

  • Flux : The average flux F in erg cm-2 s-1 Ang-1 over an ACS bandpass is F=N*PHOTFLAM, where N is the count rate in infinite aperture. For count rates N(ap) in smaller apertures, N=N(ap)/EE, where EE is the fractional encircled energy. (See the ACS Data Handbook and ISR-IV.)
  • VEGAmag : Magnitude system where Vega has magnitude 0 at all wavelengths by definition. The vega magnitude of a star with flux F is -2.5 log10 (F/F_vega) where F_vega is the current flux spectrum of Vega from the CALSPEC archive.
  • STmag and ABmag: Both systems define the absolute physical flux density for a point source. The conversion is chosen so that the magnitude at V corresponds roughly to that in the Johnson system. In the STmag system, the flux density is expressed per unit wavelength, while in the ABmag system, the flux density is expressed per unit frequency. The definitions are:
    • STmag = -2.5 Log F_lam -21.10
    • ABmag = -2.5 Log F_nu - 48.60
where F_nu is expressed in erg cm-2 s-1 Hz-1, and F_lam in erg cm-2 s-1 Ang-1. An object with a constant flux distribution F_nu = 3.63 x 10-20 erg cm-2 s-1 Hz-1 at all wavelengths will have ABmag=0 at all wavelengths, and similarly an object with F_lam = 3.63 x 10-9 erg cm-2 s-1 Ang-1 will have STmag=0.

Photometric Keywords in the SCI extention of ACS images:

(keywords affected by the sensitivity curve update are highlighted)
  • PHOTMODE: Observation configuration for photometric calibration.
  • PHOTFLAM: inverse sensitivity (erg cm-2 s-1 Ang-1).
  • PHOTZPT: ST magnitude zeropopint (= -21.10).
  • PHOTPLAM: pivot wavelength.
The header keywords PHOTFLAM and PHOTPLAM relate to the STMAG and ABMAG zeropoints through the formulae:
  • STMAG_ZEROPOINT = -2.5 Log (PHOTFLAM) - 21.10
  • ABMAG_ZEROPOINT=-2.5 Log(PHOTFLAM)-5 Log(PHOTPLAM)-2.408




2013年6月27日星期四

Sextractor


I am trying to using the catalog from SEXTRACTOR to get some information. In the process, I have to analyze the error. Then the question come... 
I using the error of magnitude first, and find that the error is under-estimated. It is assuming that the "flux_err << flux".
   MAG_ERR= FLUX_ERR /FLUX * 2.5/ln(10) 
Then, I tried to using the flux directly, but I find this:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   NUMBER  X_IMAGE  Y_IMAGE  FLUX_ISO  FLUXERR_ISO  FLUX_ISOCOR
     1  3276.88  1658.34  0.011211  4.67943e+15  0.212761  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The FLUX_ISO is 0.011211  while FLUXERR_ISO is 4.67943e+15.
I do not know how to convert this to erg/cm^2/s/A.


PS:

(1)  Good explanation for mag_err

https://www.astromatic.net/pubsvn/software/sextractor/trunk/doc/sextractor.pdf

(2)  Good explanation for mag_err and flux_err 

Now I know it just so simple!


(2)  Good explanation for mag