Skip to content

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

@julgp

Description

@julgp

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions