I don't think $pat and $out have the values you think they do
$ echo ${files[@]}
./d1/file1 ./d1/file2 ./d1/file3 ./d2/file4 ./d2/file5 ./d2/file6
$ pat=$files
$ echo ${pat[@]}
./d1/file1
$ out=$files
$ echo ${pat[@]}
./d1/file1
I think what you're trying to accomplish requires different values for $pat and $out depending on the value of parallel's internal “variable” ‘{}’ (which would be each member of the $files array), but what you've got only puts the first member of $files on the command line.
Among the other “variables” GNU Parallel supports, one is ‘{//}’, which is replaced by the directory name of the ‘{}’ value (if any).
Given that, I think you want something more like
#!/bin/bash
script="/path/to/python/script/plot.py"
files=($(find . -maxdepth 2 -mindepth 2 | sort))
filt="True"
chan="Z"
parallel --jobs 4 python $script -f {} -p {//} -o {//} -fl $filt -c $chan ::: ${files[@]}
Is this something more like what you want?
$ parallel echo python $script -f {} -p {//} -o {//} -f $filt -c $chan ::: ${files[@]}
python /path/to/python/script/plot.py -f ./d1/file1 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d1/file2 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d1/file3 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file5 -p ./d2 -o ./d2 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file4 -p ./d2 -o ./d2 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file6 -p ./d2 -o ./d2 -f True -c Z
Since you're using sort on the find, I think you may also want to use the --keep-order parameter:
$ parallel --keep-order echo python $script -f {} -p {//} -o {//} -f $filt -c $chan ::: ${files[@]}
python /path/to/python/script/plot.py -f ./d1/file1 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d1/file2 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d1/file3 -p ./d1 -o ./d1 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file4 -p ./d2 -o ./d2 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file5 -p ./d2 -o ./d2 -f True -c Z
python /path/to/python/script/plot.py -f ./d2/file6 -p ./d2 -o ./d2 -f True -c Z
Which only makes sure the order of the output is the same as the input, not that the jobs are run in that or any deterministic order.
set -euo pipefail
after the shebang line#!/bin/bash
it will give you more info on what your script is doingparallel --dry-run ...
. It will tell you what GNU Parallel is running. Maybe filenames contain space?