def __init__(self, map_fname=None, component='extragalactic'):
        """
        Args:
            map_fname (Optional[:obj:`str`]): Filename of the Planck map. Defaults to
                ```None``, meaning that the default location is used.
            component (Optional[str]): Which measure of reddening to use. There
                are seven valid components. Three denote reddening measures:
                ``'extragalactic'``, ``'tau'`` and ``'radiance'``. Four refer to dust
                properties: ``'temperature'``, ``'beta'``, ``'err_temp'`` and ``'err_beta'``.
                Defaults to ``'extragalactic'``.
        """

        if map_fname is None:
            map_fname = os.path.join(
                data_dir(),
                'planck',
                'HFI_CompMap_ThermalDustModel_2048_R1.20.fits')

        if component.lower() in ('ebv', 'extragalactic'):
            field = 'EBV'
            self._scale = 1.
        elif component.lower() in ('tau', 'tau353', 'tau_353', 'optical depth'):
            field = 'TAU353'
            self._scale = 1.49e4
        elif component.lower() in ('radiance', 'r'):
            field = 'RADIANCE'
            self._scale = 5.4e5
        elif component.lower() in ('temperature', 'temp', 't'):
            field = 'TEMP'
            self._scale = units.Kelvin
        elif component.lower() in ('sigma_temp', 'sigma_t', 'err_temp', 'err_t'):
            field = 'ERR_TEMP'
            self._scale = units.Kelvin
        elif component.lower() in ('beta', 'b'):
            field = 'BETA'
            self._scale = 1.
        elif component.lower() in ('sigma_beta', 'sigma_b', 'err_beta', 'err_b'):
            field = 'ERR_BETA'
            self._scale = 1.
        else:
            raise ValueError((
                "Invalid `component`: '{}'\n"
                "Valid components for reddening are 'extragalactic', 'tau', "
                "and 'radiance'. Valid components for dust properties are "
                "'temperature', 'err_temp', 'beta' and 'err_beta'."
                ).format(component))

        try:
            with fits.open(map_fname) as hdulist:
                super(PlanckQuery, self).__init__(
                    hdulist, 'galactic',
                    hdu='COMP-MAP',
                    field=field)
        except IOError as error:
            print(dustexceptions.data_missing_message('planck',
                                                      'Planck Collaboration'))
            raise error
def __init__ ( self , map_fname = None , component = 'extragalactic' ) : if map_fname is None : map_fname = os . path . join ( data_dir ( ) , 'planck' , 'HFI_CompMap_ThermalDustModel_2048_R1.20.fits' ) if component . lower ( ) in ( 'ebv' , 'extragalactic' ) : field = 'EBV' self . _scale = 1. elif component . lower ( ) in ( 'tau' , 'tau353' , 'tau_353' , 'optical depth' ) : field = 'TAU353' self . _scale = 1.49e4 elif component . lower ( ) in ( 'radiance' , 'r' ) : field = 'RADIANCE' self . _scale = 5.4e5 elif component . lower ( ) in ( 'temperature' , 'temp' , 't' ) : field = 'TEMP' self . _scale = units . Kelvin elif component . lower ( ) in ( 'sigma_temp' , 'sigma_t' , 'err_temp' , 'err_t' ) : field = 'ERR_TEMP' self . _scale = units . Kelvin elif component . lower ( ) in ( 'beta' , 'b' ) : field = 'BETA' self . _scale = 1. elif component . lower ( ) in ( 'sigma_beta' , 'sigma_b' , 'err_beta' , 'err_b' ) : field = 'ERR_BETA' self . _scale = 1. else : raise ValueError ( ( "Invalid `component`: '{}'\n" "Valid components for reddening are 'extragalactic', 'tau', " "and 'radiance'. Valid components for dust properties are " "'temperature', 'err_temp', 'beta' and 'err_beta'." ) . format ( component ) ) try : with fits . open ( map_fname ) as hdulist : super ( PlanckQuery , self ) . __init__ ( hdulist , 'galactic' , hdu = 'COMP-MAP' , field = field ) except IOError as error : print ( dustexceptions . data_missing_message ( 'planck' , 'Planck Collaboration' ) ) raise error
Args:
            map_fname (Optional[:obj:`str`]): Filename of the Planck map. Defaults to
                ```None``, meaning that the default location is used.
            component (Optional[str]): Which measure of reddening to use. There
                are seven valid components. Three denote reddening measures:
                ``'extragalactic'``, ``'tau'`` and ``'radiance'``. Four refer to dust
                properties: ``'temperature'``, ``'beta'``, ``'err_temp'`` and ``'err_beta'``.
                Defaults to ``'extragalactic'``.