Skip to content

lfp_merge.py

LFPOutput

Bases: _Merge, SpyglassMixin

Source code in src/spyglass/lfp/lfp_merge.py
@schema
class LFPOutput(_Merge, SpyglassMixin):
    definition = """
    merge_id: uuid
    ---
    source: varchar(32)
    """

    class LFPV1(SpyglassMixin, dj.Part):  # noqa: F811
        definition = """
        -> master
        ---
        -> LFPV1
        """

    class ImportedLFP(SpyglassMixin, dj.Part):  # noqa: F811
        definition = """
        -> master
        ---
        -> ImportedLFP
        """

    class CommonLFP(SpyglassMixin, dj.Part):  # noqa: F811
        """Table to pass-through legacy LFP"""

        definition = """
        -> master
        ---
        -> CommonLFP
        """

    def fetch1_dataframe(self, *attrs, **kwargs):
        # Note: `proj` below facilitates operator syntax eg Table & restrict
        nwb_lfp = self.fetch_nwb(self.proj())[0]
        return pd.DataFrame(
            nwb_lfp["lfp"].data,
            index=pd.Index(nwb_lfp["lfp"].timestamps, name="time"),
        )

CommonLFP

Bases: SpyglassMixin, Part

Table to pass-through legacy LFP

Source code in src/spyglass/lfp/lfp_merge.py
class CommonLFP(SpyglassMixin, dj.Part):  # noqa: F811
    """Table to pass-through legacy LFP"""

    definition = """
    -> master
    ---
    -> CommonLFP
    """