combined sam-to-base_log.py to sam-to-t_base_log.py