# Print median values for all parameters in GWTC-3

**URL:** <https://ask.igwn.org/t/print-median-values-for-all-parameters-in-gwtc-3/437>\
**Category:** Data Analysis\
**Created:** [October 12, 2022, 5:37pm UTC](https://ask.igwn.org/t/print-median-values-for-all-parameters-in-gwtc-3/437 "2022-10-12T17:37:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonah](https://yyz1.discourse-cdn.com/flex031/user_avatar/ask.igwn.org/jonah/32/10_2.png) [@jonah](https://ask.igwn.org/u/jonah)\
**Post date:** [October 12, 2022, 5:37pm UTC](https://ask.igwn.org/t/print-median-values-for-all-parameters-in-gwtc-3/437/1 "2022-10-12T17:37:28Z")

</div>

I recently got a question, asking me how to print all parameter values for a catalog of events. Following the example code in the [GWTC-3 PE data release](https://zenodo.org/record/5546663), I wrote some example code to do this.

This uses the [pesummary](https://pypi.org/project/pesummary/) package, which is included in the [IGWN Conda](https://computing.docs.ligo.org/conda/usage/) distribution.

```auto
import numpy as np
from pesummary.io import read
import glob

# -- GWTC-3 PE from zenodo: https://doi.org/10.5281/zenodo.5546662
indir = '/cvmfs/gwosc.osgstorage.org/gwdata/zenodo/ligo-virgo-kagra/2021/5546662/1/'
filelist = glob.glob(indir + '*_cosmo.h5')

for fn in filelist:

    # Get event name from file name
    eventname_spl = fn.split('-')[-1].split('_')[0:2]
    eventname = '_'.join(eventname_spl)

    # Read in posterior samples
    pedata = read(fn)
    samples = pedata.samples_dict["C01:Mixed"]

    # print out median value for each parameter
    print('\n--- ', eventname, ' ---')    
    for param in sorted(samples.keys()):
        value = np.median(samples[param])
        print(param, value)

```
