Write save_raw_traces and test_brain_states.