PyDL:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- pydl v1.0.0-rc2 »
- SDSS Utilities (`pydl.pydlutils`) »
- sdss_flagval

# sdss_flagval

pydl.pydlutils.sdss.sdss_flagval(flagname, bitname)

  Convert bitmask names into values.

  Converts human-readable bitmask names into numerical values. The inputs are not case-sensitive; all inputs are converted to upper case internally.

  Parameters
    flagname `str`

      The name of a bitmask group.

    bitname `str` or `list`

      The name(s) of the specific bitmask(s) within the `flagname` group.

  Returns
    `numpy.uint64`

      The value of the bitmask name(s).

  Raises
    `KeyError`

      If `flagname` or `bitname` are invalid names.

  Examples

      >>> from pydl.pydlutils.sdss import sdss_flagval
      >>> sdss_flagval('ANCILLARY_TARGET1',['BLAZGX','ELG','BRIGHTGAL'])
      2310346608843161600