pymontecarlo/pypenelopetools

Problem with energy deposition detectors of PENMAIN

ppinard opened this issue · 0 comments

This line
siminput.energy_deposition_detectors.add(0.0, beam_energy_eV, 1024, spectrum_filename='spc-enddet-01.dat', kb=1)

returns the following error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-f240af90b316> in <module>
----> 1 simdir = create_simulation(outdir, KPAR.ELECTRON, 30e3)

<ipython-input-7-387ef989d7c4> in create_simulation(outdir, kpar, beam_energy_eV, minimum_energy_eV)
     83     siminput.NBANGL.set(45, 30)
     84 
---> 85     siminput.energy_deposition_detectors.add(0.0, beam_energy_eV, 1024, spectrum_filename='spc-enddet-01.dat', kb=index_lookup[module_si])
     86 
     87     siminput.GRIDX.set(-10.0, 10.0, 1)

c:\users\pinardp\workspace\external\pymontecarlo\pypenelopetools\pypenelopetools\penmain\keywords.py in add(self, el, eu, nbe, spectrum_filename, kb)
    362     def add(self, el, eu, nbe, spectrum_filename=None, kb=None):
    363         return super().add(el, eu, nbe, spectrum_filename, kb)
--> 364 
    365 class GRIDR(TypeKeyword):
    366     """

c:\users\pinardp\workspace\external\pymontecarlo\pypenelopetools\pypenelopetools\penelope\keyword.py in add(self, *args)
    222         """
    223         keyword = self._create_keyword()
--> 224         keyword.set(*args)
    225         self._add_keyword(keyword)
    226         return keyword

c:\users\pinardp\workspace\external\pymontecarlo\pypenelopetools\pypenelopetools\penmain\keywords.py in set(self, el, eu, nbe, spectrum_filename, kb)
    353         self.EDSPC.set(spectrum_filename)
    354         self._set_keyword_sequence(self.EDBODY, kb)
--> 355 
    356 class EnergyDepositionDetectors(KeywordSequence):
    357 

c:\users\pinardp\workspace\external\pymontecarlo\pypenelopetools\pypenelopetools\penelope\keyword.py in _set_keyword_sequence(self, keyword, values)
    185 
    186         for args in values:
--> 187             keyword.add(*args)
    188 
    189     @property

TypeError: add() argument after * must be an iterable, not int