tape.utils#

Subpackages#

Submodules#

Classes#

ColumnMapper

Maps columns from a given dataset into known ensemble column

IndexCallable

Provide getitem syntax for functions

Package Contents#

class ColumnMapper(id_col=None, time_col=None, flux_col=None, err_col=None, band_col=None)[source]#

Maps columns from a given dataset into known ensemble column

Column#
map#
required#
known_maps#
abstract _set_known_map(hipscat=True)[source]#

Must be defined in a known map class

use_known_map(map_id, hipscat=True)[source]#

Use a known mapping scheme

Parameters:
  • map_id ('str') – Identifies which mapping scheme to use

  • hipscat ('bool') – Indicates whether the data is in hipscat format or not, which will affect the chosen ID column (_hipscat_index will be used when hipscat is true. True by default.

Returns:

  • A ColumnMapper subclass object dependent on the map_id provided,

  • ZTFColumnMapper in the case of “ZTF” for example

is_ready(show_needed=False)[source]#

shows whether the ColumnMapper has all critical columns assigned

Parameters:

show_needed ('bool', optional) – Indicates whether to also return a list of missing columns

Return type:

bool or tuple of (bool, list) dependent on show_needed parameter

assign(id_col=None, time_col=None, flux_col=None, err_col=None, band_col=None)[source]#

Updates a given set of columns

Parameters:
  • id_col ('str', optional) – Identifies which column contains the Object IDs

  • time_col ('str', optional) – Identifies which column contains the time information

  • flux_col ('str', optional) – Identifies which column contains the flux/magnitude information

  • err_col ('str', optional) – Identifies which column contains the flux/mag error information

  • band_col ('str', optional) – Identifies which column contains the band information

  • nobs_col (list of 'str', optional) – Identifies which columns contain number of observations for each band, if available in the input object file

  • nobs_tot_col ('str', optional) – Identifies which column contains the total number of observations, if available in the input object file

class IndexCallable(fn, dirty, ensemble, label)[source]#

Provide getitem syntax for functions

>>> def inc(x):
...     return x + 1
>>> I = IndexCallable(inc)
>>> I[3]
4
__slots__ = ('fn', 'dirty', 'ensemble', 'label')#
fn#
dirty#
ensemble#
label#
__getitem__(key)[source]#