""" The following python script is an example for the use of this dataset. This performs the operation of stepping through each systematic variation and averaging its associated statistical variations. This results in a set of fluxes that only represent systematic variations. The average is weighted by the assumed distributions detailed in the included technical note. """ # The pytables package is used to access HDF5 files. import tables as tb import sys f = tb.open_file(sys.argv[1], 'r') systematics = [] # The params.systematic table contains the parameters for each systematic variation. # There will be a one-to-one correspondence between this table and the output of this script. for i, sys_row in enumerate(f.root.params.systematic): # These systematic parameters belong to a group of flux variations. Where each # flux variation has different statistical parameters. Thus, we wish to average # over all of the statistical variations. But first, we have to find them. # Using the row index, look into the systematic_indexes array to find flux variations # which belong to these systematic parameters. # `systematic_indexes[i]' is the starting index, and systematic_indexes[i+1] is the # ending index, so we pull both out of the array. start, stop = f.root.systematic_indexes[i:i+2] # Fetch the flux variations between this start and stop index, then average them. mean = f.root.spectrums[start:stop].mean(0) systematics.append(mean) # systematic now contains a list of systematic variations. print(len(systematics))