matteolucchini1 / nDspec

A modular X-ray spectral-timing astronomy modelling package
MIT License
4 stars 0 forks source link

Models should be vector-calculable #15

Closed bjricketts closed 3 months ago

bjricketts commented 3 months ago

Currently models in models.py are singular evaluations. Due to how these models are written, it should be somewhat trivial to make these models vector-compatible - e.g. calculating multiple power laws simultaneously.

As models.py is more intended to be simple examples for users to then code their own models, this isn't high priority but it could be advantageous to make users aware of these possibilities in speeding up their own code.

bjricketts commented 3 months ago

Linked dev branch has implemented vector calculations but exhibits slight discrepancies between evaluations in series vs in parallel of around 10^-5 - 10^-6%. As this is a very small error likely caused by computer precision and numpy, we'll consider this not a concern.