# Beam delivery timing

**URL:** <https://opentps.discourse.group/t/beam-delivery-timing/127>\
**Category:** General\
**Created:** [May 19, 2026, 9:30am UTC](https://opentps.discourse.group/t/beam-delivery-timing/127 "2026-05-19T09:30:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacinta](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jacinta](https://opentps.discourse.group/u/jacinta)\
**Post date:** [May 19, 2026, 9:30am UTC](https://opentps.discourse.group/t/beam-delivery-timing/127/1 "2026-05-19T09:30:20Z")

</div>

Hi,

I’m trying to calculate the total delivery time for a plan i.e. irradiation time + scanning time + energy layer switching time.

Starting with the example provided in “run\_PBSDeliveryTimings.py”, the outputs using

`print(plan_with_timings._beams[0]._layers[0]._`_`dict`_`_)`

give spot positions (x,y), mu, start times, irradiation duration etc. this irradiation time however is only for each spot? I noted for successive layers the start time only indicates 10ms between layers (i.e. taking the start time + irradiation time, compared with the start time of the next layer) which doesn’t account for the energy layer switching time? (default 0.6s according to the `SimpleBeamDeliveryTimings` class)

Is there a way I can get the total beam delivery time?

Thanks,

Jacinta

---

<div class="post-metadata">

**Author:** ![jacinta](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jacinta](https://opentps.discourse.group/u/jacinta)\
**Post date:** [May 19, 2026, 10:30am UTC](https://opentps.discourse.group/t/beam-delivery-timing/127/2 "2026-05-19T10:30:28Z")

</div>

I think I might’ve managed to get it, please let me know if this works correctly -

I created another function in the `SimpleBeamDeliveryTimings`class to return `accumul_layer_time` as previously defined i.e. `accumul_layer_time += np.sum(scanningTime) + np.sum(irradiationTime)`

Calling this function gives me a float

---

<div class="post-metadata">

**Author:** ![dormalv](https://yyz2.discourse-cdn.com/free1/user_avatar/opentps.discourse.group/dormalv/32/18_2.png) [@dormalv](https://opentps.discourse.group/u/dormalv)\
**Post date:** [June 26, 2026, 3:23pm UTC](https://opentps.discourse.group/t/beam-delivery-timing/127/3 "2026-06-26T15:23:41Z")

</div>

Hello jacinta,

Sorry to have missed your message, we had important deadlines to work on this month.

The \_irradiationDuration is indeed provided for each spot. The \_startTime is also provided for each spot of the layer and the values are accumulated across the layers. For instance, the \_startTime of the layer 2 = \_startTime of the last spot of layer 1 + \_irradiationTime of the last spot of layer 1 + layerSwitchDuration. If you want to have the delivery time of your plan, you don’t need to create a new function but you can just sum the \_startTime of the last spot of the last layer of your plan with the \_irradiationDuration of the last spot of the last layer of your plan.

We hope this is clearer now.

Best,  
Valentine
