When the flatfile has zeros for the ground motion values for specific records then the ranking metrics mean and std of the residuals return inf owing to the log of the zero values being taken. This is not such an uncommon situation as it can be the case that for Sa at very short or long periods then the Sa may get filtered out depending on the high or low pass filter. Given that these tend to be a minority of records and this doesn't affect the other metrics (e.g. loglikelihood, EDR) then the mean and standard deviation of the residuals should still be calculated with these records discarded. As far as I can see this means changing the lines here (https://github.com/rizac/eGSIM/blob/main/egsim/smtk/ranking.py#L90) from mean and std to nanmean and nanstd.
When the flatfile has zeros for the ground motion values for specific records then the ranking metrics mean and std of the residuals return
infowing to the log of the zero values being taken. This is not such an uncommon situation as it can be the case that for Sa at very short or long periods then the Sa may get filtered out depending on the high or low pass filter. Given that these tend to be a minority of records and this doesn't affect the other metrics (e.g. loglikelihood, EDR) then the mean and standard deviation of the residuals should still be calculated with these records discarded. As far as I can see this means changing the lines here (https://github.com/rizac/eGSIM/blob/main/egsim/smtk/ranking.py#L90) from mean and std to nanmean and nanstd.