NcFileIO

class tolteca.datamodels.io.NcFileIO(source=None, open_=True, load_meta_on_open=True, auto_close_on_pickle=True)[source]

Bases: tolteca.datamodels.io.base.DataFileIO, tolteca.datamodels.io.toltec.kidsdata._NcFileIOKidsDataAxisSlicerMixin

A class to read data from TolTEC netCDF files.

Parameters
sourcestr, pathlib.Path, FileLoc, netCDF4.Dataset

The data file location or netCDF dataset. This is passed to NcNodeMapper.

open_bool

If True and source is set, open the file.

load_meta_on_openbool

If True, the meta data will be loaded upon opening of the file.

auto_close_on_picklebool

If True, the dataset is automatically closed when pickling. This is ignored if source is None.

Attributes Summary

axis_types

block_loc

The axis slicer for locating block.

data_kind

The data kind.

io_registry_info

logger

meta

nc_node

The underlying netCDF dataset.

node_mappers

The tree of low level netCDF dataset mappers.

sample_loc

The axis slicer for locating sample.

sweep_loc

The axis slicer for locating sweep.

time_loc

The axis slicer for locating time.

tone_loc

The axis slicer for locating tone.

Methods Summary

get_sweep_axis_data([block_index])

Return the tones at block_index.

get_tone_axis_data([block_index])

Return the tones at block_index.

open([source])

Return a context to operate on source.

read(**slicer_args)

Read the file and return a data object.

Attributes Documentation

axis_types
block_loc

The axis slicer for locating block.

data_kind

The data kind.

io_registry_info = {'identifier': <function identify_toltec_nc_file>, 'label': 'nc.toltec.kidsdata'}
logger = <Logger NcFileIO (DEBUG)>
meta
nc_node

The underlying netCDF dataset.

node_mappers

The tree of low level netCDF dataset mappers.

sample_loc

The axis slicer for locating sample.

sweep_loc

The axis slicer for locating sweep.

time_loc

The axis slicer for locating time.

tone_loc

The axis slicer for locating tone.

Methods Documentation

get_sweep_axis_data(block_index=None)[source]

Return the tones at block_index.

get_tone_axis_data(block_index=None)[source]

Return the tones at block_index.

open(source=None)[source]

Return a context to operate on source.

Parameters
sourcestr, pathlib.Path, FileLoc, netCDF4.Dataset, optional

The data file location or netCDF dataset. If None, the source passed to constructor is used. Noe that source has to be None if it has been specified in the constructor.

read(**slicer_args)[source]

Read the file and return a data object.

Parameters
slicer_argsdict

The arguments to specify the data to load. The keys shall be one of the axis names block, tone, sweep, time, or sample.