thomas ulrich
unread,May 29, 2013, 8:39:16 AM5/29/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openqu...@googlegroups.com
Hi everyone,
I wrote a small script to create the source logic tree file with python its lxml library.
I'm dealing with incertitudes for at least a,b and Mmax, with a lot of sources.
My problem is that since the logic tree creation is scripted, the weights that are computed are not exactly summing 1.0, and it would cost me much to change by hand one of the coefficients to reach exactly 1.0.
Example:
<logicTreeBranchSet branchSetID="bs_iz0_isrc5_2" applyToSources="NZ_Vietnam_Z34fus_src_5" uncertaintyType="maxMagGRAbsolute">
<logicTreeBranch branchID="br_iz0_isrc5_Mw_0">
<uncertaintyModel>5.6</uncertaintyModel>
<uncertaintyWeight>0.333333333333</uncertaintyWeight>
</logicTreeBranch>
<logicTreeBranch branchID="br_iz0_isrc5_Mw_1">
<uncertaintyModel>5.8</uncertaintyModel>
<uncertaintyWeight>0.333333333333</uncertaintyWeight>
</logicTreeBranch>
<logicTreeBranch branchID="br_iz0_isrc5_Mw_2">
<uncertaintyModel>6.0</uncertaintyModel>
<uncertaintyWeight>0.333333333333</uncertaintyWeight>
</logicTreeBranch>
</logicTreeBranchSet>
Here one of the weights should be modified in 0.333333333334 ....
I would suggest you to modify the code so that to autorized a little rounding error.
(ex abs(weight_sum-1.0)<1e-5 instead of weight_sum != 1.0)
Thomas.