BasicObsDataset

class tolteca.datamodels.toltec.BasicObsDataset(index_table=None, bod_list=None, include_meta_cols='intersection', **kwargs)[source]

Bases: object

A helper class to access a set of TolTEC basic obs data items.

An instance of this class is typically created from one of its from_* factory functions.

This class is implemented as a thin wrapper around an index table (a Table instance) that contains information to identify BOD items.

Parameters
index_tableTable

The table that identifies a set of BOD items.

bod_listlist

A list of BasicObsData instances.

include_meta_colsstr, list

The columns to include in the index table, extracted from the loaded meta data.

**kwargs

Passed to BasicObsData constructor.

Attributes Summary

bod_list

history

index_table

The index table.

logger

meta

Methods Summary

add_meta_cols(keys)

Add meta data info to the index table.

dump(filepath)

from_files(files[, open_])

from_index_table(index_table[, copy, meta])

Return a dataset from an index table.

get_meta_keys(option)

Return a set of meta keys.

join(other, *args, **kwargs)

load(filepath)

read(*args, **kwargs)

Return a generator of data items.

read_all(*args, **kwargs)

Return a list of data items.

select(cond[, desc])

Return a subset of the dataset specified by cond

sort(*args)

unique(*args, **kwargs)

vstack(instances)

write_index_table(*args, **kwargs)

Attributes Documentation

bod_list
history
index_table

The index table.

logger = <Logger BasicObsDataset (DEBUG)>
meta

Methods Documentation

add_meta_cols(keys)[source]

Add meta data info to the index table.

Parameters
keyslist, str

The keys to add. When string, this is passed as the option to get_meta_keys() to get the keys.

dump(filepath)[source]
classmethod from_files(files, open_=True, **kwargs)[source]
classmethod from_index_table(index_table, copy=True, meta=None)[source]

Return a dataset from an index table.

Parameters
index_tableastropy.table.Table, str

The table or that path to the table that contains the BOD identifiers.

copybool

If True, a copy of the index_table is made.

metadict

Additional meta get stored in the table.

get_meta_keys(option)[source]

Return a set of meta keys.

option can be one of:

  1. union: The union of all meta keys in all BODs.

  2. intersection: The intersection of all meta keys in all BODs.

join(other, *args, **kwargs)[source]
classmethod load(filepath)[source]
read(*args, **kwargs)[source]

Return a generator of data items.

read_all(*args, **kwargs)[source]

Return a list of data items.

select(cond, desc=None)[source]

Return a subset of the dataset specified by cond

When cond is a string, the index table is converted to DataFrame and the selection is done by eval().

Parameters
condstr or ndarray

The condition to create the subset.

descstr

A description of this selection to include in the table meta.

Returns
BasicObsDataset

The subset as a new dataset instance.

sort(*args)[source]
unique(*args, **kwargs)[source]
classmethod vstack(instances)[source]
write_index_table(*args, **kwargs)[source]