# Path: ccdproc/ccddata.py



from collections import OrderedDict
from os import listdir, path
from astropy.table import Table, MaskedColumn
from astropy.utils import minversion
from astropy.utils.exceptions import AstropyUserWarning
from .ccddata import fits_ccddata_reader, _recognized_fits_file_extensions
import fnmatch
import re
import logging
import numpy as np
import numpy.ma as ma
import astropy.io.fits as fits
import warnings
            If ``return_fname`` is ``True``, yield a tuple of
            ({name}, ``file name``) for the next item in the collection.
        """
        # store mask so we can reset at end--must COPY, otherwise
        # current_mask just points to the mask of summary
        if not self.summary:
            return

        current_mask = {}
        for col in self.summary.columns:
            current_mask[col] = self.summary[col].mask

        if kwd:
            self._find_keywords_by_values(**kwd)

        ccd_kwargs = ccd_kwargs or {}

        for full_path in self._paths():
            add_kwargs = {'do_not_scale_image_data': do_not_scale_image_data}

            # We need to open the file here, get the appropriate values and then
            # close it again before it "yields" otherwise it's not garantueed
            # that the generator actually advances and closes the file again.
            # For example if one uses "next" on the generator manually the
            # file handle could "leak".
            if return_type == 'header':
                return_thing = fits.getheader(full_path, self.ext)
            elif return_type == 'data':
                return_thing = fits.getdata(full_path, self.ext, **add_kwargs)
            elif return_type == 'ccd':

# Path: ccdproc/ccddata.py



# Path: ccdproc/image_collection.py
from collections import OrderedDict
from os import listdir, path
from astropy.table import Table, MaskedColumn
from astropy.utils import minversion
from astropy.utils.exceptions import AstropyUserWarning
from .ccddata import fits_ccddata_reader, _recognized_fits_file_extensions
import fnmatch
import re
import logging
import numpy as np
import numpy.ma as ma
import astropy.io.fits as fits
import warnings

            If ``return_fname`` is ``True``, yield a tuple of
            ({name}, ``file name``) for the next item in the collection.
        """
        # store mask so we can reset at end--must COPY, otherwise
        # current_mask just points to the mask of summary
        if not self.summary:
            return

        current_mask = {}
        for col in self.summary.columns:
            current_mask[col] = self.summary[col].mask

        if kwd:
            self._find_keywords_by_values(**kwd)

        ccd_kwargs = ccd_kwargs or {}

        for full_path in self._paths():
            add_kwargs = {'do_not_scale_image_data': do_not_scale_image_data}

            # We need to open the file here, get the appropriate values and then
            # close it again before it "yields" otherwise it's not garantueed
            # that the generator actually advances and closes the file again.
            # For example if one uses "next" on the generator manually the
            # file handle could "leak".
            if return_type == 'header':
                return_thing = fits.getheader(full_path, self.ext)
            elif return_type == 'data':
                return_thing = fits.getdata(full_path, self.ext, **add_kwargs)
            elif return_type == 'ccd':

                return_thing = fits_ccddata_reader(