Load sources from a FITS catalog file.

        Parameters
        ----------

        name : str
            Catalog name or path to a catalog FITS file.
973261
def load_fits_catalog(self, name, **kwargs):
        
        # EAC split this function to make it easier to load an existing catalog
        cat = catalog.Catalog.create(name)
        self.load_existing_catalog(cat, **kwargs)
515802
def load(self, name):
        

        if self.reload:
            self._maybe_purge_cache()

        template = self.cache.get(name)
        if template:
            return template

        path = self.resolve(name)
        if not path:
            raise OSError(errno.ENOENT, "File not found: %s" % name)

        with codecs.open(path, 'r', encoding='UTF-8') as f:
            contents = f.read()
            mtime = os.fstat(f.fileno()).st_mtime

        template = self.load_string(contents, filename=path)
        template.mtime = mtime
        template.path = path

        self.cache[name] = template
        return template
522653
def load_array(self, fn, name):
        

        if os.path.exists(fn + '.npz'):
            array = np.load(fn + '.npz')
            try:
                setattr(self, name, array['arr_0'])
            except Exception, e:
                print e
            finally:
                array.close()

        else:
            raise RuntimeError("File %s does not exist." % (fn + '.npz'))
1234403
def from_name(api_url, name, dry_run=False):
        
        return DataSet(
            '/'.join([api_url, name]).rstrip('/'),
            token=None,
            dry_run=dry_run
        )
841562
def load(cls, filename, name=None):
        
        if not os.path.exists(filename):
            return {}
        name = name or filename

        if name not in cls._conffiles:
            with open(filename) as fdesc:
                content = yaml.load(fdesc, YAMLLoader)
                # in case the file is empty
                if content is None:
                    content = {}
                cls._conffiles[name] = content

        return cls._conffiles[name]
341623
def load(self , filename=None, data=None):
        

        self.__load(filename=filename, data=data)
356194
def name_from_path(self):
        """"""
        name = os.path.splitext(os.path.basename(self.path))[0]
        if name == 'catalog':
            name = os.path.basename(os.path.dirname(self.path))
        return name.replace('.', '_')
586053
def get_from_name(self, name):
        
        with self.condition:
            try:
                item_id = self.name2id[name]
            except KeyError:
                return None
            return self.id2item[item_id]
        return None
464611
def load(self, path, name):
        

        filename = name + '.fgic'
        filepath = aux.joinpath(path, filename)
        with zipfile.ZipFile(filepath, 'r') as containerZip:
            #Convert the zipfile data into a str object, necessary since
            #containerZip.read() returns a bytes object.
            jsonString = io.TextIOWrapper(containerZip.open('data'),
                                          encoding='utf-8'
                                          ).read()
            infoString = io.TextIOWrapper(containerZip.open('info'),
                                          encoding='utf-8'
                                          ).read()
        self.container = json.loads(jsonString, object_hook=Fgi.jsonHook)
        self.info.update(json.loads(infoString))
        self._matrixTemplate = self.info['_matrixTemplate']
        del self.info['_matrixTemplate']
603293
def loadSGMLSuperCatalog(filename):
    
    ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
    if ret is None:raise treeError('xmlLoadSGMLSuperCatalog() failed')
    return catalog(_obj=ret)
1165088
def get_source(source):
    
    if source == 'gwtc-1':
        fname = download_file(gwtc1_url, cache=True)
        data = json.load(open(fname, 'r'))
    else:
        raise ValueError('Unkown catalog source {}'.format(source))
    return data['data']
1095371
def get_sdc_by_name(self, name):
        
        for sdc in self.sdc:
            if sdc.name == name:
                return sdc
        raise KeyError("SDC of that name not found")
730656
def load_file_or_hdu(filename):
    
    if isinstance(filename, fits.HDUList):
        hdulist = filename
    else:
        hdulist = fits.open(filename, ignore_missing_end=True)
    return hdulist
216572
def get_source_name(self, name):
        """"""
        if name not in self.like.sourceNames():
            name = self.roi.get_source_by_name(name).name
        return name
1326230
def _loadThreePartSource(self, sourceFName, sourceLines):
        
        lineno = 1
        for ln in sourceLines:
            lineno += 1
            try:
                stem, pubType, source = ln.split("\t", 2)
                stem = stem.strip()[-9:]
                self._addPub(stem, source)
                if pubType=="C":
                    self.confstems[stem] = 1
            except ValueError:
                sys.stderr.write("sourcematchers.py: %s (%d): skipping source line: %s"%(sourceFName,lineno,ln))
595078
def load(self, name, parent_path=None):
        
        if name not in self.templates:
            self.templates[name] = self._create_template(name)
        return self.templates[name]
824715
def load_datafile(self, name, search_path=None, **kwargs):
        
        if not search_path:
            search_path = self.define_dir

        self.debug_msg('loading datafile %s from %s' % (name, str(search_path)))
        return codec.load_datafile(name, search_path, **kwargs)