Commit 7099355a authored by Ole Streicher's avatar Ole Streicher

New upstream version 2.1.9

parent 2fea6e4f
Metadata-Version: 1.1
Name: pyraf
Version: 2.1.7
Summary: Provides a Pythonic interface to IRAF that can be used in place of
the existing IRAF CL
Version: 2.1.9
Summary: Provides a Pythonic interface to IRAF that can be used in place of the existing IRAF CL
Home-page: http://www.stsci.edu/resources/software_hardware/pyraf
Author: Rick White, Perry Greenfield
Author: Rick White, Perry Greenfield, Chris Sontag
Author-email: help@stsci.edu
License: UNKNOWN
Description: PyRAF is a command language for IRAF based on the Python scripting language
......
add your name here:
sienkiew
sontag
chanley
we are on:
https://aeon.stsci.edu/ssb/svn/pyraf/trunk
......@@ -14,6 +14,10 @@ ms_windows = sys.platform.startswith('win')
# conditional for if we should build the C code
build_c = not ms_windows
# so my 2.5 fink build works:
if sys.version_info[:2] < (2,6):
build_c = False
ms_windows = True
C_EXT_MODNAME_ENDING = 'module'
if sys.version_info[0] > 2: # actually changes in Python 3.3, but why wait
......@@ -51,9 +55,9 @@ def find_x(xdir=""):
raise ImportError("Tkinter is not installed")
tk=Tkinter.Tk()
tk.withdraw()
tcl_lib = os.path.join((tk.getvar('tcl_library')), '../')
tcl_inc = os.path.join((tk.getvar('tcl_library')), '../../include')
tk_lib = os.path.join((tk.getvar('tk_library')), '../')
tcl_lib = os.path.join(str(tk.getvar('tcl_library')), '../')
tcl_inc = os.path.join(str(tk.getvar('tcl_library')), '../../include')
tk_lib = os.path.join(str(tk.getvar('tk_library')), '../')
tkv = str(Tkinter.TkVersion)[:3]
# yes, the version number of Tkinter really is a float...
if Tkinter.TkVersion < 8.3:
......@@ -102,6 +106,8 @@ if not ms_windows or build_c :
distutils.core.Extension(
'pyraf.sscanf'+C_EXT_MODNAME_ENDING,
['src/sscanfmodule.c'],
# extra_compile_args = ['-arch','i386','-arch','x86_64'],
# extra_link_args = ['-arch','i386','-arch','x86_64'],
include_dirs=add_inc_dirs
)
)
......@@ -115,6 +121,8 @@ if not ms_windows :
['src/xutil.c'],
include_dirs=add_inc_dirs,
library_dirs=add_lib_dirs,
# extra_compile_args = ['-arch','i386','-arch','x86_64'],
# extra_link_args = ['-arch','i386','-arch','x86_64'],
libraries = [x_libraries]
)
)
......@@ -219,7 +227,7 @@ if not ms_windows and sys.version_info[0] < 3:
setupargs = {
'version' : "2.x", # see lib's __init__.py
'description' : "A Python based CL for IRAF",
'author' : "Rick White, Perry Greenfield",
'author' : "Rick White, Perry Greenfield, Chris Sontag",
'maintainer_email' : "help@stsci.edu",
'url' : "http://www.stsci.edu/resources/software_hardware/pyraf",
'license' : "http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE",
......
Metadata-Version: 1.1
Name: pyraf
Version: 2.1.7
Summary: Provides a Pythonic interface to IRAF that can be used in place of
the existing IRAF CL
Version: 2.1.9
Summary: Provides a Pythonic interface to IRAF that can be used in place of the existing IRAF CL
Home-page: http://www.stsci.edu/resources/software_hardware/pyraf
Author: Rick White, Perry Greenfield
Author: Rick White, Perry Greenfield, Chris Sontag
Author-email: help@stsci.edu
License: UNKNOWN
Description: PyRAF is a command language for IRAF based on the Python scripting language
......
LICENSE.txt
MANIFEST.in
README
TEST_COMMIT
defsetup.py
distribute_setup.py
setup.cfg
setup.py
shortcut.vbs
data/PyRAF_exe.was
data/blankcursor.xbm
data/epar.optionDB
data/ipythonrc-pyraf
......@@ -830,6 +828,7 @@ required_pkgs/stsci.tools/doc/make.bat
required_pkgs/stsci.tools/doc/source/analysis.rst
required_pkgs/stsci.tools/doc/source/asnutil.rst
required_pkgs/stsci.tools/doc/source/basicutils.rst
required_pkgs/stsci.tools/doc/source/bitmask.rst
required_pkgs/stsci.tools/doc/source/conf.py
required_pkgs/stsci.tools/doc/source/convert.rst
required_pkgs/stsci.tools/doc/source/fitsdiff.rst
......@@ -844,6 +843,7 @@ required_pkgs/stsci.tools/lib/stsci/tools/__init__.py
required_pkgs/stsci.tools/lib/stsci/tools/alert.py
required_pkgs/stsci.tools/lib/stsci/tools/asnutil.py
required_pkgs/stsci.tools/lib/stsci/tools/basicpar.py
required_pkgs/stsci.tools/lib/stsci/tools/bitmask.py
required_pkgs/stsci.tools/lib/stsci/tools/capable.py
required_pkgs/stsci.tools/lib/stsci/tools/cfgpars.py
required_pkgs/stsci.tools/lib/stsci/tools/check_files.py
......
......@@ -2,7 +2,7 @@
not possible in Tkinter. In general, an attempt is made to use the Pyobjc
bridging package so that compiling another C extension is not needed.
$Id: aqutil.py 1989 2013-05-29 19:59:47Z sontag $
$Id: aqutil.py 2399 2015-07-17 19:47:56Z bsimon $
"""
from __future__ import division # confidence high
......@@ -10,6 +10,7 @@ from __future__ import division # confidence high
import os, struct, time, Tkinter
import objc
import AppKit
from stsci.tools.for2to3 import tobytes
# Arbitrary module constants for term vs. gui. 0 and negative numbers have
......@@ -178,12 +179,13 @@ def __doPyobjcWinInit():
OSErr = objc._C_SHT
OSStat = objc._C_INT
CGErr = objc._C_INT
INPSN = 'n^{ProcessSerialNumber=LL}'
OUTPSN = 'o^{ProcessSerialNumber=LL}'
OUTPID = 'o^_C_ULNG'
WARPSIG = 'v{CGPoint=ff}'
INPSN = tobytes('n^{ProcessSerialNumber=LL}')
OUTPSN = tobytes('o^{ProcessSerialNumber=LL}')
OUTPID = tobytes('o^_C_ULNG')
WARPSIG = tobytes('v{CGPoint=ff}')
if struct.calcsize("l") > 4: # is 64-bit python
WARPSIG = 'v{CGPoint=dd}'
WARPSIG = tobytes('v{CGPoint=dd}')
FUNCTIONS=[
# These are public API
......@@ -228,7 +230,7 @@ def __doPyobjcWinInit():
if err: raise Exception("GetCurrentProcess: "+str(err))
# Set Proc name
err = CPSSetProcessName(__thisPSN, 'PyRAF')
err = CPSSetProcessName(__thisPSN, tobytes('PyRAF'))
if err: raise Exception("CPSSetProcessName: "+str(err))
# Make us a FG app (need to be in order to use SetFrontProcess on us)
# This must be done unless we are called with pythonw.
......
"""
Tk gui implementation for the gki plot widget
$Id: gkitkbase.py 1708 2012-04-30 17:00:37Z sontag $
$Id: gkitkbase.py 2461 2015-10-16 15:17:19Z sontag $
"""
from __future__ import division # confidence high
......@@ -239,12 +239,12 @@ class GkiInteractiveTkBase(gki.GkiKernel, wutil.FocusEntity):
"""Make status display at bottom of window"""
if 'PYRAF_BETA_STATUS' in os.environ:
self.top.status = msgiowidget.MsgIOWidget(self.top, width=600)
self.top.status.pack(side=Tkinter.BOTTOM, fill = Tkinter.X)
else:
if 'PYRAF_OLD_STATUS' in os.environ:
self.top.status = msgiobuffer.MsgIOBuffer(self.top, width=600)
self.top.status.msgIO.pack(side=Tkinter.BOTTOM, fill = Tkinter.X)
else:
self.top.status = msgiowidget.MsgIOWidget(self.top, width=600)
self.top.status.pack(side=Tkinter.BOTTOM, fill=Tkinter.X)
# -----------------------------------------------
# Menu bar definitions
......
......@@ -8,11 +8,11 @@ Modify module import mechanism so that
Assumes that all IRAF tasks and packages are accessible as iraf
module attributes. Only affects imports of iraf module.
$Id: irafimport.py 1858 2012-11-02 01:01:09Z sontag $
$Id: irafimport.py 2408 2015-07-31 14:06:11Z bsimon $
R. White, 1999 August 17
"""
from __future__ import division # confidence high
from __future__ import absolute_import, division # confidence high
import __builtin__
import sys
......@@ -197,13 +197,13 @@ else:
_irafModuleProxy = _irafModuleClass()
# import iraf module using original mechanism
try:
the_iraf_module = _originalImport('iraf', globals(), locals(), [])
except ImportError:
if PY3K:
# necessary as of Python 3.3+ : try "import pyraf.iraf"
pyrafmod = _originalImport('pyraf.iraf', globals(), locals(), [])
the_iraf_module = pyrafmod.iraf
else:
the_iraf_module = _originalImport('iraf', globals(), locals(), [])
# leaving
if IMPORT_DEBUG:
print("irafimport: passed final import")
......@@ -2,18 +2,26 @@
This contains the MsgIOWidget class, which is an optionally hidden
scrolling canvas composed of a text widget and frame. When "hidden",
it turns into a single-line text widget.
$Id: msgiowidget.py 1699 2012-04-19 17:45:35Z sontag $
$Id: msgiowidget.py 2460 2015-10-16 15:08:13Z sontag $
"""
from __future__ import division # confidence high
# System level modules
import sys
import Tkinter as Tki
# Our modules
from stsci.tools import tkrotext
USING_X = not sys.platform.startswith('win') # in most cases we use X
if sys.platform == 'darwin':
USING_X = ",".join(sys.path).lower().find('/pyobjc') < 0
def is_USING_X():
""" This is specifically in a function and not at the top
of this module so that it is not done until needed. We do
not want to casually import wutil anywhere. The import mechanism
makes this speedy on the 2nd-Nth attempt anyway. """
from . import wutil
return wutil.WUTIL_USING_X
class MsgIOWidget(Tki.Frame):
......@@ -36,10 +44,10 @@ class MsgIOWidget(Tki.Frame):
# Put in the expand/collapse button (determine it's sizes)
self._expBttnHasTxt = True
btxt= '+'
if USING_X:
if is_USING_X():
px = 2
py = 0
else: # Aqua ?
else: # Aqua
px = 5
py = 3
if Tki.TkVersion > 8.4:
......
......@@ -7,14 +7,14 @@ __all__ = ['__version__', '__vdate__', '__svn_revision__', '__svn_full_info__',
import datetime
__version__ = '2.1.7'
__version__ = '2.1.9'
__vdate__ = 'unspecified'
__svn_revision__ = "2256"
__svn_revision__ = "2466"
__svn_full_info__ = 'unknown'
__setup_datetime__ = datetime.datetime(2014, 10, 16, 10, 57, 20, 628430)
__setup_datetime__ = datetime.datetime(2015, 10, 16, 15, 42, 59, 163340)
# what version of stsci.distutils created this version.py
stsci_distutils_version = '0.3.7'
stsci_distutils_version = '0.3.8.dev'
if '.dev' in __version__:
def update_svn_info():
......@@ -70,7 +70,7 @@ if '.dev' in __version__:
if pipe.returncode == 0:
stdout = stdout.decode('latin1').strip()
if stdout and stdout[0] in string.digits:
__svn_revision__ = "2256"
__svn_revision__ = "2466"
except OSError:
pass
......
......@@ -7,14 +7,14 @@ __all__ = ['__version__', '__vdate__', '__svn_revision__', '__svn_full_info__',
import datetime
__version__ = '2.1.7'
__version__ = '2.1.9'
__vdate__ = 'unspecified'
__svn_revision__ = 'Unable to determine SVN revision'
__svn_full_info__ = 'unknown'
__setup_datetime__ = datetime.datetime(2014, 10, 16, 10, 57, 13, 301495)
__setup_datetime__ = datetime.datetime(2015, 10, 16, 15, 42, 49, 779683)
# what version of stsci.distutils created this version.py
stsci_distutils_version = '0.3.7'
stsci_distutils_version = '0.3.8.dev'
if '.dev' in __version__:
def update_svn_info():
......
......@@ -7,14 +7,14 @@ __all__ = ['__version__', '__vdate__', '__svn_revision__', '__svn_full_info__',
import datetime
__version__ = '2.1.7'
__version__ = '2.1.9'
__vdate__ = 'unspecified'
__svn_revision__ = 'Unable to determine SVN revision'
__svn_full_info__ = 'unknown'
__setup_datetime__ = datetime.datetime(2014, 10, 16, 10, 57, 13, 301495)
__setup_datetime__ = datetime.datetime(2015, 10, 16, 15, 42, 49, 779683)
# what version of stsci.distutils created this version.py
stsci_distutils_version = '0.3.7'
stsci_distutils_version = '0.3.8.dev'
if '.dev' in __version__:
def update_svn_info():
......
......@@ -4,7 +4,7 @@ These are python stubs that are overloaded by a c version implementations.
If the c versions do not exist, then these routines will do nothing
$Id: wutil.py 2119 2013-12-31 20:44:39Z sontag $
$Id: wutil.py 2451 2015-10-05 14:15:45Z sontag $
"""
from __future__ import division # confidence high
......@@ -43,13 +43,16 @@ WUTIL_ON_WIN = sys.platform.startswith('win')
# WUTIL_USING_X: default to using X on most platforms, tho surely not on windows
WUTIL_USING_X = not WUTIL_ON_WIN
# More on WUTIL_USING_X: for now we support both versions (X or Aqua) on OSX
# More on this for OSX: for now we support both versions (X or Aqua) on OSX
# Allow environment variable so any user can force their preference.
if WUTIL_ON_MAC and not _skipDisplay:
if 'PYRAF_WUTIL_USING_AQUA' in os.environ:
WUTIL_USING_X = False
elif 'PYRAF_WUTIL_USING_X' in os.environ:
WUTIL_USING_X = True
else:
# Do this check for them; look at the python binaries - are they X11-linked?
WUTIL_USING_X = capable.which_darwin_linkage() == "x11"
# Otherwise check for them; look at the python binaries - are they X11-linked?
WUTIL_USING_X = capable.is_darwin_and_x()
# Experimental new (2012) mode some have requested (OSX mostly) where all
# graphics windows drawn are popped to the foreground and left there with
......@@ -85,7 +88,7 @@ try:
def getWindowIdZero(): return 0
getFocalWindowID = getWindowIdZero
# If on OSX, use aqutil
# If on OSX w/out X11, use aqutil
if WUTIL_ON_MAC and not _skipDisplay: # as opposed to the PC (future?)
try:
import aqutil
......@@ -536,6 +539,7 @@ def dumpspecs(outstream = None, skip_volatiles = False):
out += "\nis_darwin_and_x = "+str(capable.is_darwin_and_x())
if WUTIL_ON_MAC:
out += "\nwhich_darwin_linkage = "+str(capable.which_darwin_linkage())
out += "\nwhich_darwin_linkage2 = "+str(capable.which_darwin_linkage(force_otool_check=True))
else:
out += "\nwhich_darwin_linkage = (not darwin)"
out += "\nskip display = "+str(_skipDisplay)
......@@ -605,7 +609,10 @@ else:
# still run, albeit without automatic mouse moving and focus jumping.
hasGraphics = focusController.hasGraphics
if hasGraphics:
print "\nLimited graphics available (aqutil not loaded)\n"
if capable.which_darwin_linkage() == 'aqua':
print "\nLimited graphics available on OSX (aqutil not loaded)\n"
else:
print "\nLimited graphics available on OSX (xutil not loaded)\n"
elif WUTIL_ON_WIN:
hasGraphics = 1 # try this, tho VERY limited (epar only I guess)
print "\nLimited graphics available on win32 platform\n"
......
......@@ -71,10 +71,10 @@ def _find_x(xdir=None):
raise ImportError('Tkinter is not installed')
tk = Tkinter.Tk()
tk.withdraw()
tcl_lib = os.path.join(tk.getvar('tcl_library'), os.pardir)
tcl_inc = os.path.join(tk.getvar('tcl_library'), os.pardir, os.pardir,
tcl_lib = os.path.join(str(tk.getvar('tcl_library')), os.pardir)
tcl_inc = os.path.join(str(tk.getvar('tcl_library')), os.pardir, os.pardir,
'include')
tk_lib = os.path.join(tk.getvar('tk_library'), os.pardir)
tk_lib = os.path.join(str(tk.getvar('tk_library')), os.pardir)
tkv = str(Tkinter.TkVersion)[:3]
# yes, the version number of Tkinter really is a float...
if Tkinter.TkVersion < 8.3:
......
No preview for this file type
......@@ -3,8 +3,10 @@ from distutils.command.build_ext import build_ext
from distutils.errors import DistutilsError, CCompilerError, CompileError
from distutils.util import strtobool
from ConfigParser import ConfigParser
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
class build_optional_ext(build_ext):
"""This is a version of the build_ext command that allows specific
......@@ -33,7 +35,7 @@ class build_optional_ext(build_ext):
cfg = ConfigParser()
try:
cfg.read('setup.cfg')
except Exception, e:
except Exception as e:
log.warn('Failed to read setup.cfg: %s; proceeding as though '
'there are no optional extensions' % e)
return
......@@ -75,7 +77,7 @@ class build_optional_ext(build_ext):
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except (CCompilerError, DistutilsError, CompileError), e:
except (CCompilerError, DistutilsError, CompileError) as e:
if not hasattr(ext, '_optional') or not ext._optional:
raise
log.warn('building optional extension "%s" failed: %s' %
......
......@@ -25,6 +25,11 @@ except NameError:
# python 3
from imp import reload
if sys.version_info[0] < 3:
string_types = basestring
else:
string_types = str
from .svnutils import get_svn_info, get_svn_version
from .versionutils import (package_uses_version_py, clean_version_py,
update_setup_datetime, VERSION_PY_TEMPLATE)
......@@ -188,7 +193,6 @@ def tag_svn_revision(config):
break
# Cleanup
names = set([package, package + '.'])
for modname in list(sys.modules):
if modname == package or modname.startswith(package + '.'):
del sys.modules[modname]
......@@ -452,7 +456,7 @@ def glob_data_files(command_obj):
data_files = command_obj.data_files
for idx, val in enumerate(data_files[:]):
if isinstance(val, basestring):
if isinstance(val, string_types):
# Support the rare, deprecated case where just a filename is given
filenames = glob.glob(val)
del data_files[idx]
......
from __future__ import print_function
"""Hooks for zest.releaser specifically for STScI software"""
......@@ -6,7 +8,11 @@ import os
import shutil
import sys
from ConfigParser import ConfigParser
if sys.version_info[0] < 3:
from ConfigParser import ConfigParser
input = raw_input
else:
from configParser import ConfigParser
from setuptools.dist import Distribution
from zest.releaser.utils import ask
......@@ -108,7 +114,7 @@ def add_to_stsci_package_index(data):
answer = ''
while not answer:
try:
answer = raw_input(question).strip()
answer = input(question).strip()
if not answer:
if package_path:
# The user simple pressed enter, so use the supplied
......@@ -152,7 +158,7 @@ def add_to_stsci_package_index(data):
"Then press enter to try again (or hit Ctrl-C to "
"cancel). Go ahead, I'll wait..." %
(data['tagdir'], data['tagdir']))
raw_input()
input()
except KeyboardInterrupt:
return
......@@ -186,4 +192,4 @@ def add_to_stsci_package_index(data):
finally:
os.chdir(old_cwd)
print 'Finished adding package to %s.' % PACKAGE_INDEX_URL
print ('Finished adding package to %s.' % PACKAGE_INDEX_URL)
......@@ -6,9 +6,6 @@ from __future__ import with_statement
import os
import subprocess
from .astutils import ImportVisitor, walk
def get_svn_version(path='.'):
"""Uses ``svnversion`` to get just the latest revision at the given
path.
......
......@@ -24,7 +24,7 @@ class StsciDistutilsTestCase(object):
'checkout', TESTPACKAGE_URL, cls.wc_dir],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except OSError, e:
except OSError as e:
raise nose.SkipTest('svn unavailable to checkout out test '
'package: %s' % e)
......
......@@ -10,10 +10,14 @@ try:
except NameError:
from imp import reload
from ConfigParser import ConfigParser
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
from distutils.ccompiler import new_compiler
from distutils.msvccompiler import MSVCCompiler
from distutils.sysconfig import customize_compiler
from distutils.sysconfig import customize_compiler, get_config_vars
@contextlib.contextmanager
......@@ -31,6 +35,7 @@ def get_compiler_command():
system used by distutils to build C extensions.
"""
get_config_vars()
compiler = new_compiler()
customize_compiler(compiler)
if isinstance(compiler, MSVCCompiler):
......
*********************************************************
Utility functions for handling bit masks and mask arrays.
*********************************************************
.. moduleauthor:: Mihai Cara <help@stsci.edu>
.. currentmodule:: stsci.tools.bitmask
.. automodule:: stsci.tools.bitmask
:members:
......@@ -12,11 +12,12 @@ Contents:
.. toctree::
:maxdepth: 2
basicutils
fitsutil
imgutils
analysis
bitmask
Building a TEAL Interface for Tasks
-----------------------------------
......
......@@ -17,13 +17,12 @@
# action = F.Show()
####
"""
$Id: alert.py 13225 2011-06-22 23:24:07Z embray $
$Id: alert.py 38909 2015-04-08 17:41:07Z bsimon $
"""
from __future__ import division # confidence high
from __future__ import absolute_import, division # confidence high
import string
from dialog import *
from .dialog import *
class AlertDialog(ModalDialog):
......
"""
A module that provides functions for manipulating bitmasks and data quality (DQ) arrays.
:Authors: Mihai Cara (contact: help@stsci.edu)
:License: `<http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE>`_
"""
import numpy as np
__version__ = '0.1.0'
__vdate__ = '29-March-2015'
__author__ = 'Mihai Cara'
def interpret_bits_value(val):
"""
Converts input bits value from string to a single integer value or None.
If a comma- or '+'-separated set of values are provided, they are summed.
.. note::
In order to flip the bits of the final result (after summation),
for input of `str` type, prepend '~' to the input string. '~' must
be prepended to the *entire string* and not to each bit flag!
Parameters
----------
val : int, str, None
An integer bit mask or flag, `None`, or a comma- or '+'-separated
string list of integer bit values. If `val` is a `str` and if
it is prepended with '~', then the output bit mask will have its
bits flipped (compared to simple sum of input val).
Returns
-------
bitmask : int or None
Returns and integer bit mask formed from the input bit value
or `None` if input `val` parameter is `None` or an empty string.
If input string value was prepended with '~', then returned
value will have its bits flipped (inverse mask).
Examples
--------
>>> "{0:016b}".format(0xFFFF & interpret_bit_flags(28) )
'0000000000011100'
>>> "{0:016b}".format(0xFFFF & interpret_bit_flags('4,8,16') )
'0000000000011100'
>>> "{0:016b}".format(0xFFFF & interpret_bit_flags('~4,8,16') )
'1111111111100011'
>>> "{0:016b}".format(0xFFFF & interpret_bit_flags('~(4+8+16)') )
'1111111111100011'
"""
if isinstance(val, int) or val is None:
return val
else:
val = str(val).strip()
if val.startswith('~'):
flip_bits = True
val = val[1:].lstrip()
else:
flip_bits = False
if val.startswith('('):
if val.endswith(')'):
val = val[1:-1].strip()
else:
raise ValueError('Unbalanced parantheses or incorrect syntax.')
if ',' in val:
valspl = val.split(',')
bitmask = 0
for v in valspl:
bitmask += int(v)
elif '+' in val:
valspl = val.split('+')
bitmask = 0
for v in valspl:
bitmask += int(v)
elif val.upper() in ['', 'NONE', 'INDEF']:
return None
else:
bitmask = int(val)
if flip_bits:
bitmask = ~bitmask
return bitmask
def bitmask2mask(bitmask, ignore_bits, good_mask_value=1, dtype=np.uint8):
"""
bitmask2mask(bitmask, ignore_bits, good_pix_value=1, dtype=numpy.uint8)
Interprets an array of bit flags and converts it to a "binary" mask array.
This function is particularly useful to convert data quality arrays to
binary masks.
Parameters
----------
bitmask : numpy.ndarray
An array of bit flags. Values different from zero are interpreted as
"bad" values and values equal to zero are considered as "good" values.
However, see `ignore_bits` parameter on how to ignore some bits
in the `bitmask` array.
ignore_bits : int, str, None
An integer bit mask, `None`, or a comma- or '+'-separated