Closed zonca closed 4 years ago
Bandpass integration done by a Sky component also handles well the case where we have one component that is originally low nside, we can do bandpass integration at original NSIDE and then upgrade before returning it.
Hi @zonca, sorry, these messages were being caught by my email spam filter! I started your first request recently, and have submitted that as PR#13 for your comments.
thanks @bthorne93 for now better wait for my MPI implementation to be complete, because it affects a lot of the code base. Once I'm done with that and you review and merge, we can think about the other issues. I mostly wrote them down as discussion points.
Ok!
On Thu, Jan 31, 2019, 12:34 PM Andrea Zonca <notifications@github.com wrote:
thanks @bthorne93 https://github.com/bthorne93 for now better wait for my MPI implementation to be complete, because it affects a lot of the code base. Once I'm done with that and you review and merge, we can think about the other issues. I mostly wrote them down as discussion points.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/healpy/pysm/issues/9#issuecomment-459496510, or mute the thread https://github.com/notifications/unsubscribe-auth/AQHddBET-_Hf15Z4wS5pCi_5JxnnApzsks5vI1NugaJpZM4aXEK2 .
implement bandpass integration with trapezoidal rule:
https://en.wikipedia.org/wiki/Trapezoidal_rule#Numerical_implementation
assume we can have non-uniform spacing, need 1 map to accumulate, 1 for (k-1) and 1 for k.
Initially implement it in pure Python in pysm.Model
, as it is looping only through 10 or so points per channel that should not be a problem. Subclasses can reimplement this more efficiently if that becomes an issue, i.e. having the loop in numba
.
implemented in each model's get_emission
method using the numba utils.trapz_step_inplace
function.
I would like to optimize how bandpass integration is handled.
However, even before that, I would like to optimize how emissions are calculated when we get an input array of frequency.
For example now in the synchrotron power law, we have a loop on the frequencies:
https://github.com/healpy/pysm/blob/584898cad071e591eeb74b633d946502341aa6d9/pysm/component_models/galactic/synchrotron.py#L59
First I'd like to replace those loops with vectorized operations with numpy. This should be a significant performance improvement.
Second, I would like each component model to have a
get_integrated_emission
that gets an array of frequency and an array of weights. This function should perform bandpass integration without having in memory all of the maps at each frequency. For example if you have a tophat with 10 points, in PySM 2 and also in the current implementation of PySM 3, you get 10 IQU maps for all the frequencies and just after perform bandpass integration. I'd like to skip a step and just accumulate a single IQU output map.