Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Mar 6, 2024
1 parent 165a0a4 commit 8e633c5
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions neo/rawio/neuralynxrawio/ncssections.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,9 @@ def calc_sample_time(sampFr, startTime, posn):
return round(startTime + NcsSectionsFactory.get_micros_per_samp_for_freq(sampFr) * posn)

@staticmethod
def _buildNcsGeneric(ncsMemMap, sampFreq, gapTolerance=0):
def _buildNcsSections(ncsMemMap, sampFreq, gapTolerance=0):
"""
Build
This replace:
_buildGivenActualFrequency
_buildForMaxGap
Construct NcsSections with fast mode when no gaps or parsing the file to detect gaps.
"""
channel_id = ncsMemMap["channel_id"][0]

Expand Down Expand Up @@ -264,7 +260,7 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
else:
gapTolerance = 0

ncsSects = NcsSectionsFactory._buildNcsGeneric(ncsMemMap, sampFreqUsed, gapTolerance=gapTolerance)
ncsSects = NcsSectionsFactory._buildNcsSections(ncsMemMap, sampFreqUsed, gapTolerance=gapTolerance)
ncsSects.sampFreqUsed = sampFreqUsed
ncsSects.microsPerSampUsed = microsPerSampUsed

Expand All @@ -277,7 +273,7 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
else:
# quarter of paquet size is tolerate
gapTolerance = round(0.25 * NcsSection._RECORD_SIZE * 1e6 / freq)
ncsSects = NcsSectionsFactory._buildNcsGeneric(ncsMemMap, freq, gapTolerance=gapTolerance)
ncsSects = NcsSectionsFactory._buildNcsSections(ncsMemMap, freq, gapTolerance=gapTolerance)


# take longer data block to compute reaal sampling rate
Expand Down Expand Up @@ -305,7 +301,7 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
else:
# quarter of paquet size is tolerate
gapTolerance = round(0.25 * NcsSection._RECORD_SIZE * 1e6 / freq)
ncsSects = NcsSectionsFactory._buildNcsGeneric(ncsMemMap, freq, gapTolerance=gapTolerance)
ncsSects = NcsSectionsFactory._buildNcsSections(ncsMemMap, freq, gapTolerance=gapTolerance)
ncsSects.sampFreqUsed = freq
ncsSects.microsPerSampUsed = NcsSectionsFactory.get_micros_per_samp_for_freq(freq)

Expand Down

0 comments on commit 8e633c5

Please sign in to comment.