Notice that num_sources is a list with the number of sources for each realizations. So len(num_sources) > 1 means that there is more than one realization, so I am logging the total only iff there are several realizations.