Window Functions

class sacc.windows.BandpowerWindow(values, weight)[source]

The BandpowerWindow class defines a tabulated for power spectrum bandpowers.

The class contains tabulated values of ell and corresponding weights values for each one. More than one set of weights can be used.

Parameters:
values: array

An array of dimension (N_ell) containing the ell values at which the weights are defined.

weight:

An array of dimensions (N_ell, N_weight) containing N_weight sets of weights corresponding to each value.

Methods

from_table(table)

Convert an astropy table to a dictionary of Windows

from_tables(table_list)

Turn a list of astropy tables into window objects

get_section(indices)

Get part of this window function corresponding to the input indices.

to_tables(window_list)

Convert a list of windows to a list of astropy tables.

classmethod from_table(table)[source]

Convert an astropy table to a dictionary of Windows

One window is extracted from the table.

Parameters:
table: astropy.table.Table
Returns:
windows: dict

Dictionary of id -> Window instances

get_section(indices)[source]

Get part of this window function corresponding to the input indices.

Parameters:
indices: int or array_like

Indices to return.

Returns:
window: Window

A `Window object.

classmethod to_tables(window_list)[source]

Convert a list of windows to a list of astropy tables.

One table is created per window.

The tables contain an ID column which uniquely identifies the window instance, but only whilst running a given python process - it is not portable. It should not be used for anythng other than I/O.

Parameters:
instance_list: list

List of Window instances

Returns:
table: list

List of astropy.table.Table instances

class sacc.windows.BaseWindow[source]

Base class for window functions.

Window functions here are for 1D variables and describe binnings from functions onto discrete values.

They are treated as a special kind of tag value in Sacc.

Subclasses describe common types of window function, including a top hat between two values and a general tabulated functional form.

This base class has class methods that can be used to turn mixed lists of windows to/from astropy tables, for I/O.

Methods

from_tables(table_list)

Turn a list of astropy tables into window objects

to_tables(instance_list)

Convert a list of BaseWindos to a list of tables.

classmethod from_tables(table_list)[source]

Turn a list of astropy tables into window objects

This is called when loading data from file.

Parameters:
instance_list: list

List of BaseWindow instances

Returns:
windows: dict

Dictionary of id -> Window instances

classmethod to_tables(instance_list)[source]

Convert a list of BaseWindos to a list of tables.

This is called when saving data to file.

The input instances can be different subclasses, and no ordering is maintained.

Parameters:
instance_list: list

List of BaseWindow subclass instances

Returns:
table: list

List of astropy.table.Table instances

class sacc.windows.LogTopHatWindow(range_min, range_max)[source]

A window function that is log-constant between two values.

This object is the same as the TopHat form, except that in between the min and max values it is assumed to be constant in the log of the argument. The difference arises when this object is used elsewhere.

Methods

from_table(table)

Convert an astropy table to a dictionary of Top-Hat windows

from_tables(table_list)

Turn a list of astropy tables into window objects

to_tables(window_list)

Convert a list of Top-Hat windows to a list of astropy tables.

class sacc.windows.TopHatWindow(range_min, range_max)[source]

A window function that is constant between two values.

The top-hat is zero elsewhere.

In the case of discrete functions like ell window where it matters, these window functions should follow the python convention and the upper limit should be exclusive, so that you can use range(win.min, win.max) to select the right ell values.

Parameters:
min: int/float

The minimum value where the top-hat function equals 1

max: int/float

The maximum value where the top-hat function equals 1

Methods

from_table(table)

Convert an astropy table to a dictionary of Top-Hat windows

from_tables(table_list)

Turn a list of astropy tables into window objects

to_tables(window_list)

Convert a list of Top-Hat windows to a list of astropy tables.

classmethod from_table(table)[source]

Convert an astropy table to a dictionary of Top-Hat windows

Multiple windows are extracted from the single table.

Parameters:
table: astropy.table.Table
Returns:
windows: dict

Dictionary of id -> TopHatWindow instances

classmethod to_tables(window_list)[source]

Convert a list of Top-Hat windows to a list of astropy tables.

A single table is created for all the windows.

The tables contain an ID column which uniquely identifies the window instance, but only whilst running a given python process - it is not portable. It should not be used for anythng other than I/O.

Parameters:
instance_list: list

List of TopHatWindow instances

Returns:
table: list

List of astropy.table.Table instances

class sacc.windows.Window(values, weight)[source]

The Window class defines a tabulated window function.

The class contains tabulated values of the abscissa (e.g. ell or theta) and corresponding weights values for each one.

The function could be integrated or summed depending on the context.

Parameters:
values: array

The points at which the weights are defines

weight:

The weights corresponding to each value

Methods

from_table(table)

Convert an astropy table to a dictionary of Windows

from_tables(table_list)

Turn a list of astropy tables into window objects

to_tables(window_list)

Convert a list of windows to a list of astropy tables.

classmethod from_table(table)[source]

Convert an astropy table to a dictionary of Windows

One window is extracted from the table.

Parameters:
table: astropy.table.Table
Returns:
windows: dict

Dictionary of id -> Window instances

classmethod to_tables(window_list)[source]

Convert a list of windows to a list of astropy tables.

One table is created per window.

The tables contain an ID column which uniquely identifies the window instance, but only whilst running a given python process - it is not portable. It should not be used for anythng other than I/O.

Parameters:
instance_list: list

List of Window instances

Returns:
table: list

List of astropy.table.Table instances