In the context of Simons Observatory, we would like to use the TopHatWindow to only store the bin edges. So far, we have been using with success the BandpowerWindow and we store them with the following idiom
sacc_obj.add_ell_cl(..., window=bp_window)
We can't do that with the TopHatWindow and we are getting errors due to this line
|
if isinstance(window, BandpowerWindow): |
that do not duplicate windows as it is done with
BandpowerWindow. I guess we are wrong in the way to use/store the
TopHatWindow. It may be related to the fact that it is not clear what is exactly the content and attributes of the
TopHatWindow class. The docstring says the
min/max class attributes should be
int/float scalars but the unit test
|
def test_tophat_window(): |
actually plays fine with
numpy arrays. In my mind, the
min/max attributes should be the bin edges and then
numpy arrays.
If we overpass the
|
if isinstance(window, BandpowerWindow): |
issue then we get errors when retrieving the window
via the
get_bandpower_windows function due this line
|
if not isinstance(ws, BandpowerWindow): |
. Here again, I think we miss the point on how to use this window.
If we treat the TopHatWindow the same way as BandpowerWindow, I can propose a PR with little modification (mainly I write a get_section method for TopHatWindow to extract a subset of bin edges given the selected indices) but I would like to hear from sacc experts or TopHatWindow users how to properly use this window.
Also related to #72
In the context of Simons Observatory, we would like to use the
TopHatWindowto only store the bin edges. So far, we have been using with success theBandpowerWindowand we store them with the following idiomWe can't do that with the
TopHatWindowand we are getting errors due to this linesacc/sacc/sacc.py
Line 1203 in 767686a
BandpowerWindow. I guess we are wrong in the way to use/store theTopHatWindow. It may be related to the fact that it is not clear what is exactly the content and attributes of theTopHatWindowclass. The docstring says themin/maxclass attributes should beint/floatscalars but the unit testsacc/test/test_sacc2.py
Line 510 in 767686a
numpyarrays. In my mind, themin/maxattributes should be the bin edges and thennumpyarrays.If we overpass the
sacc/sacc/sacc.py
Line 1203 in 767686a
get_bandpower_windowsfunction due this linesacc/sacc/sacc.py
Line 973 in 767686a
If we treat the
TopHatWindowthe same way asBandpowerWindow, I can propose a PR with little modification (mainly I write aget_sectionmethod forTopHatWindowto extract a subset of bin edges given the selected indices) but I would like to hear fromsaccexperts orTopHatWindowusers how to properly use this window.Also related to #72