# Question on setting the source energy

**URL:** <https://openmc.discourse.group/t/question-on-setting-the-source-energy/4249>\
**Category:** User Support\
**Created:** [May 9, 2024, 9:21am UTC](https://openmc.discourse.group/t/question-on-setting-the-source-energy/4249 "2024-05-09T09:21:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorL](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@VictorL](https://openmc.discourse.group/u/VictorL)\
**Post date:** [May 9, 2024, 9:21am UTC](https://openmc.discourse.group/t/question-on-setting-the-source-energy/4249/1 "2024-05-09T09:21:56Z")

</div>

Hello everyone,

I’m trying to set the energy of the source. I have found that  
"source.energy = openmc.stats.Discrete([energy], [probability]) "  
can only describe the discrete energy points.

I have a question: When I apply the energy bins instead of the energy points, and I want to define the probability of each energy bin by myself, openmc.stats.Discrete cannot realize it. Is there any method to realize this purpose?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 9, 2024, 1:57pm UTC](https://openmc.discourse.group/t/question-on-setting-the-source-energy/4249/2 "2024-05-09T13:57:48Z")

</div>

Yes, you can use the [`openmc.stats.Tabular`](https://docs.openmc.org/en/stable/pythonapi/generated/openmc.stats.Tabular.html) class to represent an energy distribution binned over intervals.

---

<div class="post-metadata">

**Author:** ![VictorL](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@VictorL](https://openmc.discourse.group/u/VictorL)\
**Post date:** [May 10, 2024, 12:49am UTC](https://openmc.discourse.group/t/question-on-setting-the-source-energy/4249/3 "2024-05-10T00:49:06Z")

</div>

OK, thank you very much! I will try it.
