Dear OpenQuake community,
I am trying to use openquake.calculators.extract to retrieve the weights associated with each end branch of the logic tree.
I am running the calculation and accessing the results by means
of Python code by doing:
calc_id = main(path_to_job_ini)
dstore = read(calc_id)
For a scenario damage example I am running with 2 branches of the GMM logic tree, the output of extract(dstore, "full_lt").get_realizations() looks like this:
array([<0,w=[0.333]>, <1,w=[0.667]>], dtype=object)
For each element of this array (which I call "rlz_weights_raw"), I can do rlz_weights_raw[rlz].weight and retrieve the array of weights (i.e., [0.333] and [0.667]). But I am not managing to understand why the weight is an array and not a number. I can of course do rlz_weights_raw[rlz].weight[0], but I am concerned I may be missing the reason for which "w" is a Numpy array and thus not be contemplating other possibilities that may come up for me in the future.
What I have found under hazardlib/logictree.py searching for "LtRealization" has not helped me clarify this. (E.g. line 195, weight = numpy.array([len(rows) / len(triples)])).
Can you please help me understand when would I obtain more than one number inside the "weight" array? My ultimate purpose is to retrieve the weights associated with each "rlz" (as output, for example, in damage results).
Thank you very much in advance!
Best regards,
Cecilia