Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Documentation and tutorial enhancements
- Added documentation for `ExternalImage` to the images tutorial. @h-mayorquin [#2159](https://github.com/NeurodataWithoutBorders/pynwb/pull/2159)
- Fixed broken and redirecting links in documentation. @bendichter [#2165](https://github.com/NeurodataWithoutBorders/pynwb/pull/2165)
- Added example of setting `Units.resolution` in the ecephys tutorial. @h-mayorquin [#2174](https://github.com/NeurodataWithoutBorders/pynwb/pull/2174)

### Added
- Added support for HERD (HDMF External Resources Data Structure) as the `external_resources` field on `NWBFile`, enabling users to associate external resource annotations (e.g., ontology term mappings) with their NWB files. `link_resources` and `get_external_resources` are inherited from `HERDManager` in hdmf. @mavaylon1, @rly [#2111](https://github.com/NeurodataWithoutBorders/pynwb/pull/2111)
Expand Down
16 changes: 16 additions & 0 deletions docs/gallery/domain/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,22 @@
spike_times = np.where(np.random.rand((res * duration)) < (firing_rate / res))[0] / res
nwbfile.add_unit(spike_times=spike_times, quality="good")

####################
# The ``resolution`` field on the :py:class:`~pynwb.misc.Units` table documents the precision of spike timing
# data, typically ``1 / sampling_rate`` of the acquisition system (i.e., the smallest measurable difference
# between two spike times, in seconds). Setting it helps downstream users judge whether fine-timescale
# analyses are appropriate for the dataset.
#
# When creating the :py:class:`~pynwb.misc.Units` table directly, you can pass it to the constructor:
#
# .. code-block:: python
#
# units = Units(name="units", resolution=1 / 30000) # 30 kHz recording system
#
# Since the tutorial uses :py:meth:`.NWBFile.add_unit`, we set it after the fact:

nwbfile.units.resolution = 1 / res # resolution in seconds (1 / sampling rate)

#######################
# The :py:class:`~pynwb.misc.Units` table can also be converted to a pandas :py:class:`~pandas.DataFrame`.
#
Expand Down
Loading