DataGetterMixin¶
-
class
Data_Reduction.DataGetterMixin¶ Bases:
objectClass for getting data from a CSV file.
Methods Summary
get_data_channels(data[, ignore])Gets or sets the names of the signal columns
initialize(filename[, delimiter, names, …])Get the data and make a data structure for the observations.
make_channels(signals[, props])Assign properties to the channels.
make_data_struct(data, metadata, signals)Takes a text table with headers and converts it into a numpy
ndarray.open_datafile(filename[, delimiter, names, …])Opens and reads a data file
Methods Documentation
-
get_data_channels(data, ignore=None)¶ Gets or sets the names of the signal columns
Column names are separated into metadata and signals. Names in
ignorere ignored. Names inaliasesare replaced. :param data: data read from text file :type data: ndarray :param ignore: columns to ignore; default None :type ignore: list of str- Returns
metadata, signals
- Return type
(list of str, list of str)
-
initialize(filename, delimiter=' ', names=True, skip_header=0, source=None)¶ Get the data and make a data structure for the observations.
This is not included by default in
__init__()to keep it simple for subclasses.
-
make_channels(signals, props=None)¶ Assign properties to the channels.
The prop keys are “freq”, “pol”, and “IFtype”.
- Parameters
props (dict of dicts) – signal channel properties.
-
make_data_struct(data, metadata, signals)¶ Takes a text table with headers and converts it into a numpy
ndarray.That means that a column can be extracted using data[label].
- Parameters
data ((ndarray) the data from the text file) –
metadata ((list of str) the column names for metadata) –
signals ((list of str) the column names for power-like data) –
-
open_datafile(filename, delimiter=' ', names=True, skip_header=0)¶ Opens and reads a data file
This is used by
Malargue(one data files) andGAVRT(one data file for each signal).
-