Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug when to get_total_mfd a big gridded source is passed #120

Open
julgp opened this issue Jan 30, 2020 · 0 comments
Open

bug when to get_total_mfd a big gridded source is passed #120

julgp opened this issue Jan 30, 2020 · 0 comments
Assignees

Comments

@julgp
Copy link
Contributor

julgp commented Jan 30, 2020

When I used "get_total_mfd" to get the Total MDF from a large gridded point source like gridded_seismicity_source_40.xml from SAM model (48107 point sources), I got the following error:
Traceback (most recent call last):
File "./test_01.py", line 87, in
main(sys.argv[1:])
File "./test_01.py", line 83, in main
p.callfunc()
File "/Users/jgarcia/oq/src/oq-engine/openquake/baselib/sap.py", line 181, in callfunc
return self.func(**vars(namespace))
File "./test_01.py", line 66, in make
mdfall1 = get_total_mfd(sources, trt=None)
File "/Users/jgarcia/oq/src/oq-mbtk/openquake/man/checks/mfd.py", line 26, in get_total_mfd
mfdall.stack(mfd)
File "/Users/jgarcia/oq/src/oq-mbtk/openquake/mbt/tools/mfd.py", line 263, in stack
mfd2 = mfd_resample(bin_width, mfd2)
File "/Users/jgarcia/oq/src/oq-mbtk/openquake/mbt/tools/mfd.py", line 375, in mfd_resample
return mfd_downsample(bin_width, mfd)
File "/Users/jgarcia/oq/src/oq-mbtk/openquake/mbt/tools/mfd.py", line 480, in mfd_downsample
return EvenlyDiscretizedMFD(nocc[0, 0], bin_width, list(nocc[:, 3]))
IndexError: index 0 is out of bounds for axis 0 with size 0

With smaller sources the code works (i.e. gridded_seismicity_source_04.xml)
I'm attaching a zip with the sources and test code.
Archive.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants