Home | Trees | Indices | Help |
---|
|
Functions relevant for photometric calibration
Table of contents:
Short list of available systems:
>>> responses = list_response() >>> systems = [response.split('.')[0] for response in responses] >>> set_responses = sorted(set([response.split('.')[0] for response in systems])) >>> for i,resp in enumerate(set_responses): ... print '%10s (%3d filters)'%(resp,systems.count(resp)) 2MASS ( 3 filters) ACSHRC ( 17 filters) ACSSBC ( 6 filters) ACSWFC ( 12 filters) AKARI ( 13 filters) ANS ( 6 filters) APEX ( 1 filters) ARGUE ( 3 filters) BESSEL ( 6 filters) BESSELL ( 6 filters) COROT ( 2 filters) COUSINS ( 3 filters) DDO ( 7 filters) DENIS ( 3 filters) DIRBE ( 10 filters) EEV4280 ( 1 filters) ESOIR ( 10 filters) GAIA ( 4 filters) GALEX ( 2 filters) GENEVA ( 7 filters) HIPPARCOS ( 1 filters) IPHAS ( 3 filters) IRAC ( 4 filters) IRAS ( 4 filters) ISOCAM ( 21 filters) JOHNSON ( 25 filters) KEPLER ( 43 filters) KRON ( 2 filters) LANDOLT ( 6 filters) MIPS ( 3 filters) MOST ( 1 filters) MSX ( 6 filters) NARROW ( 1 filters) NICMOS ( 6 filters) OAO2 ( 12 filters) PACS ( 3 filters) SAAO ( 13 filters) SCUBA ( 6 filters) SDSS ( 10 filters) SLOAN ( 2 filters) SPIRE ( 3 filters) STEBBINS ( 6 filters) STISCCD ( 2 filters) STISFUV ( 4 filters) STISNUV ( 7 filters) STROMGREN ( 6 filters) TD1 ( 4 filters) TYCHO ( 2 filters) TYCHO2 ( 2 filters) ULTRACAM ( 5 filters) USNOB1 ( 2 filters) UVEX ( 5 filters) VILNIUS ( 7 filters) VISIR ( 13 filters) WALRAVEN ( 5 filters) WFCAM ( 5 filters) WFPC2 ( 21 filters) WISE ( 4 filters) WOOD ( 12 filters)
Plots of all passbands of all systems:
]include figure]]ivs_sed_filters_2MASS.png]
]include figure]]ivs_sed_filters_ACSHRC.png]
]include figure]]ivs_sed_filters_ACSSBC.png]
]include figure]]ivs_sed_filters_ACSWFC.png]
]include figure]]ivs_sed_filters_AKARI.png]
]include figure]]ivs_sed_filters_ANS.png]
]include figure]]ivs_sed_filters_APEX.png]
]include figure]]ivs_sed_filters_ARGUE.png]
]include figure]]ivs_sed_filters_BESSEL.png]
]include figure]]ivs_sed_filters_BESSELL.png]
]include figure]]ivs_sed_filters_COROT.png]
]include figure]]ivs_sed_filters_COUSINS.png]
]include figure]]ivs_sed_filters_DDO.png]
]include figure]]ivs_sed_filters_DENIS.png]
]include figure]]ivs_sed_filters_DIRBE.png]
]include figure]]ivs_sed_filters_ESOIR.png]
]include figure]]ivs_sed_filters_EEV4280.png]
]include figure]]ivs_sed_filters_GAIA.png]
]include figure]]ivs_sed_filters_GALEX.png]
]include figure]]ivs_sed_filters_GENEVA.png]
]include figure]]ivs_sed_filters_HIPPARCOS.png]
]include figure]]ivs_sed_filters_IPHAS.png]
]include figure]]ivs_sed_filters_IRAC.png]
]include figure]]ivs_sed_filters_IRAS.png]
]include figure]]ivs_sed_filters_ISOCAM.png]
]include figure]]ivs_sed_filters_JOHNSON.png]
]include figure]]ivs_sed_filters_KEPLER.png]
]include figure]]ivs_sed_filters_KRON.png]
]include figure]]ivs_sed_filters_LANDOLT.png]
]include figure]]ivs_sed_filters_MIPS.png]
]include figure]]ivs_sed_filters_MOST.png]
]include figure]]ivs_sed_filters_MSX.png]
]include figure]]ivs_sed_filters_NARROW.png]
]include figure]]ivs_sed_filters_NICMOS.png]
]include figure]]ivs_sed_filters_OAO2.png]
]include figure]]ivs_sed_filters_PACS.png]
]include figure]]ivs_sed_filters_SAAO.png]
]include figure]]ivs_sed_filters_SCUBA.png]
]include figure]]ivs_sed_filters_SDSS.png]
]include figure]]ivs_sed_filters_SLOAN.png]
]include figure]]ivs_sed_filters_SPIRE.png]
]include figure]]ivs_sed_filters_STEBBINS.png]
]include figure]]ivs_sed_filters_STISCCD.png]
]include figure]]ivs_sed_filters_STISFUV.png]
]include figure]]ivs_sed_filters_STISNUV.png]
]include figure]]ivs_sed_filters_STROMGREN.png]
]include figure]]ivs_sed_filters_TD1.png]
]include figure]]ivs_sed_filters_TYCHO.png]
]include figure]]ivs_sed_filters_TYCHO2.png]
]include figure]]ivs_sed_filters_ULTRACAM.png]
]include figure]]ivs_sed_filters_USNOB1.png]
]include figure]]ivs_sed_filters_UVEX.png]
]include figure]]ivs_sed_filters_VILNIUS.png]
]include figure]]ivs_sed_filters_VISIR.png]
]include figure]]ivs_sed_filters_WALRAVEN.png]
]include figure]]ivs_sed_filters_WFPC2.png]
]include figure]]ivs_sed_filters_WISE.png]
]include figure]]ivs_sed_filters_WOOD.png]
You can add custom filters on the fly using add_custom_filter. In this example we add a weird-looking filter and check the definition of Flambda and Fnu and its relation to the effective wavelength of a passband:
Prerequisites: some modules that come in handy:
>>> from ivs.sigproc import funclib >>> from ivs.sed import model >>> from ivs.units import conversions
First, we'll define a double peakd Gaussian profile on the wavelength grid of the WISE.W3 response curve:
>>> wave = get_response('WISE.W3')[0] >>> trans = funclib.evaluate('gauss',wave,[1.5,76000.,10000.,0.]) >>> trans+= funclib.evaluate('gauss',wave,[1.0,160000.,25000.,0.])
This is what it looks like:
>>> p = pl.figure() >>> p = pl.plot(wave/1e4,trans,'k-') >>> p = pl.xlabel("Wavelength [micron]") >>> p = pl.ylabel("Transmission [arbitrary units]")
]include figure]]ivs_sed_filters_weird_trans.png]
We can add this filter to the list of predefined filters in the following way (for the doctests to work, we have to do a little work around and call filters via that module, this is not needed in a normal workflow):
>>> model.filters.add_custom_filter(wave,trans,photband='LAMBDA.CCD',type='CCD') >>> model.filters.add_custom_filter(wave,trans,photband='LAMBDA.BOL',type='BOL')
Note that we add the filter twice, once assuming that it is
mounted on a bolometer, and once on a CCD device. We'll call the
filter LAMBDA.CCD
and LAMBDA.BOL
. From now
on, they are available within functions as get_info
and get_response. For example, what is the effective
(actually pivot) wavelength?
>>> effwave_ccd = model.filters.eff_wave('LAMBDA.CCD') >>> effwave_bol = model.filters.eff_wave('LAMBDA.BOL') >>> print(effwave_ccd,effwave_bol) (119263.54911400242, 102544.27931275869)
Let's do some synthetic photometry now. Suppose we have a black body atmosphere:
>>> bb = model.blackbody(wave,5777.)
We now calculate the synthetic flux, assuming the CCD and BOL device. We compute the synthetic flux both in Flambda and Fnu:
>>> flam_ccd,flam_bol = model.synthetic_flux(wave,bb,['LAMBDA.CCD','LAMBDA.BOL']) >>> fnu_ccd,fnu_bol = model.synthetic_flux(wave,bb,['LAMBDA.CCD','LAMBDA.BOL'],units=['FNU','FNU'])
You can see that the fluxes can be quite different when you assume photon or energy counting devices!
>>> flam_ccd,flam_bol (897.68536911320564, 1495.248213834755) >>> fnu_ccd,fnu_bol (4.2591095543803019e-06, 5.2446332430111098e-06)
Can we now readily convert Flambda to Fnu with assuming the pivot wavelength?
>>> fnu_fromflam_ccd = conversions.convert('erg/s/cm2/AA','erg/s/cm2/Hz',flam_ccd,wave=(effwave_ccd,'A')) >>> fnu_fromflam_bol = conversions.convert('erg/s/cm2/AA','erg/s/cm2/Hz',flam_bol,wave=(effwave_bol,'A'))
Which is equivalent with:
>>> fnu_fromflam_ccd = conversions.convert('erg/s/cm2/AA','erg/s/cm2/Hz',flam_ccd,photband='LAMBDA.CCD') >>> fnu_fromflam_bol = conversions.convert('erg/s/cm2/AA','erg/s/cm2/Hz',flam_bol,photband='LAMBDA.BOL')
Apparently, with the definition of pivot wavelength, you can safely convert from Fnu to Flambda:
>>> print(fnu_ccd,fnu_fromflam_ccd) (4.2591095543803019e-06, 4.259110447428463e-06) >>> print(fnu_bol,fnu_fromflam_bol) (5.2446332430111098e-06, 5.2446373530017525e-06)
The slight difference you see is numerical.
Under usual conditions, you are prohibited from overwriting an
existing predefined response curve. That is, if you try to add_custom_filter with a photband
that
already exists as a file, a ValueError
will be raised
(this is not the case for a custom defined filter, which you can
overwrite without problems!). If, for testing purposes, you want to
use another definition of a predefined response curve, you need to
set force=True
in add_custom_filter, and then call
>>> set_prefer_file(False)
To reset and use the original definitions again, do
>>> set_prefer_file(True)
Add a new response curve file to the ivs/sed/filters directory. The file should contain two columns, the first column is the wavelength in angstrom, the second column is the transmission curve. The units of the later are not important.
Then, call update_info. The contents of
zeropoints.dat
will automatically be updated. Make sure
to add any additional information on the new filters manually in that
file (e.g. is t a CCD or bolometer, what are the zeropoint magnitudes
etc).
|
|||
response curves | |||
---|---|---|---|
(array, array) |
|
||
ndarray |
|
||
|
|||
|
|||
|
|||
list of str |
|
||
bool |
|
||
tuple |
|
||
tuple,callable |
|
||
float or numpy array |
|
||
record array |
|
||
|
|
|||
basedir = os.path.dirname(__file__)
|
|||
logger = logging.getLogger("SED.FILT")
|
|||
custom_filters = {'_prefer_file': True}
|
|
Retrieve the response curve of a photometric system 'SYSTEM.FILTER' OPEN.BOL represents a bolometric open filter. Example usage: >>> p = pl.figure() >>> for band in ['J','H','KS']: ... p = pl.plot(*get_response('2MASS.%s'%(band))) If you defined a custom filter with the same name as an existing one
and you want to use that one in the future, set
|
Create a custom filter as a sum of Gaussians.
|
Add a custom filter to the set of predefined filters. Extra keywords are: 'eff_wave', 'type', 'vegamag', 'vegamag_lit', 'ABmag', 'ABmag_lit', 'STmag', 'STmag_lit', 'Flam0', 'Flam0_units', 'Flam0_lit', 'Fnu0', 'Fnu0_units', 'Fnu0_lit', 'source' default C{type} is 'CCD'. default C{photband} is 'CUSTOM.FILTER' @param wave: wavelength (angstrom) @type wave: ndarray @param response: response @type response: ndarray @param photband: photometric passband @type photband: str ('SYSTEM.FILTER') |
Set whether to prefer files or custom filters when both exist.
|
List available response curves. Specify a glob string
|
Return true if the photometric passband is actually a color.
|
Retrieve the photometric bands from color
|
Make a color from a color name and fluxes. You get two things: a list of photbands that are need to construct the color, and a function which you need to pass fluxes to compute the color. >>> bands, func = make_color('JOHNSON.B-V') >>> print(bands) ('JOHNSON.B', 'JOHNSON.V') >>> print(func(2,3.)) 0.666666666667
|
Return the effective wavelength of a photometric passband. The effective wavelength is defined as the average wavelength weighed with the response curve. >>> eff_wave('2MASS.J') 12393.093155655277 If you give model fluxes as an extra argument, the wavelengths will take these into account to calculate the `true' effective wavelength (e.g., Van Der Bliek, 1996), eq 2.
|
Return a record array containing all filter information. The record arrays contains following columns:
|
Update information in zeropoint file, e.g. after calibration. Call first ivs.sed.model.calibrate without arguments, and pass the output to this function.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Mar 30 10:45:19 2018 | http://epydoc.sourceforge.net |