mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 23:08: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 numpy
|
||||||
import joblib
|
import joblib
|
||||||
from os.path import (join, isfile)
|
from os.path import (join, isfile)
|
||||||
|
from glob import glob
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
|
||||||
|
@ -283,6 +284,25 @@ class kNNCDFReader:
|
||||||
cdf = cdf[0, ...] if nknns == 1 else cdf # Reshape if necessary
|
cdf = cdf[0, ...] if nknns == 1 else cdf # Reshape if necessary
|
||||||
return cdf
|
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:
|
class PairOverlap:
|
||||||
r"""
|
r"""
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue