Improving label choice in summarypublication.py
In the read_samples
function, for files encapsulated in a pesummary.gw.file.formats.pesummary.PESummary
object, the hard-coded behavior when there are multiple analyses is to take whichever has index zero (see here).
In my own testing with GWTC-2 events, this happens to be IMRPhenomD
in many if not all cases, which is an aligned-spin approximant. This means, for example, if I wanted to plot (cosine) spin tilt angles cos_tilt_1
and cos_tilt_2
, those fields take uninitialized values of zero, as the analysis does not model spin tilts (although I think the values shouldn't actually be zero, see #260).
A more reasonable default would be PublicationSamples
, as it is meant to be a default. Of course, the file format doesn't guarantee a PublicationSamples
field will exist, so it's probably best to allow for both user-provided input, as well as default fallback options.