Skip to content

Commit

Permalink
allowing comments in txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Sep 17, 2019
1 parent 76e3dde commit 7ca3ffb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ environment:
# For new releases, only one job will upload the source code to Pypi, and only
# one job each for Python 2 and 3 will upload a wheel.
matrix:
- PYTHON: "C:\\Miniconda37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
PYPI_UPLOAD_SOURCE: yes
PYPI_UPLOAD_WHEEL: yes
platform: x64
# - PYTHON: "C:\\Miniconda37-x64"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "64"
# PYPI_UPLOAD_SOURCE: yes
# PYPI_UPLOAD_WHEEL: yes
# platform: x64

- PYTHON: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
Expand Down
8 changes: 4 additions & 4 deletions circus/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def compute_artefacts(data_file):
"""

trig_in_ms = params.getboolean('triggers', 'trig_in_ms')
artefacts = numpy.loadtxt(params.get('triggers', 'trig_file'))
windows = numpy.loadtxt(params.get('triggers', 'trig_windows'))
artefacts = numpy.loadtxt(params.get('triggers', 'trig_file'), comments =['#','//'])
windows = numpy.loadtxt(params.get('triggers', 'trig_windows'), comments =['#','//'])
make_plots = params.get('triggers', 'make_plots')
plot_path = os.path.join(params.get('data', 'file_out_suff'), 'plots')

Expand Down Expand Up @@ -280,8 +280,8 @@ def remove_artefacts(data_file, art_dict):
"""

trig_in_ms = params.getboolean('triggers', 'trig_in_ms')
artefacts = numpy.loadtxt(params.get('triggers', 'trig_file'))
windows = numpy.loadtxt(params.get('triggers', 'trig_windows'))
artefacts = numpy.loadtxt(params.get('triggers', 'trig_file'), comments =['#','//'])
windows = numpy.loadtxt(params.get('triggers', 'trig_windows'), comments =['#','//'])
make_plots = params.get('triggers', 'make_plots')
plot_path = os.path.join(params.get('data', 'file_out_suff'), 'plots')

Expand Down
13 changes: 10 additions & 3 deletions docs_sphinx/code/artefacts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ Setting stimulation times

In a first text file, you must specify all the times of your artefacts, identified by a given identifier. The times can be given in ms or in timesteps, and this can be changed with the ``trig_unit`` parameter. By default, they are assumed to be in ms. For example, imagine you have 2 different stimulation protocols, each one inducing a different artefact. The text file will look like::
// mytimes.triggers
// Two interleaved stim (0 and 1) are
// played at various times, roughly every
// 500 ms
0 500.2
1 1000.2
0 1500.3
1 2000.1
1 2000.1 # this is a comment
...
0 27364.1
1 80402.4
Expand All @@ -58,8 +62,11 @@ Setting time windows

In a second text file, you must tell the algorithm what is the time window you want to consider for a given artefact. Using the same example, and assuming that stim 0 produces an artefact of 100ms, while stim 1 produces a longer artefact of 510ms, the file should look like::

0 100
1 510
// Estimated duration of the artefacts
// Stim 0 lasts 100 ms
// Stim 1 lasts 510 ms
0 100 # short opto flash
1 510 # long opto flash

Here, again, use ``trig_unit`` if you want to provide times in timesteps.

Expand Down

0 comments on commit 7ca3ffb

Please sign in to comment.