Load file(s) -- image*.fits, image*.fits[ext].
        Returns success code (True or False).
183274
def open_files(self, path):
        
        paths = []
        input_list = _patt.findall(path)
        if not input_list:
            input_list = [path]

        for path in input_list:
            # Strips trailing wildcard
            if path.endswith('*'):
                path = path[:-1]

            if os.path.isdir(path):
                continue

            self.logger.debug('Opening files matched by {0}'.format(path))
            info = iohelper.get_fileinfo(path)
            ext = iohelper.get_hdu_suffix(info.numhdu)
            files = glob.glob(info.filepath)  # Expand wildcard
            paths.extend(['{0}{1}'.format(f, ext) for f in files])

        if len(paths) > 0:
            self.load_paths(paths)
            return True

        return False
1238475
def load_fis(dir=None):
    """"""
    if dir is None:
        import tkFileDialog
        try:
            dir=tkFileDialog.askdirectory()
        except:
            return
    if dir is None:
        return None
    from os.path import walk
    walk(dir,fits_list,"*.fits")
149824
def do_load(self, filename):
        """"""
        try:
            self.__session.load(filename)
        except IOError as e:
            self.logger.error(e.strerror)
500742
def fromfits(infilename, hdu = 0, verbose = True):
    
    
    pixelarray, hdr = pyfits.getdata(infilename, hdu, header=True)
    pixelarray = np.asarray(pixelarray).transpose()
    
    pixelarrayshape = pixelarray.shape
    if verbose :
        print "FITS import shape : (%i, %i)" % (pixelarrayshape[0], pixelarrayshape[1])
        print "FITS file BITPIX : %s" % (hdr["BITPIX"])
        print "Internal array type :", pixelarray.dtype.name
    
    return pixelarray, hdr
811665
def load_file(self, file_name):
        
        locator = self._make_locator()

        path = locator.find_file(file_name, self.search_dirs)

        return self.read(path)
944154
def load_data(fname, **kwargs):
    """"""
    fname = get_file(fname)
    if fname.suffix == ".lzma":
        return load_tar_lzma_data(fname)
    elif fname.suffix == ".zip":
        return load_zip_data(fname, **kwargs)
1124255
def load(self, size):
        """"""
        if self.exists() and self.isfile():
            return eval(open(self).read(size))
1080234
def loader():
    """"""
    url = request.args.get('url')  # read image URL as a request URL param
    response = requests.get(url)  # make request to static image file
    return response.content
848906
def load_files(files):
    """"""

    for py_file in files:
        LOG.debug("exec %s", py_file)
        execfile(py_file, globals(), locals())
143397
def load_fn_matches_ext(file_path, file_type):
    
    correct_ext = False
    curr_ext = os.path.splitext(file_path)[1]
    exts = [curr_ext, file_type]
    try:
        # special case: if file type is excel, both extensions are valid.
        if ".xlsx" in exts and ".xls" in exts:
            correct_ext = True
        elif curr_ext == file_type:
            correct_ext = True
        else:
            print("Use '{}' to load this file: {}".format(FILE_TYPE_MAP[curr_ext]["load_fn"],
                                                          os.path.basename(file_path)))
    except Exception as e:
        logger_misc.debug("load_fn_matches_ext: {}".format(e))

    return correct_ext
1273750
def load(filename, default=None):
    '''
    
    '''
    ext = get_ext(filename)
    if ext in ldict:
        return ldict[ext](filename)
    else:
        return default
1352449
def load_image(canvas, filepath, bounds=None):
    """"""

    image_data = Image.open(filepath)
    if bounds:
        image_data.thumbnail(bounds, PIL.Image.ANTIALIAS)
    canvas.image = ImageTk.PhotoImage(image_data)
    canvas.create_image(0, 0, image=canvas.image, anchor=tk.NW)
1352554
def load_from(self, image):
        
        if not isinstance(image, self.__class__):
            raise ConuException("Invalid source image type", type(image))
        image.save_to(self)
448642
def _load_fits(self, h5file):
        
        fits = {}
        for key in ['mf', 'chifz', 'vfx', 'vfy']:
            fits[key] = self._load_scalar_fit(fit_key=key, h5file=h5file)
        return fits
354994
def load(cls, filename, **kwargs):
        
        
        if not os.path.exists(filename):
            raise IOError("filename {0} does not exist" .format(filename))
        
        if filename.lower().endswith(".fits") \
        or filename.lower().endswith(".fits.gz"):
            image = fits.open(filename, **kwargs)
            
            header = image[0].header
            
            # Check for a tabular data structure
            if len(image) > 1 and image[0].data is None:

                names = [name.lower() for name in image[1].data.names]
                dispersion_key = 'wave' if 'wave' in names else 'disp'
                
                disp, flux = image[1].data[dispersion_key], image[1].data['flux']

                if 'error' in names or 'variance' in names:
                    variance_key = 'error' if 'error' in names else 'variance'
                    variance = image[1].data[variance_key]

            else:

                # According to http://iraf.net/irafdocs/specwcs.php ....
                #li = a.headers['LTM1_1'] * np.arange(a.headers['NAXIS1']) + a.headers['LTV1']
                #a.headers['CRVAL1'] + a.headers['CD1_1'] * (li - a.headers['CRPIX1'])

                if np.all([key in header.keys() for key in ('CDELT1', 'NAXIS1', 'CRVAL1')]):
                    disp = header['CRVAL1'] + (np.arange(header['NAXIS1']) \
                        - header.get("CRPIX1", 0)) * header['CDELT1']
            
                if "LTV1" in header.keys():
                    disp -= header['LTV1'] * header['CDELT1']

                #disp -= header['LTV1'] if header.has_key('LTV1') else 0
                flux = image[0].data

                # Check for an input_variance array
                extnames = [ext.header.get("EXTNAME", None) for ext in image[1:]]
                if "input_variance" in extnames:
                    index = 1 + extnames.index("input_variance")
                    variance = image[index].data
                    
                else:
                    variance = None
            
                # Check for logarithmic dispersion
                if "CTYPE1" in header.keys() and header["CTYPE1"] == "AWAV-LOG":
                    disp = np.exp(disp)

            # Add the headers in
            headers = {}
            for row in header.items():
                key, value = row
                
                # Check the value is valid
                try:
                    str(value)

                except TypeError:
                    logger.debug("Skipping header key {0}".format(key))
                    continue

                if len(key) == 0 or len(str(value)) == 0: continue
    
                if key in headers.keys():
                    if not isinstance(headers[key], list):
                        headers[key] = [headers[key]]
                    
                    headers[key].append(value)

                else:
                    headers[key] = value

            for key, value in headers.iteritems():
                if isinstance(value, list):
                    headers[key] = "\n".join(map(str, value))

        else:
            headers = {}
            try:
                disp, flux, variance = np.loadtxt(filename, unpack=True, **kwargs)
            except:
                disp, flux = np.loadtxt(filename, unpack=True, **kwargs)
            
        return cls(disp, flux, variance=variance, headers=headers)
871396
def load(cls, path):
        """"""
        assert os.path.exists(path), "No such file: %r" % path

        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        wave = Waveform(None)
        wave._path = path
        return wave
660626
def load_model(f, format=None, load_external_data=True):  # type: (Union[IO[bytes], Text], Optional[Any], bool) -> ModelProto
    '''
    
    '''
    s = _load_bytes(f)
    model = load_model_from_string(s, format=format)

    if load_external_data:
        model_filepath = _get_file_path(f)
        if model_filepath:
            base_dir = os.path.dirname(model_filepath)
            load_external_data_for_model(model, base_dir)

    return model