get_photometry(ID=None,
to_units='erg/s/cm2/AA',
extra_fields=[],
include=None,
exclude=None,
**kwargs)
| source code
|
Collect photometry from different sources.
The output consists of a record array containing the following
keys:
'meas': the measurement's value directly from the catalog in original
units 'e_meas': the error on the measurements 'flag': any flags that are
associated with the measurement in a catalog 'unit': the unit of the
original measurement 'source' the source catalog's name 'photband':
photometric pass bands' name 'cwave': the effective wavelength of the
passband 'cmeas': converted measurement (to to_units )
'e_cmeas': error on converted measurment 'cunit': converted unit
Be aware that some of the values can be 'nan': e.g. sometimes no error
is listed in the catalog, or no flag. Also the 'cwave' column will be nan
for all photometric colours (e.g. B-V)
If you define extra_fields , make sure all the
{get_photometry} know how to handle it: probably some default values need
to be inserted if these extra columns are not available in some catalog.
It is safest just to leave it blank.
You can include or exclude search sources via include and
exclude . When given, these should be a list containing
strings. The default is to include gator ,
vizier and gcpd .
Extra keyword arguments are passed to each get_photometry
functions in this package's modules.
Example usage:
-
You want to download all available photometry and write the results
to an ASCII file for later reference.
>>> master = get_photometry('vega')
>>> ascii.write_array(master,header=True,auto_width=True)
-
You want to plot the raw, unmodelled SED of an object:
>>> master = get_photometry('vega')
>>> pl.errorbar(master['cwave'],master['cmeas'],yerr=master['e_cmeas'],fmt='ko')
>>> pl.gca().set_xscale('log',nonposx='clip')
>>> pl.gca().set_yscale('log',nonposy='clip')
We made no difference between colors (B-V) and magnitude (V), because
the 'cwave' for colors is 'nan', so they will not be plotted anyway.The
final two lines are just to correct errorbars that go below zero in a
logarithmic plot.
- Parameters:
ID (str) - the target's name, understandable by SIMBAD
to_units () - units to convert everything to.
include (list of strings (from gator , vizier or
gcpd )) - sources to include
exclude (list of strings (from gator , vizier or
gcpd )) - sources to include
- Returns: record array
- record array where eacht entry is a photometric measurement
|