drs4.specs.vdif module#
- class drs4.specs.vdif.VDIF(time: ~typing.Annotated[~drs4.specs.common.Time | ~typing.Any, <Role.COORD: 'coord'>], chan: ~typing.Annotated[~drs4.specs.common.Chan | ~typing.Any, <Role.COORD: 'coord'>], auto: ~typing.Annotated[~drs4.specs.vdif.Auto | ~typing.Any, <Role.DATA: 'data'>], integ_time: ~typing.Annotated[~typing.Literal[100, 200, 500, 1000], <Role.ATTR: 'attr'>])[source]#
Bases:
AsDataArrayData specification of DRS4 VDIF.
- auto: DATA: 'data'>]#
Auto-correlation spectra.
- chan: COORD: 'coord'>]#
Channel number (0-511).
- integ_time: ATTR: 'attr'>]#
Spectral integration time in ms (100|200|500|1000).
- spec_version: ATTR: 'attr'>] = 0#
Version of the data specification.
- time: COORD: 'coord'>]#
Measured time in UTC.
- drs4.specs.vdif.open_vdif(vdif: PathLike[str] | str, /, *, integ_time: Literal[100, 200, 500, 1000] | None = None, join: Literal['outer', 'inner', 'left', 'right', 'exact', 'override'] = 'inner') DataArray[source]#
Open a VDIF file as a DataArray.
- Parameters:
vdif – Path of input VDIF file.
integ_time – Spectral integration time in ms (100|200|500|1000). If not specified, it will be inferred from the VDIF file.
join – Method of joining the first- and second-half spectra.
- Returns:
DataArray of the input VDIF file.
- Raises:
RuntimeError – Raised if the spectral integration time cannot be inferred from the VDIF file (frame number).
ValueError – Raised if the given (or inferred) spectral integration time is other than 100|200|500|1000 ms.