gdpyc package

Submodules

gdpyc.core module

Gas and Dust Python Calculator

A python module for estimating extinction, reddening and Hydrogen column densities.

class DustMap[source]

Bases: gdpyc.core.Map

Class for dust maps.

classmethod ebv(coords, dustmap='SFD', hires=False)[source]

E(B - V) in the line-of-sight of coords.

Parameters:
  • coords (SkyCoord) – Astropy SkyCoord object with the line-of-sight coordinates.
  • dustmap (str, optional) – Name of the dust survey. Use show_maps method to see a list of all available maps. Defaults to ‘SFD’.
  • hires (boolean, optional) – Use high resolution map. If the map is not available locally, it is downloaded. Defaults to False.
Returns:

ebv (float or numpy.ndarray) – Float, or numpy array with shape like coords.

classmethod extinction(coords, dustmap='SFD', filters='default', hires=False)[source]

Galactic extinction in the line-of-sight of coords for the bandpasses defined in filters. If there are N coords and M filters, returns an astropy table of shape N x M.

Note: E(B - V) to extinction conversion coefficients were estimated in [4] for the SFD map [5]. Using this method with a different dust map is possible, but obtaining accurate values is highly unlikely.

Parameters:
  • coords (SkyCoord) – Astropy SkyCoord object with the line-of-sight coordinates.
  • dustmap (str, optional) – Name of the dust survey. Use show_maps method to see a list of all available maps. Defaults to ‘SFD’.
  • filters (str or list, optional) – List of the filters (or, equivalently, a single string with comma separated filters). Use show_filters method to see a list of all available maps. If filters is ‘default’, returns extinction for the five SDSS bands (u, g, r, i, z). Defaults to ‘default’.
  • hires (boolean, optional) – Use high resolution map. If the map is not available locally, it is downloaded. Defaults to False.
Returns:

ext (Table) – Astropy Table with the extinction values at coords for each selected filter.

References

[4](1, 2) Schlafly & Finkbeiner 2011, ApJ, 737, 2, 103.
[5]Schlegel, Finkbeiner & Davis 1998, ApJ, 500, 2.
classmethod show_filters(lambda_eff=False)[source]

List of the available filters in the S&F conversion table [4].

Parameters:lambda_eff (boolean, optional) – If True, also returns the effective wavelength of each filter. Deafults to False.
class GasMap[source]

Bases: gdpyc.core.Map

Class for HI maps.

classmethod nh(coords, nhmap='LAB', hires=False)[source]

Hydrogen column density in the line-of-sight of coords, using LAMBDA healpix maps [1].

Parameters:
  • coords (SkyCoord) – Astropy SkyCoord object with the line-of-sight coordinates.
  • nhmap (str, optional) – Name of the HI survey. Use show_maps method to see a list of all available maps. Defaults to ‘LAB’.
  • hires (boolean, optional) – Use high resolution map. If the map is not available locally, it is downloaded. Defaults to False.
Returns:

nh (Quantity) – An Astropy Quantity object with shape like coords, in cm**-2.

References

[1]https://lambda.gsfc.nasa.gov/product/foreground/fg_diffuse.cfm
classmethod nhf(coords, nhmap='LAB', radius=<Quantity 1. deg>)[source]

Hydrogen column density in the line-of-sight of coords, using HEASoft fits images (resolution of 0.675 x 0.675 deg) [3] and method.

Parameters:
  • coords (SkyCoord) – Astropy SkyCoord object with the line-of-sight coordinates.
  • nhmap (str, optional) – Name of the HI survey. Use show_maps method to see a list of all available maps. Defaults to ‘LAB’.
  • radius (Quantity, optional) – Radius of the circle around coords where the nH value is averaged. An Astropy angular Quantity object, consistent with degrees.
Returns:

nh (Quantity) – An Astropy Quantity object with shape like coords, in cm**-2..

References

[3]Original fits files created by K. Kuntz (LAB) and Steve Snowden (DL).
classmethod nhtotal(coords, hires=False)[source]

Total Hydrogen column density (NHI + 2NH2) in the line-of-sight of coords, using Willingale’s method [2].

Parameters:
  • coords (SkyCoord) – Astropy SkyCoord object with the line-of-sight coordinates.
  • hires (boolean, optional) – Use high resolution maps. If the map is not available locally, it is downloaded. Defaults to False.
Returns:

nhtotal (Quantity) – An Astropy Quantity object with shape like coords, in cm**-2.

References

[2]Willingale et al. 2013, MNRAS, 431, 1.
class Map[source]

Bases: object

A class with common methods for HEALpix maps.

classmethod plot_map(map_name, plotname=None)[source]

Full-sky plot (mollweide projection) of the map.

Note: this method needs healpy and matplotlib.

Parameters:
  • map_name (str) – Name of the map to be plotted. Use show_maps method to see a list of all available maps.
  • plotname (str or None, optional) – Name of the file where the plot will be saved. If None, the plot is shown but not saved. Defaults to None.
Returns:

plot (numpy.ndarray) – 2D numpy array with the plot.

classmethod show_maps()[source]

Show available maps.

classmethod unseen_pixels(map_name, hires=False)[source]

Returns a list of UNSEEN healpix pixels contained in map_name.

Parameters:
  • map_name (str) – Name of the map to be plotted. Use show_maps method to see a list of all available maps.
  • hires (boolean, optional) – Use high resolution map. If the map is not available locally, it is downloaded. Defaults to False.

gdpyc.data module

Gas and Dust Python Calculator.

Module for downloading and processing the HEALpix maps used in gdpyc.

degrade_map(mapfile, order=6)[source]
download_map(url, data_dir, filename=None)[source]
get_lowres_maps(data_dir)[source]
get_map(maplabel, data_dir)[source]
main()[source]
parse_DL(mapfile, outfile)[source]
parse_HI4PI(mapfile, outfile)[source]
parse_LAB(mapfile, outfile)[source]
parse_Planck13(mapfile, outfile)[source]