merge into stage_data.py for csv outputs