code for the SAGA survey