properly check if directories exist
Merge branch 'devel' of github.com:irfu/irfu-matlab into devel