galsci / pysm

PySM 3: Sky emission simulations for Cosmic Microwave Background experiments
https://pysm3.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
36 stars 23 forks source link

Get the emission at multiple frequencies #42

Closed dpole closed 4 years ago

dpole commented 4 years ago

My most common case of use is the production of a multi-frequency observation with delta band passes. I have the frequencies of my experiment in an array of shape (n_freq) and I'd like to get an array of shape (n_freq, n_stokes, n_pixels) containing the observation.

From a quick look at the doc and the code, it seems to me that Sky.get_emission can only return (n_stokes, n_pixels): arrays of frequencies are processed as band-pass samples and integrated over.

Is there a way of getting all the frequencies (as in pysm2's instrument.observe(sky)) or I'm expected to iterate over the frequencies and stack the result in my application code? Thanks!

zonca commented 4 years ago

Correct, you need to iterate. This brought a significant simplification of the API so I decided it was the best choice.

But if you have a benchmark where you can show a significant performance penalty, we can reconsider.

dpole commented 4 years ago

Thanks for the prompt feedback. I don't have any. I am not concerned about performance, I was just looking for the cleanest way to get a multi-frequency observation with this new pysm version.