Update sofia_pipeline.py

Added option to use a different directory for output. Directory is only used if it already exists.