ApplyToSources for multiple sources IDs

43 views
Skip to first unread message

255i...@gmail.com

unread,
Apr 16, 2019, 11:35:10 AM4/16/19
to OpenQuake Users
Hi all,
I have just started to use the latest version of OpenQuake (v3.4). I have seen that the option ApplyToSources with multiple source IDs is not supported anymore.
To apply the same logic tree for Mmax to multiple sources, should I write the logic tree for every source? is there a faster way to do it?
Below there is the source_model_logic_tree.xml that I run in the previous version of OQ.
Thank you very much for any help.
Kind regards
Ilaria

<?xml version="1.0" encoding="UTF-8"?>
<nrml xmlns:gml="http://www.opengis.net/gml"
    <logicTree logicTreeID="lt1">
        <logicTreeBranchingLevel branchingLevelID="bl1">
            <logicTreeBranchSet uncertaintyType="sourceModel"
                                branchSetID="bs1">
                <logicTreeBranch branchID="UK_EC8">
                    <uncertaintyModel>source_model.xml</uncertaintyModel>
                    <uncertaintyWeight>1.0</uncertaintyWeight>
                </logicTreeBranch>
            </logicTreeBranchSet>
        </logicTreeBranchingLevel>
      <logicTreeBranchingLevel branchingLevelID="bl2">
            <logicTreeBranchSet uncertaintyType="maxMagGRAbsolute"
                                applyToSources="1 2 3 4 5 6 7 8 9 10 11 12 13 15 17 18 19 20 21"
                                branchSetID="bs2">
                <logicTreeBranch branchID="Mmax12">
                    <uncertaintyModel>5.5</uncertaintyModel>
                    <uncertaintyWeight>0.2</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax22">
                    <uncertaintyModel>6.0</uncertaintyModel>
                    <uncertaintyWeight>0.5</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax32">
                    <uncertaintyModel>6.5</uncertaintyModel>
                    <uncertaintyWeight>0.3</uncertaintyWeight>
                </logicTreeBranch>
             </logicTreeBranchSet>
        </logicTreeBranchingLevel>
      <logicTreeBranchingLevel branchingLevelID="bl3">
            <logicTreeBranchSet uncertaintyType="maxMagGRAbsolute"
                                applyToSources="14 16 22 23"
                                branchSetID="bs3">
                <logicTreeBranch branchID="Mmax13">
                    <uncertaintyModel>6.0</uncertaintyModel>
                    <uncertaintyWeight>0.6</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax23">
                    <uncertaintyModel>6.5</uncertaintyModel>
                    <uncertaintyWeight>0.4</uncertaintyWeight>
                </logicTreeBranch>
             </logicTreeBranchSet>
        </logicTreeBranchingLevel>
    </logicTree>
</nrml>

michele....@globalquakemodel.org

unread,
Apr 17, 2019, 2:24:13 AM4/17/19
to OpenQuake Users


On Tuesday, April 16, 2019 at 5:35:10 PM UTC+2, 255i...@gmail.com wrote:
Hi all,
I have just started to use the latest version of OpenQuake (v3.4). I have seen that the option ApplyToSources with multiple source IDs is not supported anymore.

No, you are wrong, we simply fixed a bug. As documented in the manual, absolute uncertainties can be applied to a single source, so a logic tree like

            <logicTreeBranchSet uncertaintyType="maxMagGRAbsolute"
                                applyToSources="1 2 3 4 5 6 7 8 9 10 11 12 13 15 17 18 19 20 21">

was invalid and the previous version of the engine incorrectly accepted it. You can use relative uncertainties, though.

    Michele

255i...@gmail.com

unread,
Apr 17, 2019, 4:35:57 AM4/17/19
to OpenQuake Users
Thank you very much for the explanation. Indeed, replacing Absolute error with relative error it works.
However, I still have an error message afterwards when I try to run a script with OQ v3.4. 
Would you please help me to understand when the problem is?
I am copying below the message.
It seems that the source model is read well, but at the end there is a message "all the sources are filtered away!". What  does it mean?
Thank you very much.
Ilaria

[support@mhvmxopenquake1 newOQ]$ oq engine --run job.ini
[2019-04-17 10:30:25,043 #31 INFO] support running /opt/newOQ/job.ini [--hc=None]
[2019-04-17 10:30:25,045 #31 INFO] Using engine version 3.4.0-1
[2019-04-17 10:30:25,750 #31 INFO] zipping the input files
[2019-04-17 10:30:25,762 #31 INFO] Reading the risk model if present
[2019-04-17 10:30:25,765 #31 INFO] Read 1 hazard sites
[2019-04-17 10:30:25,771 #31 INFO] Reading source IDs from source model UK_EC8
[2019-04-17 10:30:25,781 #31 INFO] Reading source IDs from source model Mmax12
[2019-04-17 10:30:25,783 #31 INFO] Reading source IDs from source model Mmax22
[2019-04-17 10:30:25,785 #31 INFO] Reading source IDs from source model Mmax32
[2019-04-17 10:30:25,787 #31 INFO] Reading source IDs from source model Mmax13
[2019-04-17 10:30:25,788 #31 INFO] Reading source IDs from source model Mmax23
[2019-04-17 10:30:25,799 #31 INFO] Read 1 TRTs from 1 model file(s)
[2019-04-17 10:30:25,801 #31 INFO] Potential number of logic tree paths = 6
[2019-04-17 10:30:25,803 #31 INFO] Reading the source model(s) in parallel
[2019-04-17 10:30:30,787 #31 INFO] Sent 2.1 KB of data in 6 read_source_models task(s)
[2019-04-17 10:30:30,806 #31 INFO] read_source_models  16% [of 6]
[2019-04-17 10:30:30,812 #31 INFO] read_source_models  33% [of 6]
[2019-04-17 10:30:30,829 #31 INFO] read_source_models  50% [of 6]
[2019-04-17 10:30:30,856 #31 INFO] read_source_models  66% [of 6]
[2019-04-17 10:30:30,951 #31 INFO] read_source_models  83% [of 6]
[2019-04-17 10:30:30,953 #31 INFO] read_source_models 100% [of 6]
[2019-04-17 10:30:30,955 #31 INFO] Received 136.03 KB from 6 read_source_models outputs in 5 seconds, biggest output=22.67 KB
[2019-04-17 10:30:34,989 #31 INFO] Processed source model 1 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:38,931 #31 INFO] Processed source model 2 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:42,970 #31 INFO] Processed source model 3 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:46,984 #31 INFO] Processed source model 4 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:50,970 #31 INFO] Processed source model 5 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:54,884 #31 INFO] Processed source model 6 with 1 gsim path(s) and 23 sources
[2019-04-17 10:30:54,887 #31 INFO] The composite source model has 25,567,808 ruptures
[2019-04-17 10:30:54,889 #31 INFO] /opt/newOQ/source_model.xml has been considered 6 times
[2019-04-17 10:30:54,891 #31 INFO] Applied 138 changes to the composite source model
[2019-04-17 10:30:54,999 #31 INFO] Splitting/filtering sources with RtreeFilter
[2019-04-17 10:31:02,097 #31 CRITICAL]
Traceback (most recent call last):
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 270, in run
    self.pre_execute()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 569, in pre_execute
    self.read_inputs()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 503, in read_inputs
    csm, srcfilter, split, self.monitor())
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 180, in parallel_split_filter
    raise RuntimeError('All sources were filtered away!')
RuntimeError: All sources were filtered away!
[2019-04-17 10:31:02,104 #31 CRITICAL] Traceback (most recent call last):
  File "/opt/openquake/lib/python3.6/site-packages/openquake/engine/engine.py", line 310, in run_calc
    close=False, **kw)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 270, in run
    self.pre_execute()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 569, in pre_execute
    self.read_inputs()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 503, in read_inputs
    csm, srcfilter, split, self.monitor())
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 180, in parallel_split_filter
    raise RuntimeError('All sources were filtered away!')
RuntimeError: All sources were filtered away!

Traceback (most recent call last):
  File "/usr/bin/oq", line 11, in <module>
    load_entry_point('openquake.engine==3.4.0.post1', 'console_scripts', 'oq')()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/commands/__main__.py", line 50, in oq
    parser.callfunc()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/baselib/sap.py", line 181, in callfunc
    return self.func(**vars(namespace))
  File "/opt/openquake/lib/python3.6/site-packages/openquake/baselib/sap.py", line 251, in main
    return func(**kw)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/commands/engine.py", line 214, in engine
    exports, reuse_hazard)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/commands/engine.py", line 125, in smart_run
    hc_id = run_job(job_ini, log_level, log_file, exports, **kw)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/commands/engine.py", line 68, in run_job
    eng.run_calc(job_id, oqparam, exports, **kw)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/engine/engine.py", line 310, in run_calc
    close=False, **kw)
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 270, in run
    self.pre_execute()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 569, in pre_execute
    self.read_inputs()
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 503, in read_inputs
    csm, srcfilter, split, self.monitor())
  File "/opt/openquake/lib/python3.6/site-packages/openquake/calculators/base.py", line 180, in parallel_split_filter
    raise RuntimeError('All sources were filtered away!')
RuntimeError: All sources were filtered away!

Marco Pagani

unread,
Apr 17, 2019, 4:47:51 AM4/17/19
to OpenQuake Users

Ciao Ilaria,
Is your site within the integration distance from the sources?
Marco



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

255i...@gmail.com

unread,
Apr 17, 2019, 6:09:53 AM4/17/19
to OpenQuake Users
Ciao,
The source model is the UK model published in 2007 and the site is in the south-east part of the UK. Therefore, it is at a larger distance than the integration distance from some sources (for example the sources in Scotland). Is this a problem? Should I increase the integration distance (I set it to 400 km)? or should I remove the sources that exceed the integration distances?
I could run the same  script with the older version of OQ. 
Thank you very much for the help.
Ilaria
To unsubscribe from this group and stop receiving emails from it, send an email to openqua...@googlegroups.com.

michele....@globalquakemodel.org

unread,
Apr 17, 2019, 7:32:39 AM4/17/19
to OpenQuake Users


On Wednesday, April 17, 2019 at 12:09:53 PM UTC+2, 255i...@gmail.com wrote:
Ciao,
The source model is the UK model published in 2007 and the site is in the south-east part of the UK. Therefore, it is at a larger distance than the integration distance from some sources (for example the sources in Scotland). Is this a problem? Should I increase the integration distance (I set it to 400 km)? or should I remove the sources that exceed the integration distances?
I could run the same  script with the older version of OQ. 

That error only happens if ALL sources are outside the integration distance. Normally this happens when users exchange lon, lat with lat, lon in the sites. If that is not the case, then I would plot the bounding boxes of the sources and compare their positions with the position of the site, there must be something wrong.

    Michele 

255i...@gmail.com

unread,
Apr 17, 2019, 8:50:12 AM4/17/19
to OpenQuake Users
Ciao,
Thank you very much for the answer.
I think the problem is connected with the file source_model_logic_tree.xml. When I do not include the Mmax logic tree (Option1 below), the script runs well; when I include the Mmax logic tree using maxMagGRRelative, the error message (Option2 below).
Sorry for these emails and the time it takes to you, but I cannot figured out where the problem is.
Ilaria

Option1: source_model_logic_tree1.xml
<?xml version="1.0" encoding="UTF-8"?>
<nrml xmlns:gml="http://www.opengis.net/gml"
    <logicTree logicTreeID="lt1">
        <logicTreeBranchingLevel branchingLevelID="bl1">
            <logicTreeBranchSet uncertaintyType="sourceModel"
                                branchSetID="bs1">
                <logicTreeBranch branchID="b1">
                    <uncertaintyModel>source_model.xml</uncertaintyModel>
                    <uncertaintyWeight>1.0</uncertaintyWeight>
                </logicTreeBranch>
            </logicTreeBranchSet>
        </logicTreeBranchingLevel>
    </logicTree>
</nrml>

Option2: source_model_logic_tree.xml
?xml version="1.0" encoding="UTF-8"?>
<nrml xmlns:gml="http://www.opengis.net/gml"
    <logicTree logicTreeID="lt1">
        <logicTreeBranchingLevel branchingLevelID="bl1">
            <logicTreeBranchSet uncertaintyType="sourceModel"
                                branchSetID="bs1">
                <logicTreeBranch branchID="UK_EC8">
                    <uncertaintyModel>source_model.xml</uncertaintyModel>
                    <uncertaintyWeight>1.0</uncertaintyWeight>
                </logicTreeBranch>
            </logicTreeBranchSet>
        </logicTreeBranchingLevel>
      <logicTreeBranchingLevel branchingLevelID="bl2">
            <logicTreeBranchSet uncertaintyType="maxMagGRRelative"
                                applyToSources="1 2 3 4 5 6 7 8 9 10 11 12 13 15 17 18 19 20 21"
                                branchSetID="bs2">
                <logicTreeBranch branchID="Mmax12">
                    <uncertaintyModel>5.5</uncertaintyModel>
                    <uncertaintyWeight>0.2</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax22">
                    <uncertaintyModel>6.0</uncertaintyModel>
                    <uncertaintyWeight>0.5</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax32">
                    <uncertaintyModel>6.5</uncertaintyModel>
                    <uncertaintyWeight>0.3</uncertaintyWeight>
                </logicTreeBranch>
             </logicTreeBranchSet>
        </logicTreeBranchingLevel>
      <logicTreeBranchingLevel branchingLevelID="bl3">
            <logicTreeBranchSet uncertaintyType="maxMagGRRelative"
                                applyToSources="14 16 22 23"
                                branchSetID="bs3">
                <logicTreeBranch branchID="Mmax13">
                    <uncertaintyModel>6.0</uncertaintyModel>
                    <uncertaintyWeight>0.6</uncertaintyWeight>
                </logicTreeBranch>
                <logicTreeBranch branchID="Mmax23">
                    <uncertaintyModel>6.5</uncertaintyModel>
                    <uncertaintyWeight>0.4</uncertaintyWeight>
                </logicTreeBranch>
             </logicTreeBranchSet>
        </logicTreeBranchingLevel>
    </logicTree>
</nrml>
~

michele....@globalquakemodel.org

unread,
Apr 18, 2019, 7:26:42 AM4/18/19
to OpenQuake Users


On Wednesday, April 17, 2019 at 2:50:12 PM UTC+2, 255i...@gmail.com wrote:
Ciao,
Thank you very much for the answer.
I think the problem is connected with the file source_model_logic_tree.xml. When I do not include the Mmax logic tree (Option1 below), the script runs well; when I include the Mmax logic tree using maxMagGRRelative, the error message (Option2 below).

Please use the command

$ oq zip job.ini

and send the resulting job.zip file to engine....@openquake.org, then I will have enough information to debug the issue.

   Michele
Reply all
Reply to author
Forward
0 new messages