Skip to content

TopHatWindow (mis-)use #81

@xgarrido

Description

@xgarrido

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

sacc/sacc/sacc.py

Line 1203 in 767686a

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

sacc/sacc/sacc.py

Line 1203 in 767686a

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions