Enhance interpolation speed

Abierto
#1,145 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 3 días

@steven-murray ya está trabajando en esto.

Desde el 15/2/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

beams enhancement HERA

There are a lot of checks that are done in the interpolation methods, some of which are more compute-intensive than others. For example, #1144 adds the ability to skip one of these checks.

Furthermore, calling eg. _interp_az_za_simple always creates the phi_use and theta_use arrays, even when they are not required because the interpolation functions have already been computed and stored. This is not hugely computationally expensive, but does give an estimated ~30% slowdown compared to just calling the saved spline directly (this number was something I noticed for a single use case, so is highly subject to uncertainty/variability).

There may be ways to deal with this a bit more intelligently. Some examples:

  1. Let the interp() function to know ahead of time if these arrays need to be computed. However, this is a bit tricky because it's not a single spline that's created, but multiple splines (for each pol/spw/feed/freq), and while one may be stored, others that are requested may not be. We'd then have to put in a little check for that.
  2. Another way would be to have documentation/methods that allow directly calling the saved interpolations without any other checks, at the user's own peril.
  3. Another way would be to refactor the existing interpolation private methods to call a function that returned the interpolators themselves, and then used those to interpolate to the new az/za. This new intermediate function could then be called by users to save copies of the interpolation functions in whatever way they choose, to be called in any way they choose.

There might be other ways as well.

Having written this down, my vote would be to do something like (2) -- have an explicit method called something like "az_za_simple_fast" that just assumes the splines have been computed before and goes and uses them, and errors if they're not there. This could be called from interp() if a parameter like no_checks is set.

Lenguaje dominante
Python
Estrellas
103
Forks
40
Merge medio
4 d 11 h
PR fusionados (30 d)
13

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RadioAstronomySoftwareGroup/pyuvdata

Todos los issues de RadioAstronomySoftwareGroup/pyuvdata

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.