Skip to content

Commit

Permalink
io dev
Browse files Browse the repository at this point in the history
  • Loading branch information
grg2rsr committed Nov 21, 2024
1 parent 7600975 commit 0ffeaf3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/iblphotometry/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def from_pqt(
return from_dataframe(raw_df, **read_config)


def from_raw_neurophotometrics_df(raw_df: pd.DataFrame, rois=None):
# converting less meaninful ledstate code to nm value of the active LED
def _read_raw_neurophotometrics_df(raw_df: pd.DataFrame, rois=None) -> pd.DataFrame:
#
if rois is None:
rois = raw_df.columns[4:]

Expand Down Expand Up @@ -124,7 +124,7 @@ def from_raw_neurophotometrics_df(raw_df: pd.DataFrame, rois=None):
return out_df


def from_raw_neurophotometrics(path: str | Path):
def from_raw_neurophotometrics(path: str | Path) -> nap.TsdFrame:
warnings.warn(
'loading a photometry from raw neurophotometrics output. The data will _not_ be synced and\
is being split into channels by LedState (converted to LED wavelength in nm)'
Expand All @@ -141,4 +141,11 @@ def from_raw_neurophotometrics(path: str | Path):
else:
raise NotImplementedError

return from_raw_neurophotometrics_df(raw_df)
df = _read_raw_neurophotometrics_df(raw_df)

read_config = dict(
data_columns=raw_df.columns[4:],
time_column='times',
channel_column='name',
)
return from_dataframe(df, **read_config)

0 comments on commit 0ffeaf3

Please sign in to comment.