This page will teach you how to set up your own acquisition parameters that are specific to your project and are different from the standard parameters that are set each morning at 5 AM at the NatMEG lab

Why?

This allows you to make sure that the parameters are changed time-efficiently and in the same manner each time you are running your experiment

How?

Follow these simple steps: (be sure to run any commands exactly as shown; in bash, spaces are syntactically relevant):

  1. Enter the acquisition parameters directory on the acquisition computer.
    Open a terminal and enter the following command
cd scripts/acquisition_parameters
  1. Create your own file with your project specific parameters (please include project name in name).
    Make sure file ending is “.sh”!

    2a. Create file with gedit (opens a new window)
    2b. Create file with vim (stays inside terminal, but is less straightforward to use compared to gedit)

gedit your_name.sh ## 5a
vim your_name.sh ## 5b
  1. Specify the parameters that you want to change (example is shown with changing HPI-frequencies)
#!/bin/sh
## --- BEGIN: these commands are _general_ to _all_ scripts --- ##
host=localhost
service=collector
cptcp="/neuro/dacq/bin/cptcp $host -s $service -d 1" ## -d is for a delay of 1 s, which is crucial
## --- END: these commands are _general_ to _all_ scripts --- ##

## --- BEGIN: these commands are _specific_ to _your_ script (just an example) --- ##
hpiFreq1=630.0 ## set variables that you want to change
hpiFreq2=580.0
hpiFreq3=530.0
hpiFreq4=480.0
hpiFreq5=430.0
## --- END: these commands are _specific_ to _your_ script (just an example) --- ##

## --- BEGIN: these commands are _general_ to _all_ scripts --- ##
$cptcp <<EOF ## everything until EOF will be commands to the collector
pass homunculus122
## --- END: these commands are _general_ to _all_ scripts --- ##

## --- BEGIN: these commands are _specific_ to _your_ script (just an example) --- ##
vara hpiFreq1 = $hpiFreq1 ## make the __actual__ change in the collector
vara hpiFreq2 = $hpiFreq2
vara hpiFreq3 = $hpiFreq3
vara hpiFreq4 = $hpiFreq4
vara hpiFreq5 = $hpiFreq5
## --- END: these commands are _specific_ to _your_ script (just an example) --- ##

## --- BEGIN: these commands are _general_ to _all_ scripts --- ##
quit ## quit collector
EOF ## end of input to collector
## --- END: these commands are _general_ to _all_ scripts --- ##

## --- OPTIONAL: feedback example --- ##
echo "HPI frequencies 1-5 are now $hpiFreq1, $hpiFreq2, $hpiFreq3, $hpiFreq4 & $hpiFreq5 Hz"
  1. Finally, save your script and exit the editor.
    Then make the script exectutable by the following command
chmod u+x your_name.sh
  1. If done correctly, you can now set the parameters before your recording automatically by opening a terminal and entering the following command
/scripts/acquisition_parameters/your_name.sh