logic tree : weight_sum = 1.0 condition

28 views
Skip to first unread message

thomas ulrich

unread,
May 29, 2013, 8:39:16 AM5/29/13
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.

Lars Butler

unread,
May 31, 2013, 5:06:56 AM5/31/13
to openqu...@googlegroups.com
Hi Thomas,

Thanks for the feedback. This seems like a good suggestion; would you filing an issue about this in our bug tracker? See https://bugs.launchpad.net/oq-engine/+filebug. You can use this page in general for reporting bugs or requesting features.

Cheers,
Lars




Thomas.

--
You received this message because you are subscribed to the Google Groups "OpenQuake Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages