Creating measurement lists - galizia-lab/pyview GitHub Wiki
A measurement list is a (Excel) table that lists, one row each, all measurements, and adds (one column each) information about the measurements, such as stimulus, concentration, timing, etc.
- Download the script "create_measurement_list_template.py" from here in to the directory "progs" of your project.
- Rename the file by removing "_template". You could rename the file further if you choose.
- Open the script in a Python editor like Spyder and read the script once thoroughly up to the line
if __name__ == "__main__"
. - Set the variables
LE_loadExp
,STG_MotherOfAllFolders
,STG_Datapath
andSTG_OdorInfoPath
values according to your project and folder structure. - Set default values for flags in the block beginning with
# ------- A dictionary containing default values for metadata.---
. Uncomment lines to include additional flags. - Save the script.
- Open a terminal/Powershell and activate the environment created for VIEW during Pre-Installation, for example using
conda activate <environment name>
orpipenv shell
- Run the script using
python <path to the script>
Advanced Usage
The script mainly does the following:
- Raise a dialog asking the user to choose raw data files containing metadata.
- Load machine readable metadata from these files and parse them.
- Set entries not initialized in step 2 with default values.
- If a list file for the selected animal already exists, retain values from it for the columns specified in the variable
overwrite_old_values
of the script. - Write the list file.
In addition the script can be configured to do the following:
Post-processing of lists
Initialize or rewrite column values based on other columns. This will be done between step 2 and 3. This can be done by injecting code into the function custom_func
.
Exclude measurements (only for Till Vision setups)
Entries in log files can be excluded using the function measurement_filter
of the script. By default, the criteria for exclusion are as follows:
- If the label of the entry contains "Snapshot" or "Delta"
- If the label contains no underscores (
_
). - If the entry contains at least two frames, judged based on the line starting with
timing [ms]
.