Home | Trees | Indices | Help |
---|
|
Interface to the VizieR website.
Download or retrieve VizieR catalogs.
The basic interface search
lets you download entire
catalogs or parts of them. The structure array containts then one row
per target, the columns denoting the different columns of the catalogs.
You can also specify two catalogs in xmatch
; the second will
then be cross-matched against the first.
The convenience functions (get_photometry
,...) aim to
collect information from different catalogs on one target in one
array. Each row represents one measurement from one catalog (typically
you'll have many rows both from one catalog but also from different
catalogs). The columns then denote the contents of each row (e.g. the
magnitude, photometric passband etc).
Download the entire Van Leeuwen Hipparcos New Reduction catalog to a file. The filename is returned as a check for success.
>>> filename = search('I/311/hip2',filename='vanleeuwen.tsv')
Download a 60 arcsec circular area from the catalog around the coordinates ra=237.1, dec=-10.10
>>> filename = search('I/311/hip2',ra=237.1,dec=-10.10,radius=60.,filename='vanleeuwen.tsv')
Search for the presence of a target in the catalog. The downloaded file will contain no rows if the target is not in the catalog. If more than one target are in the search radius around the target, there will be more than one row. They are ordered via distance to the target, so it's probably the first one you need.
>>> filename = search('I/311/hip2',ID='vega',filename='vanleeuwen.tsv') >>> filename = search('I/311/hip2',ID='vega',filename='vanleeuwen.tsv',radius=60.)
Instead of downloading to a file and then reading in the file for further analysis, you can download the contents of the file directly to a record array, retrieving the units and comments from the catalog in one go. The equivalent of the third example above becomes
>>> rec_arr,unit_dict,comment_str = search('I/311/hip2',ID='vega')
With these record arrays, its very easy to select targets based on criteria. For example, if you want to extract 2MASS targets in a certain area with a negative H-K index, you can do
>>> data,units,comms = search('II/246/out',ra=237.1,dec=-10.10,radius=600.) >>> selection = (data['Hmag'] - data['Kmag']) < 0 >>> data = data[selection]
You can also read in a data file you've previously downloaded via
>>> data,units,comms = tsv2recarray('vanleeuwen.tsv')
To know in which catalogs your target is present, list them all via
>>> my_cats = list_catalogs('vega')
Now you could iterate over them and download them to a file or whatever.
You can define 'standard' photometric catalogs in the
vizier_cats.cfg
file. This file is basically a translator
for VizieR column headers to photometric passbands (and colors). For
examples, see the file itself.
You can add catalogs on the fly via
>>> cat_info.add_section('my_new_catalog') >>> cat_info.set('my_new_catalog','Bmag','JOHNSON.B')
|
|||
Basic interfaces | |||
---|---|---|---|
|
|||
str/ record array, dict, list of str |
|
||
dictionary |
|
||
|
|||
Interface to specific catalogs | |||
|
|||
|
|||
Convenience functions | |||
|
|||
|
|||
record array, dict, list of str |
|
||
record array |
|
||
record array |
|
||
str |
|
||
str |
|
||
str |
|
||
Internal helper functions | |||
str |
|
||
record array |
|
||
|
|
|||
logger = logging.getLogger("CAT.VIZIER")
|
|||
basedir = os.path.dirname(os.path.abspath(__file__))
|
|||
cat_info = ConfigParser.ConfigParser()
|
|||
cat_info_fund = ConfigParser.ConfigParser()
|
|||
mirrors = {'cycle': itertools.cycle(['vizier.u-strasbg.fr', 'v
|
|
Search and retrieve information from a VizieR catalog. Two ways to search for data within a catalog
If you have a list of targets, you need to loop this function. If you supply a filename, the results will be saved to that path, and you will get the filename back as received from urllib.URLopener (should be the same as the input name, unless something went wrong). If you don't supply a filename, you should leave WARNING: when retrieving a FITS file, ViZieR sometimes puts weird
formats into the header ('3F10.6E' in the 2MASS catalog), which cannot be
read by the Example usage:
|
Print and return all catalogs containing information on the star. If you give Extra kwargs: see _get_URI.
|
Crossmatch two vizier catalogs via a fast KDTree. The limit for these catalogs is probably somewhere between ~100000 entries, so make sure your catalogs do not contain to many targets. You can always do a subselection via the keyword arguments (e.g. give ra, dec and radius). An output tsv file will be written (by default named
'source1__source2', which can be read in via tolerance is in arcseconds. Extra keyword arguments are passed to |
Download IUE spectra. If you want to download all the spectral files, set
If you don't wish to unzip them, set unzip=False DEPRECATED: If you don't give a directory, the function will return a list of all extracted spectra (no data files are kept). You can retrieve the contents of the vizier catalog via {cat_info=True}. The files will not be downloaded in this case. |
Get a spectrum from the UVSST spectrograph onboard TD1. From vizier catalog III/39A. Also have a look at II/86/suppl. |
Download all available photometry from a star to a record array. For extra kwargs, see _get_URI and vizier2phot |
Perform quality checks on downloaded data. This function translates flags in to words, and looks up additional information in selected catalogs. |
Read a Vizier tsv (tab-sep) file into a record array.
|
Convert/combine VizieR record arrays to measurement record arrays. Every line in the combined array represents a measurement in a certain band. This is probably only useful if The standard columns are:
You can add extra information from the VizieR catalog via the list of
keys If you give a Colors will be expanded, derived from the other columns and added to the master. The result is a record array with each row a measurement. Example usage: First look for all photometry of Vega in all VizieR catalogs: >>> from ivs.sed import filters >>> import pylab >>> master = None >>> for source in cat_info.sections(): ... results,units,comms = search(source,ID='vega',radius=60.) ... if results is not None: ... master = vizier2phot(source,results,units,master,extra_fields=['_r','_RAJ2000','_DEJ2000']) Keep only observations we have an measurement and error of, convert every observation to 'Jy' and keep track of the results to plot. >>> master = master[(-np.isnan(master['e_meas'])) & (-np.isnan(master['meas']))] >>> eff_waves = filters.eff_wave(master['photband']) >>> myvalue,e_myvalue = conversions.nconvert(master['unit'],'erg/s/cm2/AA',master['meas'],master['e_meas'],photband=master['photband']) >>> for i in range(len(master)): ... print '%15s %10.3e+/-%10.3e %11s %10.3e %3s %6.2f %6.2f %6.3f %23s'%(master[i]['photband'],master[i]['meas'],master[i]['e_meas'],master[i]['unit'],myvalue[i],'Jy',master[i]['_RAJ2000'],master[i]['_DEJ2000'],master[i]['_r'],master[i]['source']) GENEVA.V 6.100e-02+/- 2.500e-02 mag 3.620e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.B -8.980e-01+/- 2.500e-02 mag 6.518e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.U 6.070e-01+/- 2.500e-02 mag 3.223e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.V1 7.640e-01+/- 2.500e-02 mag 3.782e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.B1 2.000e-03+/- 2.500e-02 mag 6.584e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.B2 6.120e-01+/- 2.500e-02 mag 6.208e-09 Jy 279.24 38.77 56.000 II/169/main GENEVA.G 1.270e+00+/- 2.500e-02 mag 3.111e-09 Jy 279.24 38.77 56.000 II/169/main 2MASS.J -1.770e-01+/- 2.060e-01 mag 3.591e-10 Jy 279.23 38.78 0.034 II/246/out 2MASS.H -2.900e-02+/- 1.460e-01 mag 1.176e-10 Jy 279.23 38.78 0.034 II/246/out 2MASS.KS 1.290e-01+/- 1.860e-01 mag 3.799e-11 Jy 279.23 38.78 0.034 II/246/out IRAS.F12 4.160e+01+/- 1.664e+00 Jy 1.024e-13 Jy 279.23 38.78 9.400 II/125/main IRAS.F25 1.100e+01+/- 5.500e-01 Jy 6.195e-15 Jy 279.23 38.78 9.400 II/125/main IRAS.F60 9.510e+00+/- 7.608e-01 Jy 8.420e-16 Jy 279.23 38.78 9.400 II/125/main IRAS.F100 7.760e+00+/- 6.984e-01 Jy 2.349e-16 Jy 279.23 38.78 9.400 II/125/main TD1.1565 5.689e-09+/- 1.700e-11 10mW/m2/nm 5.689e-09 Jy 279.23 38.78 18.510 II/59B/catalog TD1.1965 4.928e-09+/- 1.300e-11 10mW/m2/nm 4.928e-09 Jy 279.23 38.78 18.510 II/59B/catalog TD1.2365 3.700e-09+/- 1.000e-11 10mW/m2/nm 3.700e-09 Jy 279.23 38.78 18.510 II/59B/catalog TD1.2740 3.123e-09+/- 9.000e-12 10mW/m2/nm 3.123e-09 Jy 279.23 38.78 18.510 II/59B/catalog ANS.15N -4.910e-01+/- 1.000e-03 mag 5.707e-09 Jy 279.23 38.78 14.000 II/97/ans ANS.15W -4.410e-01+/- 1.200e-02 mag 5.450e-09 Jy 279.23 38.78 14.000 II/97/ans ANS.18 -4.620e-01+/- 3.000e-03 mag 5.556e-09 Jy 279.23 38.78 14.000 II/97/ans ANS.25 4.600e-02+/- 4.000e-03 mag 3.480e-09 Jy 279.23 38.78 14.000 II/97/ans ANS.33 1.910e-01+/- 3.000e-03 mag 3.045e-09 Jy 279.23 38.78 14.000 II/97/ans HIPPARCOS.HP 8.680e-02+/- 2.100e-03 mag 3.840e-09 Jy 279.23 38.78 3.060 I/239/hip_main MIPS.24 8.900e+03+/- 8.900e+01 mJy 4.628e-15 Jy 279.23 38.78 0.010 J/ApJ/653/675/table1 MIPS.70 1.142e+04+/- 2.283e+03 mJy 7.075e-16 Jy 279.23 38.78 0.010 J/ApJ/653/675/table1 JOHNSON.B 1.900e-02+/- 1.000e-02 mag 6.216e-09 Jy 279.23 38.78 3.060 I/280B/ascc JOHNSON.V 7.400e-02+/- 2.000e-03 mag 3.428e-09 Jy 279.23 38.78 3.060 I/280B/ascc JOHNSON.V 3.300e-02+/- 1.200e-02 mag 3.560e-09 Jy 279.23 38.78 0.010 II/168/ubvmeans JOHNSON.B-V -1.000e-03+/- 5.000e-03 mag nan Jy 279.23 38.78 0.010 II/168/ubvmeans JOHNSON.U-B -6.000e-03+/- 6.000e-03 mag nan Jy 279.23 38.78 0.010 II/168/ubvmeans JOHNSON.B 3.200e-02+/- 1.300e-02 mag 6.142e-09 Jy 279.23 38.78 0.010 II/168/ubvmeans JOHNSON.U 2.600e-02+/- 1.432e-02 mag 4.086e-09 Jy 279.23 38.78 0.010 II/168/ubvmeans JOHNSON.K 1.300e-01+/- 1.900e-01 mag 3.764e-11 Jy 279.23 38.78 0.010 J/PASP/120/1128/catalog AKARI.N60 6.582e+00+/- 2.090e-01 Jy 4.614e-16 Jy 279.23 38.78 3.400 II/298/fis AKARI.WIDES 6.201e+00+/- 1.650e-01 Jy 2.566e-16 Jy 279.23 38.78 3.400 II/298/fis AKARI.WIDEL 4.047e+00+/- 3.500e-01 Jy 5.658e-17 Jy 279.23 38.78 3.400 II/298/fis AKARI.N160 3.221e+00+/- 2.550e-01 Jy 3.695e-17 Jy 279.23 38.78 3.400 II/298/fis AKARI.S9W 5.670e+01+/- 4.010e-01 Jy 2.169e-13 Jy 279.24 38.78 2.550 II/297/irc AKARI.L18W 1.254e+01+/- 7.770e-02 Jy 1.050e-14 Jy 279.24 38.78 2.550 II/297/irc STROMGREN.B-Y 3.000e-03+/- 3.000e-03 mag nan Jy 279.23 38.78 22.000 II/215/catalog STROMGREN.M1 1.570e-01+/- 3.000e-03 mag nan Jy 279.23 38.78 22.000 II/215/catalog STROMGREN.C1 1.088e+00+/- 4.000e-03 mag nan Jy 279.23 38.78 22.000 II/215/catalog STROMGREN.B 4.300e-02+/- 3.000e-03 mag 5.604e-09 Jy 279.23 38.78 22.000 II/215/catalog DIRBE.F2_2 6.217e+02+/- 9.500e+00 Jy 3.791e-11 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F3_5 2.704e+02+/- 1.400e+01 Jy 6.534e-12 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F4_9 1.504e+02+/- 6.200e+00 Jy 1.895e-12 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F12 2.910e+01+/- 1.570e+01 Jy 6.014e-14 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F25 1.630e+01+/- 3.120e+01 Jy 1.153e-14 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F60 1.220e+01+/- 5.610e+01 Jy 1.195e-15 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F100 -7.000e-01+/- 7.790e+01 Jy -2.238e-17 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F140 2.557e+02+/- 5.223e+03 Jy 3.577e-15 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE DIRBE.F240 8.290e+01+/- 2.881e+03 Jy 4.152e-16 Jy 279.23 38.78 0.110 J/ApJS/154/673/DIRBE WISE.W2 1.143e+00+/- 1.900e-02 mag 8.428e-13 Jy 279.24 38.78 3.276 II/311/wise WISE.W3 -6.700e-02+/- 8.000e-03 mag 6.930e-14 Jy 279.24 38.78 3.276 II/311/wise WISE.W4 -1.270e-01+/- 6.000e-03 mag 5.722e-15 Jy 279.24 38.78 3.276 II/311/wise Make a quick plot: >>> p = pylab.figure() >>> p = pylab.loglog(eff_waves,myvalue,'ko') >>> p = pylab.show()
|
Convert/combine VizieR record arrays to measurement record arrays. This is probably only useful if The standard columns are:
If a target appears more than once in a catalog, only the first match will be added. The result is a record array with each row a measurement. Example usage: >>> master = None >>> for source in cat_info_fund.sections(): ... results,units,comms = search(source,ID='AzV 79',radius=60.) ... if results is not None: ... master = vizier2fund(source,results,units,master,extra_fields=['_r','_RAJ2000','_DEJ2000']) >>> master = master[-np.isnan(master['meas'])] >>> for i in range(len(master)): ... print '%10s %10.3e+/-%10.3e %11s %6.2f %6.2f %6.3f %23s'%(master[i]['name'],master[i]['meas'],master[i]['e_meas'],master[i]['unit'],master[i]['_RAJ2000'],master[i]['_DEJ2000'],master[i]['_r'],master[i]['source']) Teff 7.304e+03+/- nan K 12.67 -72.83 0.002 B/pastel/pastel logg 2.000e+00+/- nan [cm/s2] 12.67 -72.83 0.002 B/pastel/pastel [Fe/H] -8.700e-01+/- nan [Sun] 12.67 -72.83 0.002 B/pastel/pastel
|
Retrieve the ADS bibcode of a ViZieR catalog.
|
Retrieve the bibtex entry of an ADS bibcode.
|
Retrieve the bibtex entry of a catalog.
|
Build Vizier URI from available options. kwargs are to catch unused arguments.
|
From colors and one magnitude measurement, derive the other magnitudes.
|
Execute all docstrings. >>> import pylab >>> p = pylab.show() |
|
mirrors
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Mar 30 10:45:19 2018 | http://epydoc.sourceforge.net |