Package: extinctions
extinctionsPython package including different extinction laws and dust maps. Useful toget E(B-V) for a set of coordinates (or list of coordinates) from differentdistant sources (IRSA, NED)local maps (SFD98, Schlafly 2014, Planck 2013, Green 2015)compute the ISM transmission for different extincion lawsCCM89: Cardelli, Clayton and Mathis (http://adsabs.harvard.edu/abs/1989ApJ…345..245C)OD94: O’Donnell (http://adsabs.harvard.edu/abs/1994ApJ…422..158O)FM98: Fitzpatrick & Massa (1998)G08: Goobar (http://adsabs.harvard.edu/abs/2008ApJ…686L.103G)InstallationTo install:git clone https://github.com/nicolaschotard/extinctions.git
pip install extinctions/To install in a local directorymypath, use:pip install --prefix='mypath' extinctions/and do not forget to add it to your PYTHONPATH.To upgrade to a new version (after agit pullor a local modification), use:pip install --upgrade (--prefix='mypath') extinctions/To install a release version (no release version available yet):pip install http://github.com/nicolaschotard/extinctions/archive/v0.1.tar.gzAlso works with the master:pip install (--upgrade) https://github.com/nicolaschotard/extinctions/archive/master.zipIn the future, release versions will be listed at thislocation.Dependenciesextinctionshas a few python dependencies listed in therequirementsfile. To install them all, use:pip install -r requirements.txtRequirements are:numpy==1.11.2scipy==0.17.1matplotlib==1.5.1seaborn==0.7.0pyyaml==3.11astropy==1.2.1requests==2.10.0astroquery==0.3.1wget==2.2healpy==1.9.1Dust map setupYou can automatically download the dust maps listed in themaps.yamlfile using the scriptget_maps.py. It
will, by default, put them in $HOME/.extinction/maps, but other
locations are of course possible (option–outdir). If you choose to
store them in an other diretory, you must set a $MAPSDIR environment
variable pointing to it. Already existing maps in the output directory
will not be downloaded again.The available dust maps are:SFD98, full sky Healpy formatSFD98northandsouthdust mapsPlanckSchlafly 2014Green 2015Download the mapsTo download the extinction maps listed above, use the scriptget_maps.py. The following options are available:get_maps.py -h
usage: get_maps.py [-h] [--outdir OUTDIR] [--update] [--list]
                 [--select SELECT] [--exclude EXCLUDE]

optional arguments:
   -h, --help         show this help message and exit
   --outdir OUTDIR    Output directory in where to put the dust maps
   --update           Update the maps directory in case of changes of maps.yaml
   --list             List of available maps and exit
   --select SELECT    Select maps to download (coma separated)
   --exclude EXCLUDE  Exclude map(s) (coma separated).If the select option is
                      used, the exclude option will be ignored.UsageGet E(B-V)Here is an example of how to get the value of E(B-V) for a set of
coordinates (RA,DEC):In[1]:ra,dec=340.83,-9.59# could also be arrays or list of ra/decIn[2]:fromextinctionsimportreddeningIn[3]:red=reddening.Reddening(ra,dec)# ra dec can also be lists of coordinatesINFO:Loadingthemapsfromlocaldirectory/home/chotard/.extinction/maps/-greenisloaded-schlaflyisloaded-sfdisloaded-planckisloadedYou can then get E(B-V) from different sources:# from the local mapsIn[4]:red.query_local_map(dustmap='sfd')Out[4]:0.047723956233310674In[5]:red.query_local_map(dustmap='schlafly')Out[5]:0.062566755984547445In[6]:red.query_local_map(dustmap='planck')Out[6]:0.052058338535565914In[7]:red.query_local_map(dustmap='green')Out[7]:0.035786284169101318# from the SFD98 north/south maps using `sncosmo`In[8]:red.from_sncosmo()Out[8]:array([0.0473752])# Using astroqueryIn[9]:red.from_astroquery()Downloadinghttp://irsa.ipac.caltech.edu//workspace/TMP_XG1Joz_30445/DUST/340.8300_-9.5900.v0001/extinction.tbl|==============================================================================================|4.3k/4.3k(100.00%)0sOut[9]:[0.047377326565143825]Make some plotsTo have a look at the different extinction laws amd dust maps, you can
use the scriptextinction_plots.py.