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_table
Table
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.
- index_table
Attributes Summary
The index table.
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.
- classmethod from_index_table(index_table, copy=True, meta=None)[source]¶
Return a dataset from an index table.
- Parameters
- index_table
astropy.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.
- index_table
- get_meta_keys(option)[source]¶
Return a set of meta keys.
option
can be one of:union
: The union of all meta keys in all BODs.intersection
: The intersection of all meta keys in all BODs.
- select(cond, desc=None)[source]¶
Return a subset of the dataset specified by
cond
When
cond
is a string, the index table is converted toDataFrame
and the selection is done byeval()
.- Parameters
- condstr or
ndarray
The condition to create the subset.
- descstr
A description of this selection to include in the table meta.
- condstr or
- Returns
BasicObsDataset
The subset as a new dataset instance.