Skip to content

Commit edb5bb6

Browse files
authored
#177 hotfix timeseries rate
* Fix for #177 Fix from 0987263 for #177 * Fix link on homepage to Lantyer example
1 parent 88b29d6 commit edb5bb6

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

nwb_explorer/nwb_model_interpreter/nwb_model_interpreter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def importValue(self, import_value: ImportValue):
8080
time_series = nwb_obj
8181
if var_to_extract in ['time', 'timestamps']:
8282
timestamps = NWBReader.get_timeseries_timestamps(time_series)
83+
if time_series.rate is not None:
84+
for index, item in enumerate(timestamps):
85+
timestamps[index] = ( timestamps[index] / time_series.rate / time_series.rate ) + time_series.starting_time
8386
timestamps_unit = guess_units(time_series.timestamps_unit) if hasattr(time_series,
8487
'timestamps_unit') and time_series.timestamps_unit else 's'
8588
return GeppettoModelFactory.create_time_series(timestamps, timestamps_unit)
@@ -89,6 +92,10 @@ def importValue(self, import_value: ImportValue):
8992

9093
unit = guess_units(time_series.unit)
9194
time_series_value = GeppettoModelFactory.create_time_series(plottable_timeseries[0], unit)
95+
if time_series.conversion is not None:
96+
for index, item in enumerate(time_series_value.value):
97+
time_series_value.value[index] = time_series_value.value[index] * time_series.conversion
98+
stringV = str(time_series_value)
9299
return time_series_value
93100
else:
94101
# TODO handle other possible ImportValue(s)

webapp/components/FileSampleSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const SAMPLE_LINK_FERGUSON_5 = 'https://github.com/OpenSourceBrain/NWBShowcase/r
99

1010
const SAMPLE_LINK_TIMESERIES = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/NWB/time_series_data.nwb';
1111
const SAMPLE_LINK_TRIPLETT = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/TriplettEtAl2018/TriplettEtAl2018.nwb';
12-
const SAMPLE_LINK_LANTYER = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/Lantyer/LantyerEtAl2018.170502_AL_257_CC.nwb';
12+
const SAMPLE_LINK_LANTYER = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/Lantyer/LantyerEtAl2018_170502_AL_257_CC.nwb';
1313
const SAMPLE_LINK_LANORE = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/IgorPro/141210c3.nwb';
1414
const SAMPLE_LINK_PACKER = 'https://github.com/OpenSourceBrain/CalciumImagingDriftingGrating/raw/master/neurofinder.01.01.jpg.nwb';
1515
const SAMPLE_LINK_KATO = 'https://github.com/OpenSourceBrain/NWBShowcase/raw/master/KatoEtAl2015/KatoEtAl2018.WT_Stim.6.nwb';

0 commit comments

Comments
 (0)