pint.utils.dmx_setup

pint.utils.dmx_setup(t: ~pint.toa.TOAs | ~astropy.units.quantity.Quantity | ~astropy.time.core.Time, minwidth: ~astropy.units.quantity.Quantity = <Quantity 10. d>, mintoas: int = 1) Tuple[Quantity, Quantity, ndarray][source]

Set up DMX bins with a minimal binning strategy

The nominal binwidth will be >=`minwidth`, but will always include >=`mintoas` TOAs. No dividing based on observing frequency is done.

Parameters:
  • t (pint.toa.TOAs or astropy.units.Quantity or astropy.time.Time) – Input TOAs to divide. If Quantity, assume MJD

  • minwidth (astropy.units.Quantity) – Minimum bin width

  • mintoas (int) – Minimum number of TOAs in a bin

Returns:

  • R1 (astropy.units.Quantity) – Start times of the bins

  • R2 (astropy.units.Quantity) – Stop times of the bins

  • N (np.ndarray) – Number of TOAs in each bin

Example

To use the output of this function:

>>> R1, R2, N = dmx_setup(t)
>>> model.add_component(pint.models.dispersion_model.DispersionDMX())
>>> model.DMXR1_0001.value = R1[0].value
>>> model.DMXR2_0001.value = R2[0].value
>>> model.add_DMX_ranges(R1[1:].value, R2[1:].value, frozens=False)

Since the first DMX range already exists, we update those values before adding the other ranges.