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.16

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.16
File Size Uploaded Provenance Actions
npc_samstim-0.1.16.tar.gz 31.9 kB Without provenance Details for npc_samstim-0.1.16.tar.gz

Built distribution (wheel)

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

Total release size: 58.8 kB

Release files / npc_samstim-0.1.16.tar.gz

Download URL npc_samstim-0.1.16.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b535ab9e2efb12a514b187bcfc7e83e163084e082f4531122eb2bf46aa2b3158
BLAKE2b-256 checksum
How to use checksums
c3bfe926b54301183224e7e739379c5451cb3d8dbedf5484daac3a30a3bbf8f1
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.16-py3-none-any.whl

Download URL npc_samstim-0.1.16-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e854d8ee842715e358ccf551942d229291b2cf0b4b88c3725b81c2d9e049217
BLAKE2b-256 checksum
How to use checksums
1bd942931fe81b83044512d9a6fd5cb4684623d7fc6565e72031122d259b3ef0
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.16

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