LALInference  4.1.6.1-b72065a
cbcBayesCombinePosteriors Namespace Reference

Variables

string posterior_grp_name = "posterior_samples"
 
 parser = argparse.ArgumentParser(description="Combine some posterior samples.")
 
 dest
 
 default
 
 help
 
 metavar
 
 action
 
 required
 
 type
 
 shuffleGroup = parser.add_mutually_exclusive_group()
 
 fileGroup = parser.add_mutually_exclusive_group()
 
 args = parser.parse_args()
 
 nPos = np.size(args.infilename)
 
 nWeight = np.size(args.weightings)
 
 weightings
 
string combineID = "combined"
 
list samples = []
 
list paramsList = []
 
list sizeList = []
 
dictionary metadata
 
 group = inFile["lalinference"]
 
 run_id = list(group.keys())[0]
 
list posDtype = []
 
 shape = group[key].shape
 
 posData = np.empty(shape, dtype=posDtype)
 
 paramsOut = list(set.intersection(*paramsList))
 
list datatypes = samples[0][paramsOut].dtype
 
 sizeOut = sum(sizeList)
 
 samplesOut = np.empty(sizeOut, dtype=datatypes)
 
list indexSize = sizeList
 
 fracWeight = np.asarray(args.weightings) / float(sum(args.weightings))
 
 testNum = fracWeight * float(sum(sizeList))
 
 minIndex = np.argmin(np.asarray(sizeList) / np.asarray(testNum))
 
list testSize = sizeList[minIndex] / fracWeight[minIndex]
 
 weightNum = np.around(fracWeight * testSize).astype(int)
 
int startIndex = 0
 
int stopIndex = startIndex + indexSize[posIndex]
 
 key
 
 data
 
 shuffle
 
 True
 
 compression
 
string paramHeader = "\t".join(paramsOut)
 
 T
 
 delimiter
 
 header
 
 comments
 

Variable Documentation

◆ posterior_grp_name

string cbcBayesCombinePosteriors.posterior_grp_name = "posterior_samples"

Definition at line 32 of file cbcBayesCombinePosteriors.py.

◆ parser

cbcBayesCombinePosteriors.parser = argparse.ArgumentParser(description="Combine some posterior samples.")

Definition at line 38 of file cbcBayesCombinePosteriors.py.

◆ dest

cbcBayesCombinePosteriors.dest

Definition at line 39 of file cbcBayesCombinePosteriors.py.

◆ default

cbcBayesCombinePosteriors.default

Definition at line 39 of file cbcBayesCombinePosteriors.py.

◆ help

cbcBayesCombinePosteriors.help

Definition at line 40 of file cbcBayesCombinePosteriors.py.

◆ metavar

cbcBayesCombinePosteriors.metavar

Definition at line 40 of file cbcBayesCombinePosteriors.py.

◆ action

cbcBayesCombinePosteriors.action

Definition at line 41 of file cbcBayesCombinePosteriors.py.

◆ required

cbcBayesCombinePosteriors.required

Definition at line 42 of file cbcBayesCombinePosteriors.py.

◆ type

cbcBayesCombinePosteriors.type

Definition at line 47 of file cbcBayesCombinePosteriors.py.

◆ shuffleGroup

cbcBayesCombinePosteriors.shuffleGroup = parser.add_mutually_exclusive_group()

Definition at line 48 of file cbcBayesCombinePosteriors.py.

◆ fileGroup

cbcBayesCombinePosteriors.fileGroup = parser.add_mutually_exclusive_group()

Definition at line 58 of file cbcBayesCombinePosteriors.py.

◆ args

cbcBayesCombinePosteriors.args = parser.parse_args()

Definition at line 67 of file cbcBayesCombinePosteriors.py.

◆ nPos

cbcBayesCombinePosteriors.nPos = np.size(args.infilename)

Definition at line 70 of file cbcBayesCombinePosteriors.py.

◆ nWeight

cbcBayesCombinePosteriors.nWeight = np.size(args.weightings)

Definition at line 71 of file cbcBayesCombinePosteriors.py.

◆ weightings

cbcBayesCombinePosteriors.weightings

Definition at line 85 of file cbcBayesCombinePosteriors.py.

◆ combineID

string cbcBayesCombinePosteriors.combineID = "combined"

Definition at line 88 of file cbcBayesCombinePosteriors.py.

◆ samples

list cbcBayesCombinePosteriors.samples = []

Definition at line 105 of file cbcBayesCombinePosteriors.py.

◆ paramsList

list cbcBayesCombinePosteriors.paramsList = []

Definition at line 106 of file cbcBayesCombinePosteriors.py.

◆ sizeList

list cbcBayesCombinePosteriors.sizeList = []

Definition at line 107 of file cbcBayesCombinePosteriors.py.

◆ metadata

dictionary cbcBayesCombinePosteriors.metadata
Initial value:
1 = {"lalinference": defaultdict(lambda: [None]*nPos),
2  "lalinference/"+combineID: defaultdict(lambda: [None]*nPos),
3  "lalinference/"+combineID+"/"+posterior_grp_name: defaultdict(lambda: [None]*nPos)}

Definition at line 108 of file cbcBayesCombinePosteriors.py.

◆ group

cbcBayesCombinePosteriors.group = inFile["lalinference"]

Definition at line 118 of file cbcBayesCombinePosteriors.py.

◆ run_id

cbcBayesCombinePosteriors.run_id = list(group.keys())[0]

Definition at line 122 of file cbcBayesCombinePosteriors.py.

◆ posDtype

list cbcBayesCombinePosteriors.posDtype = []

Definition at line 145 of file cbcBayesCombinePosteriors.py.

◆ shape

cbcBayesCombinePosteriors.shape = group[key].shape

Definition at line 148 of file cbcBayesCombinePosteriors.py.

◆ posData

cbcBayesCombinePosteriors.posData = np.empty(shape, dtype=posDtype)

Definition at line 150 of file cbcBayesCombinePosteriors.py.

◆ paramsOut

cbcBayesCombinePosteriors.paramsOut = list(set.intersection(*paramsList))

Definition at line 168 of file cbcBayesCombinePosteriors.py.

◆ datatypes

list cbcBayesCombinePosteriors.datatypes = samples[0][paramsOut].dtype

Definition at line 170 of file cbcBayesCombinePosteriors.py.

◆ sizeOut

cbcBayesCombinePosteriors.sizeOut = sum(sizeList)

Definition at line 175 of file cbcBayesCombinePosteriors.py.

◆ samplesOut

cbcBayesCombinePosteriors.samplesOut = np.empty(sizeOut, dtype=datatypes)

Definition at line 176 of file cbcBayesCombinePosteriors.py.

◆ indexSize

cbcBayesCombinePosteriors.indexSize = sizeList

Definition at line 178 of file cbcBayesCombinePosteriors.py.

◆ fracWeight

cbcBayesCombinePosteriors.fracWeight = np.asarray(args.weightings) / float(sum(args.weightings))

Definition at line 182 of file cbcBayesCombinePosteriors.py.

◆ testNum

cbcBayesCombinePosteriors.testNum = fracWeight * float(sum(sizeList))

Definition at line 184 of file cbcBayesCombinePosteriors.py.

◆ minIndex

cbcBayesCombinePosteriors.minIndex = np.argmin(np.asarray(sizeList) / np.asarray(testNum))

Definition at line 185 of file cbcBayesCombinePosteriors.py.

◆ testSize

list cbcBayesCombinePosteriors.testSize = sizeList[minIndex] / fracWeight[minIndex]

Definition at line 187 of file cbcBayesCombinePosteriors.py.

◆ weightNum

cbcBayesCombinePosteriors.weightNum = np.around(fracWeight * testSize).astype(int)

Definition at line 189 of file cbcBayesCombinePosteriors.py.

◆ startIndex

int cbcBayesCombinePosteriors.startIndex = 0

Definition at line 199 of file cbcBayesCombinePosteriors.py.

◆ stopIndex

int cbcBayesCombinePosteriors.stopIndex = startIndex + indexSize[posIndex]

Definition at line 201 of file cbcBayesCombinePosteriors.py.

◆ key

cbcBayesCombinePosteriors.key

Definition at line 222 of file cbcBayesCombinePosteriors.py.

◆ data

cbcBayesCombinePosteriors.data

Definition at line 222 of file cbcBayesCombinePosteriors.py.

◆ shuffle

cbcBayesCombinePosteriors.shuffle

Definition at line 222 of file cbcBayesCombinePosteriors.py.

◆ True

cbcBayesCombinePosteriors.True

Definition at line 222 of file cbcBayesCombinePosteriors.py.

◆ compression

cbcBayesCombinePosteriors.compression

Definition at line 222 of file cbcBayesCombinePosteriors.py.

◆ paramHeader

cbcBayesCombinePosteriors.paramHeader = "\t".join(paramsOut)

Definition at line 230 of file cbcBayesCombinePosteriors.py.

◆ T

cbcBayesCombinePosteriors.T

Definition at line 231 of file cbcBayesCombinePosteriors.py.

◆ delimiter

cbcBayesCombinePosteriors.delimiter

Definition at line 231 of file cbcBayesCombinePosteriors.py.

◆ header

cbcBayesCombinePosteriors.header

Definition at line 231 of file cbcBayesCombinePosteriors.py.

◆ comments

cbcBayesCombinePosteriors.comments

Definition at line 231 of file cbcBayesCombinePosteriors.py.