Beispiel #1
0
def load_vmatrix(vname=VNAME, file_paths=None):
    """
    Load spectral template information.

    Parameters
    ----------
    vname : str
        Name of templates.

    Notes
    -----
    This function loads so-called vmatrix in the IDL version.
    
    See IDL procedure utils/k_load_vmatrix.pro (kcorrect v4_2).
    """
    vfile = 'vmatrix.%s.dat' % vname
    lfile = 'lambda.%s.dat' % vname
    file_paths = [] if file_paths is None else file_paths
    file_paths = file_paths + [DEFAULT_TEMPLATE_DIR]
    vmatrix = k_read_ascii_table(path_to_file(vfile, file_paths))
    lamb = k_read_ascii_table(path_to_file(lfile, file_paths))
    return lamb, vmatrix
Beispiel #2
0
    def __init__(self, filters, filter_dirs=None):
        filter_dirs = [] if filter_dirs is None else filter_dirs
        self.filter_dirs = filter_dirs + [DEFAULT_FILTER_DIR]

        # find full paths
        full_paths = []
        for each in filters:
            each = ''.join([each, FILTEREXT])
            fpath = path_to_file(each, self.filter_dirs)
            if not fpath:
                dirs = ', '.join(self.filter_dirs)
                raise ValueError('Filter %s not found in %s.' % (each, dirs))
            full_paths.append(fpath)

        self.filters = filters
        self.full_paths = full_paths
Beispiel #3
0
    def __init__(self, filters, filter_dirs=None):
        filter_dirs = [] if filter_dirs is None else filter_dirs
        self.filter_dirs = filter_dirs + [DEFAULT_FILTER_DIR]

        # find full paths
        full_paths = []
        for each in filters:
            each = ''.join([each, FILTEREXT])
            fpath = path_to_file(each, self.filter_dirs)
            if not fpath:
                dirs = ', '.join(self.filter_dirs)
                raise ValueError('Filter %s not found in %s.' % (each, dirs))
            full_paths.append(fpath)

        self.filters = filters
        self.full_paths = full_paths