MetaCell / nwb-explorer

NWB Explorer is a web application to visualise and analyse the content of NWB:N 2 files
Other
23 stars 16 forks source link

Support "conversion" field on TimeSeries #177

Closed pgleeson closed 4 years ago

pgleeson commented 4 years ago

From https://pynwb.readthedocs.io/en/latest/pynwb.base.html#pynwb.base.TimeSeries

conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit

So ideally, a membrane potential trace should specify units='volts' and conversion=0.001 (if the trace is in mV).

e.g. this uses the correct form: http://nwbexplorer.opensourcebrain.org/nwbfile=https://github.com/vrhaynes/NWBShowcase/raw/master/FergusonEtAl2015/FergusonEtAl2015_PYR2.nwb

and displays properly in NWB Widgets:

Screenshot 2020-06-15 at 19 06 54

but wrongly in NWB Explorer

Screenshot 2020-06-15 at 19 06 26
filippomc commented 4 years ago

Also rate and starting time are not dealt with at the moment. Will use the same formulas from https://github.com/NeurodataWithoutBorders/nwb-jupyter-widgets/blob/d5d38e6be3ec75fa4f3f6815d8b512db298dcf7f/nwbwidgets/utils/timeseries.py#L25

pgleeson commented 4 years ago

Ok, great. Note though that starting time might be used to record the absolute time during the session, e.g. sweep 1 was recorded at 13:00, sweep 2 was at 13:04, etc. which is fine, but when plotted together they could cause shifting of the traces when put in the same axes...

filippomc commented 4 years ago

@pgleeson closing this, will wait for your issue for related features

pgleeson commented 4 years ago

Still broken on live, reopening. Will create separate fix for this for master

filippomc commented 4 years ago

@pgleeson we just need to merge development branch into master or do you see other issues?

pgleeson commented 4 years ago

There are a few other issues related to making a new release: https://github.com/MetaCell/nwb-explorer/milestone/6. I'll try to make a hotfix+pr for this, otherwise we can discuss the changes requiored on Wed