mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 18:38:02 +00:00
add crossfiles reader
This commit is contained in:
parent
9cbdef4350
commit
035d7e0071
2 changed files with 40 additions and 19 deletions
|
@ -18,6 +18,7 @@ Tools for summarising various results.
|
|||
import numpy
|
||||
import joblib
|
||||
from os.path import (join, isfile)
|
||||
from glob import glob
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
|
@ -283,6 +284,25 @@ class kNNCDFReader:
|
|||
cdf = cdf[0, ...] if nknns == 1 else cdf # Reshape if necessary
|
||||
return cdf
|
||||
|
||||
@staticmethod
|
||||
def cross_files(ic, folder):
|
||||
"""
|
||||
Return the file paths corresponding to the cross-correlation of a given
|
||||
IC.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
ic : int
|
||||
The desired IC.
|
||||
folder : str
|
||||
The folder containing the cross-correlation files.
|
||||
|
||||
Returns
|
||||
-------
|
||||
filepath : list of str
|
||||
"""
|
||||
return [file for file in glob(join(folder, "*")) if str(ic) in file]
|
||||
|
||||
|
||||
class PairOverlap:
|
||||
r"""
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue