To change the period definitions, we can type:

d.add(D_ON=(2100, 3900), A_ON=(100, 1900))

where D_ON and A_ON are pairs of numbers (tuples in Python) representing the start and stop values for D or A excitation periods. The previous command works for both μs-ALEX and ns-ALEX measurements. After changing the parameters, a new alternation plot will show the updated period definitions.

The alternation period definition can be applied to the data using the function loader.alex_apply_period (link):

loader.alex_apply_period(d)

After this command, d will contain only photons inside the defined excitation periods. If the user needs to update the periods definition, the data file will need to be reloaded and the steps above repeated as described.