# Baseband¶

Welcome to the Baseband documentation! Baseband is a package affiliated with the Astropy project for reading and writing VLBI and other radio baseband files, with the aim of simplifying and streamlining data conversion and standardization. It provides:

• File input/output objects for supported radio baseband formats, enabling selective decoding of data into Numpy arrays, and encoding user-defined arrays into baseband formats. Supported formats are listed under specific file formats.

• The ability to read from and write to an ordered sequence of files as if it was a single file.

It can be extended with the more experimental baseband-tasks package, which provides tasks to, e.g., Channelize or Dedisperse sample streams.

If you used this package in your research, please cite it via DOI 10.5281/zenodo.1214268.

## Specific File Formats¶

Baseband’s code is subdivided into its supported file formats, and the following sections contain format specifications, usage notes, troubleshooting help and APIs for each.

## Core Framework and Utilities¶

These sections contain APIs and usage notes for the sequential file opener, the API for the set of core utility functions and classes located in base, and sample data that come with baseband (mostly used for testing).

## Developer Documentation¶

The developer documentation features tutorials for supporting format extensions such as VDIF EDV or a completely new format, possibly making it available as a baseband.io plugin. It also contains instructions for publishing new code releases.

## Reference/API¶

### baseband Package¶

#### Functions¶

 file_info(name[, format]) Get format and other information from a baseband file. open(name[, mode, format]) Open a baseband file (or sequence of files) for reading or writing. test(**kwargs) Run the tests for the package.

### baseband.io Package¶

Baseband general I/O routines and entry point.

Contains general open and file_info functions that can iterate over possible formats to determine which is the right one, including possible formats discovered via entry point ‘baseband.io’, such as the hdf5 module from the baseband-tasks package.

Any ‘baseband.io’ entry points are treated as possible formats if they point to a module (e.g., ‘vdif = baseband.vdif’). Any entries that have object names (e.g., ‘fancy_open = mypackage.io:open’) are just added to the name space.

#### Attributes¶

FORMATSlist

Available baseband formats.

#### Functions¶

 open(name[, mode, format]) Open a baseband file (or sequence of files) for reading or writing. file_info(name[, format]) Get format and other information from a baseband file.

The tasks are imported via plugins discovered via entry point ‘baseband.tasks’, such as are provided by the baseband-tasks package. A special rule for the entry points is that if it points to __all__, all items from that list will be imported. Furthermore, if any name starts with ‘_’, it is not imported.

Sample entry point entries:

# Import just a module
# Import just one class
# Import all entries as well as the module