csv_gen improvements, added calculate_offset to plots.py