Skip to main content

npc_samstim

Tools for processing stim data from Sam's DynamicRoutingTask, compatible with data in the cloud.

PyPI Python version

Coverage CI/CD GitHub issues

Usage

conda create -n npc_samstim python>=3.11
conda activate npc_samstim
pip install npc_samstim

Python

>>> import npc_samstim

Sound onset times without a sync line

Sessions recorded before 2023-08-31 have no "sound running" line on sync, so sound onsets are found in the NI-DAQ recording of the speaker signal with get_stim_latencies_from_nidaq_recording(..., waveform_type='sound').

The default method (waveforms.align_sound, core in sound_alignment.py):

  • models playback (NI-DAQ AO zero-order hold at 80 MHz/1667 = 47990.4 Hz, or a sound card's band-limited output) and calibrates the effective rate per stim file,
  • finds each onset with a robust envelope correlation, refined by carrier correlation for noise,
  • maps NI-DAQ samples to sync time through all matched barcodes (not just the first and last),
  • returns NaN latency when the recording doesn't match the waveform.

Validated against the sync line in 33 sessions (21,069 trials):

  • AM-noise onsets: p95 error ~10 us
  • tone onsets: p95 ~0.12 ms, and at most 0.29 ms for any single frequency

The previous raw cross-correlation (xcorr_legacy, still used for opto, or via legacy=True) was more than 1 ms wrong for 85% of tone trials, by up to ~100 ms. See outputs/aud-onset-xcorr/report.pdf and experiments/aud_xcorr/.

Development

See instructions in https://github.com/AllenInstitute/npc_samstim/CONTRIBUTING.md and the original template: https://github.com/AllenInstitute/copier-pdm-npc/blob/main/README.md

Metadata

Release files for npc-samstim 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npc-samstim 0.1.18
File Size Uploaded Provenance Actions
npc_samstim-0.1.18.tar.gz 33.1 kB Without provenance Details for npc_samstim-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for npc-samstim 0.1.18
File Interpreter ABI Platform Actions
npc_samstim-0.1.18-py3-none-any.whl Python 3 none any Details for npc_samstim-0.1.18-py3-none-any.whl

Total release size: 60.6 kB

Release files / npc_samstim-0.1.18.tar.gz

Download URL npc_samstim-0.1.18.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d6da10631c78907700d19bb38cadb7cd7b9f7c19de3eeb542c5ba09ed64f8438
BLAKE2b-256 checksum
How to use checksums
2813a08f0d52210b06c06a5d03e25c9d5d0bb3fe1d3d85b1cab99ac2486b3192
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / npc_samstim-0.1.18-py3-none-any.whl

Download URL npc_samstim-0.1.18-py3-none-any.whl
Size 27.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5239ff5f63704a9011e632c11bedf1ec5d0ead4568774c97634b1657916ed431
BLAKE2b-256 checksum
How to use checksums
5aeaa7fe43f87ea78042b528c72fbf709b0c81717cf57eade68fbbb75d0df313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for npc-samstim 0.1.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page