File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
element_array_ephys/export/nwb Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -485,10 +485,14 @@ def add_ephys_lfp_from_source_to_nwb(
485
485
probe .ElectrodeConfig .Electrode () & ephys_recording_record
486
486
).fetch ("electrode" )
487
487
488
- if all (extractor .get_channel_gains () == 1 ):
489
- channel_conversion = None
490
- else :
491
- channel_conversion = extractor .get_channel_gains ()
488
+ conversion = 1e-6
489
+ channel_conversion = None
490
+ if any (extractor .get_channel_gains () != 1 ):
491
+ gains = extractor .get_channel_gains ()
492
+ if all (x == gains [0 ] for x in gains ):
493
+ conversion *= gains [0 ]
494
+ else :
495
+ channel_conversion = gains
492
496
493
497
lfp .add_electrical_series (
494
498
pynwb .ecephys .ElectricalSeries (
@@ -505,7 +509,7 @@ def add_ephys_lfp_from_source_to_nwb(
505
509
name = "electrodes" ,
506
510
description = "recorded electrodes" ,
507
511
),
508
- conversion = 1e-6 ,
512
+ conversion = conversion ,
509
513
channel_conversion = channel_conversion ,
510
514
)
511
515
)
You can’t perform that action at this time.
0 commit comments